]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/SSABlock.java
SCL compiler generates line numbers to bytecode
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / internal / codegen / ssa / SSABlock.java
index ba9d62d27ce730bffc2b99772321406736125e07..fba16bf8370817329234bc66fee160c09dd1f596 100644 (file)
@@ -443,7 +443,7 @@ public final class SSABlock extends Cont implements Printable, BoundVarBinder {
             for(BranchRef branch : sw.getBranches()) {
                 if(branch.constructor == function) {
                     sw.destroy();
-                    setExit(new Jump(branch.cont.getBinding().createOccurrence(), 
+                    setExit(new Jump(sw.lineNumber, branch.cont.getBinding().createOccurrence(), 
                             ValRef.copy(apply.getParameters())));
                     return true;
                 }
@@ -461,7 +461,7 @@ public final class SSABlock extends Cont implements Printable, BoundVarBinder {
                      *      [a]
                      */
                     sw.destroy();
-                    setExit(new Jump(branch.cont.getBinding().createOccurrence()));
+                    setExit(new Jump(sw.lineNumber, branch.cont.getBinding().createOccurrence()));
                 }
             }
         }
@@ -598,5 +598,12 @@ public final class SSABlock extends Cont implements Printable, BoundVarBinder {
             statement.forValRefs(visitor);
         exit.forValRefs(visitor);
     }
+
+    public void cleanup() {
+        for(SSAStatement statement = firstStatement;
+                statement != null; statement = statement.next)
+            statement.cleanup();
+        exit.cleanup();
+    }
     
 }