]> 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 b0391b96581cbe0df97d498589a862a23fe8b775..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
@@ -93,4 +93,8 @@ public class Throw extends SSAExit {
     @Override
     public void forValRefs(ValRefVisitor visitor) {
     }
+
+    @Override
+    public void cleanup() {
+    }
 }