]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/exits/Throw.java
SCL compiler generates line numbers to bytecode
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / internal / codegen / ssa / exits / Throw.java
index 593b81c63f2914c40355e47b7932336f3e0ced29..0193c99c2368fd8a690607438646f76e4bdad1ce 100644 (file)
@@ -30,7 +30,8 @@ public class Throw extends SSAExit {
     TypeDesc exceptionClass;
     String description;
     
-    public Throw(TypeDesc exceptionClass, String description) {
+    public Throw(int lineNumber, TypeDesc exceptionClass, String description) {
+        super(lineNumber);
         this.exceptionClass = exceptionClass;
         this.description = description;
     }
@@ -43,8 +44,7 @@ public class Throw extends SSAExit {
 
     @Override
     public void generateCode(MethodBuilder mb) {
-        //mb.push(exception.getBinding());
-        //cb.mapLineNumber(location);
+        mb.lineNumber(lineNumber);
         mb.newObject(exceptionClass);
         mb.dup();
         if(description == null)
@@ -67,7 +67,7 @@ public class Throw extends SSAExit {
 
     @Override
     public SSAExit copy(CopyContext context) {
-        return new Throw(exceptionClass, description);
+        return new Throw(lineNumber, exceptionClass, description);
     }
     
     @Override