Changes:
[repair.git] / Repair / RepairCompiler / MCC / IR / OpExpr.java
index 4714735bd32e8c284a6538e9f53360433b76e102..09895eb7eb58caeede387eac41dd59d9e974db86 100755 (executable)
@@ -8,6 +8,26 @@ public class OpExpr extends Expr {
     Expr right;
     Opcode opcode;
 
+    public boolean isSafe() {
+       if (right==null)
+           return left.isSafe();
+       return left.isSafe()&&right.isSafe();
+    }
+
+    public Set getfunctions() {
+       Set leftfunctions=left.getfunctions();
+       Set rightfunctions=right.getfunctions();
+       if (leftfunctions!=null&&rightfunctions!=null) {
+           HashSet functions=new HashSet();
+           functions.addAll(leftfunctions);
+           functions.addAll(rightfunctions);
+           return functions;
+       }
+       if (leftfunctions!=null)
+           return leftfunctions;
+       return rightfunctions;
+    }
+
     public void findmatch(Descriptor d, Set  s) {
        left.findmatch(d,s);
        if (right!=null)