]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EIf.java
(refs #7375) Replace collectRefs by CollectRefsVisitor
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EIf.java
index 418ba69c9cda9c2e3b1c352daedc02176e8b1570..ea64ac034c152e120f6472902233a246e1fcb5cf 100644 (file)
@@ -39,29 +39,22 @@ public class EIf extends Expression {
         this.else_ = else_;
     }
 
-       public void collectRefs(TObjectIntHashMap<Object> allRefs, TIntHashSet refs) {
-        condition.collectRefs(allRefs, refs);
-        then_.collectRefs(allRefs, refs);
-        if(else_ != null)
-            else_.collectRefs(allRefs, refs);
-    }
-
-       @Override
-       public void collectVars(TObjectIntHashMap<Variable> allVars,
-               TIntHashSet vars) {
-           condition.collectVars(allVars, vars);
+    @Override
+    public void collectVars(TObjectIntHashMap<Variable> allVars,
+            TIntHashSet vars) {
+        condition.collectVars(allVars, vars);
         then_.collectVars(allVars, vars);
         if(else_ != null)
             else_.collectVars(allVars, vars);
-       }
+    }
 
-       @Override
-       protected void updateType() throws MatchException {
-           setType(then_.getType());
-       }
-       
-       @Override
-       public IVal toVal(CompilationContext context, CodeWriter w) {
+    @Override
+    protected void updateType() throws MatchException {
+        setType(then_.getType());
+    }
+
+    @Override
+    public IVal toVal(CompilationContext context, CodeWriter w) {
         IVal conditionVal = condition.toVal(context, w); 
         CodeWriter joinPoint = w.createBlock(getType());
         CodeWriter thenBlock = w.createBlock();