X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Finternal%2Fcodegen%2Fssa%2Fexits%2FSwitch.java;h=55f38f809b540acbea4e3cf7baa47877e5965e1d;hb=refs%2Fchanges%2F34%2F1534%2F3;hp=27f853e0283b3d714757f4d3369cab4379cf470d;hpb=51a4b7a930406a4890258f598661edc4b44e181a;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/exits/Switch.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/exits/Switch.java index 27f853e02..55f38f809 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/exits/Switch.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/exits/Switch.java @@ -1,6 +1,7 @@ package org.simantics.scl.compiler.internal.codegen.ssa.exits; import java.util.ArrayList; +import java.util.Arrays; import org.objectweb.asm.Label; import org.simantics.scl.compiler.common.exceptions.InternalCompilerError; @@ -26,12 +27,15 @@ import org.simantics.scl.compiler.types.TVar; import org.simantics.scl.compiler.types.Type; import org.simantics.scl.compiler.types.Types; +import gnu.trove.map.hash.TIntObjectHashMap; + public class Switch extends SSAExit implements ValRefBinder { ValRef scrutinee; BranchRef[] branches; - public Switch(ValRef scrutinee, BranchRef[] branches) { + public Switch(int lineNumber, ValRef scrutinee, BranchRef[] branches) { + super(lineNumber); this.scrutinee = scrutinee; this.branches = branches; scrutinee.setParent(this); @@ -60,14 +64,19 @@ public class Switch extends SSAExit implements ValRefBinder { int defaultId; for(defaultId=0;defaultId labelMap = new TIntObjectHashMap