]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/SSAFunction.java
SCL compiler generates line numbers to bytecode
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / internal / codegen / ssa / SSAFunction.java
index 0a608a3d342adf6a9253fd400892475ce6b45131..b2db131a41f50d6f55765d300ebd6d7cf42e30d1 100644 (file)
@@ -279,7 +279,7 @@ public final class SSAFunction extends SSAClosure {
         for(SSABlock block = f.firstBlock; block != null; block = block.next)
             block.parent = this;
         lastBlock.next = f.firstBlock;
-        f.firstBlock.prev = lastBlock;        
+        f.firstBlock.prev = lastBlock;
         lastBlock = f.lastBlock;
         
         firstBlock.firstStatement = firstBlock.lastStatement = null;
@@ -287,7 +287,7 @@ public final class SSAFunction extends SSAClosure {
         effect = f.effect;
         BoundVar[] newParameters = BoundVar.copy(f.firstBlock.parameters);
         firstBlock.setParameters(BoundVar.concat(getParameters(), newParameters));
-        firstBlock.setExit(new Jump(f.firstBlock.createOccurrence(), ValRef.createOccurrences(newParameters)));
+        firstBlock.setExit(new Jump(-1, f.firstBlock.createOccurrence(), ValRef.createOccurrences(newParameters)));
         context.markModified("SSAFunction.simplify-simple-lambda");
     }
 
@@ -409,7 +409,7 @@ public final class SSAFunction extends SSAClosure {
             parameter.parent = firstBlock;
     }
     
-    public void apply(ValRef[] parameters) {
+    public void apply(int lineNumber, ValRef[] parameters) {
         if(parameters.length == 0)
             return;
         if(firstBlock.hasNoOccurences()) {
@@ -421,7 +421,7 @@ public final class SSAFunction extends SSAClosure {
         else {
             BoundVar[] newVars = new BoundVar[getArity()-parameters.length];
             SSABlock block = new SSABlock(newVars);
-            block.setExit(new Jump(firstBlock.createOccurrence(), 
+            block.setExit(new Jump(lineNumber, firstBlock.createOccurrence(), 
                     ValRef.concat(ValRef.copy(parameters), ValRef.createOccurrences(newVars))));
             addBlockInFront(block);
         }