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%2FEMatch.java;h=494bcfb5d6bfc9d93aab0b50bfd2de29c233cbb7;hb=138667b7aae3a7984a8d0bb2a39461ce342b08e7;hp=0ca1d54427d13a636ca11eca672ea330dd688cef;hpb=2df6133d08115f25494f7f8009b6601862895f6c;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EMatch.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EMatch.java index 0ca1d5442..494bcfb5d 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EMatch.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EMatch.java @@ -17,10 +17,6 @@ import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; import org.simantics.scl.compiler.types.kinds.Kinds; -import gnu.trove.map.hash.TObjectIntHashMap; -import gnu.trove.set.hash.THashSet; -import gnu.trove.set.hash.TIntHashSet; - public class EMatch extends Expression { public Expression[] scrutinee; @@ -41,15 +37,6 @@ public class EMatch extends Expression { this.cases = cases; } - @Override - public void collectVars(TObjectIntHashMap allVars, - TIntHashSet vars) { - for(Expression s : scrutinee) - s.collectVars(allVars, vars); - for(Case case_ : cases) - case_.collectVars(allVars, vars); - } - @Override protected void updateType() { setType(cases[0].value.getType()); @@ -67,19 +54,11 @@ public class EMatch extends Expression { CodeWriter joinPoint = w.createBlock(getType()); CodeWriter failurePoint = w.createBlock(); // TODO generate only one failurePoint per function - PatternMatchingCompiler.split(w, context, scrutineeVals, joinPoint.getContinuation(), failurePoint.getContinuation(), rows); + PatternMatchingCompiler.split(location, w, context, scrutineeVals, joinPoint.getContinuation(), failurePoint.getContinuation(), rows); failurePoint.throw_(location, Throw.MatchingException, "Matching failure at: " + toString()); w.continueAs(joinPoint); return w.getParameters()[0]; } - - @Override - public void collectFreeVariables(THashSet vars) { - for(Expression s : scrutinee) - s.collectFreeVariables(vars); - for(Case case_ : cases) - case_.collectFreeVariables(vars); - } @Override public Expression simplify(SimplificationContext context) { @@ -155,17 +134,6 @@ public class EMatch extends Expression { setType(Types.UNIT); return this; } - - @Override - public void collectEffects(THashSet effects) { - for(Expression s : scrutinee) - s.collectEffects(effects); - for(Case case_ : cases) { - for(Expression pattern : case_.patterns) - pattern.collectEffects(effects); - case_.value.collectEffects(effects); - } - } @Override public void accept(ExpressionVisitor visitor) {