]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/CodeGeneration.java
SCL compiler generates line numbers to bytecode
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / compilation / CodeGeneration.java
index 68c5847082d96e7f1db80a1a83f9d4d2d9bcdbb7..082fa2f6dc553d1b36e2b64c6152329f46b87725 100644 (file)
@@ -108,7 +108,7 @@ public class CodeGeneration {
     }
     
     public void convertToSSA() {
-        ModuleWriter mw = new ModuleWriter(compilationContext.namingPolicy.getModuleClassName());
+        ModuleWriter mw = new ModuleWriter(compilationContext.namingPolicy.getModuleClassName(), compilationContext.lineLocator);
         for(SCLValue value : module.getValues()) {
             //System.out.println(value.getName().name + " :: " + value.getType());
             Expression expression = value.getExpression();
@@ -172,7 +172,7 @@ public class CodeGeneration {
                 IVal[] parameterVals = w.getParameters();
                 for(int i=0;i<decomposed.parameters.length;++i)
                     decomposed.parameters[i].setVal(parameterVals[i]);
-                w.return_(decomposed.body.toVal(compilationContext, w));            
+                w.return_(expression.location, decomposed.body.toVal(compilationContext, w));            
             } catch(RuntimeException e) {
                 long location = value.getExpression().location;
                 if(location == Locations.NO_LOCATION)