model and checks
[repair.git] / Repair / RepairCompiler / MCC / IR / ImageSetExpr.java
index ac255ca0686e991064e8cd5e03ecc2ec64547f41..52adc76758950df0f38d163073abde502d450384 100755 (executable)
@@ -28,10 +28,23 @@ public class ImageSetExpr extends SetExpr {
         return v;
     }
 
-    public void generate(CodeWriter writer, VarDescriptor vd) {
+    public void generate(CodeWriter writer, VarDescriptor dest) {
         throw new IRException("not supported");
     }
 
+    public void generate_inclusion(CodeWriter writer, VarDescriptor dest, VarDescriptor element) {
+        String hash = inverse ? "_hashinv->contains(" : "_hash->contains(" ;
+        writer.outputline("int " + dest.getSafeSymbol() + " = " + rd.getSafeSymbol() + hash + vd.getSafeSymbol() + ", " + element.getSafeSymbol() + ");");
+    }    
+
+    public void generate_size(CodeWriter writer, VarDescriptor dest) {
+        assert dest != null;
+        assert vd != null;
+        assert rd != null;
+        String hash = inverse ? "_hashinv->count(" : "_hash->count(" ;
+        writer.outputline("int " + dest.getSafeSymbol() + " = " + rd.getSafeSymbol() + hash + vd.getSafeSymbol() + ");");
+    }
+
     public void prettyPrint(PrettyPrinter pp) {
         throw new IRException("not supported");
     }