X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Felaboration%2Fexpressions%2FGuardedExpressionGroup.java;h=402d6fab3247758ba525f9de7c0147af21bd39e3;hb=refs%2Fchanges%2F34%2F1534%2F3;hp=90e13d7507f1d858b48c56485a84b90bcd3c8125;hpb=6dfe20b0f514b91337fcac4de0267ffd8268be07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/GuardedExpressionGroup.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/GuardedExpressionGroup.java index 90e13d750..402d6fab3 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/GuardedExpressionGroup.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/GuardedExpressionGroup.java @@ -14,9 +14,6 @@ import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; import org.simantics.scl.compiler.types.exceptions.MatchException; -import gnu.trove.map.hash.TObjectIntHashMap; -import gnu.trove.set.hash.TIntHashSet; - public class GuardedExpressionGroup extends Expression { public GuardedExpression[] expressions; @@ -24,16 +21,6 @@ public class GuardedExpressionGroup extends Expression { this.expressions = expressions; } - @Override - public void collectVars(TObjectIntHashMap allVars, - TIntHashSet vars) { - for(GuardedExpression expression : expressions) { - for(Expression guard : expression.guards) - guard.collectVars(allVars, vars); - expression.value.collectVars(allVars, vars); - } - } - @Override protected void updateType() throws MatchException { setType(expressions[0].value.getType()); @@ -101,11 +88,11 @@ public class GuardedExpressionGroup extends Expression { for(Expression guard : expressions[i].guards) { CodeWriter nextW = w.createBlock(); - w.if_(guard.toVal(context, w), nextW.getContinuation(), failure); + w.if_(guard.location, guard.toVal(context, w), nextW.getContinuation(), failure); w = nextW; } - w.jump(success, expressions[i].value.toVal(context, w)); + w.jump(expressions[i].location, success, expressions[i].value.toVal(context, w)); } }