omputation to determine set of aliased parameter indices was very conservative,
[IRC.git] / Robust / src / IR / Flat / FlatCall.java
index f8a5d39e7bc18dbd8838b9976f3332efbf060fe4..5130b1c476457d936c751e93449e6a3e99dd9d5f 100644 (file)
@@ -50,6 +50,26 @@ public class FlatCall extends FlatNode {
     return args[i];
   }
 
+  public TempDescriptor getArgMatchingParamIndex(FlatMethod fm, int i) {
+    // in non-static methods the "this" pointer
+    // affects the matching index
+    if( method.isStatic() ) {
+      assert numArgs()   == fm.numParameters();
+    } else {
+      assert numArgs()+1 == fm.numParameters();
+    }
+
+    if( method.isStatic() ) {
+      return args[i];
+    }
+
+    if( i == 0 ) {
+      return this_temp;
+    }
+    
+    return args[i-1];
+  }
+
   public String toString() {
     String st="FlatCall_";
     if (dst==null) {