add a convenient method to retreive FlatMethod from task or method
authorjjenista <jjenista>
Wed, 22 Apr 2009 19:56:48 +0000 (19:56 +0000)
committerjjenista <jjenista>
Wed, 22 Apr 2009 19:56:48 +0000 (19:56 +0000)
Robust/src/IR/State.java

index 7a56b5570d5752ac09ef74da5478ff8982394efd..011a1756c0c5eecb52a70f42e29cc14eeaedcb72 100644 (file)
@@ -188,6 +188,19 @@ public class State {
     return (FlatMethod)flatmethodmap.get(td);
   }
 
+  // The descriptor is either a method or task desc
+  // and should call one of the above methods
+  public FlatMethod getMethodFlat(Descriptor d) {
+    FlatMethod fm;
+    if( d instanceof MethodDescriptor ) {
+      fm = getMethodFlat( (MethodDescriptor) d);
+    } else {
+      assert d instanceof TaskDescriptor;
+      fm = getMethodFlat( (TaskDescriptor) d);
+    }
+    return fm;
+  }
+
   public void addTreeCode(MethodDescriptor md, BlockNode bn) {
     treemethodmap.put(md,bn);
   }