-package org.simantics.scl.compiler.internal.codegen.continuations;\r
-\r
-import org.simantics.scl.compiler.internal.codegen.references.Val;\r
-import org.simantics.scl.compiler.internal.codegen.references.ValRef;\r
-import org.simantics.scl.compiler.internal.codegen.ssa.SSAExit;\r
-\r
-\r
-public final class ContRef {\r
- public static final ValRef[] EMPTY_ARRAY = new ValRef[0];\r
-\r
- Cont binding;\r
- ContRef prev; // FreeVars with the same binding form a linked list\r
- ContRef next; \r
- SSAExit parent;\r
- \r
- ContRef(Cont binding) {\r
- this.binding = binding;\r
- \r
- ContRef head = binding.occurrence;\r
- binding.occurrence = this;\r
- this.next = head;\r
- if(head != null)\r
- head.prev = this;\r
- } \r
- \r
- public void remove() {\r
- if(prev == null)\r
- binding.occurrence = next;\r
- else\r
- prev.next = next;\r
- if(next != null)\r
- next.prev = prev;\r
- }\r
-\r
- public Cont getBinding() {\r
- return binding;\r
- }\r
- \r
- public ContRef getNext() {\r
- return next;\r
- }\r
-\r
- public void setParent(SSAExit parent) {\r
- this.parent = parent;\r
- }\r
-\r
- public Cont addParametersInFront(Val[] newParameters, Val[] oldParameters, Cont proxy) {\r
- return parent.addParametersInFrontOf(this, newParameters, oldParameters, proxy);\r
- }\r
- \r
- public SSAExit getParent() {\r
- return parent;\r
- }\r
-}\r
+package org.simantics.scl.compiler.internal.codegen.continuations;
+
+import org.simantics.scl.compiler.internal.codegen.references.Val;
+import org.simantics.scl.compiler.internal.codegen.references.ValRef;
+import org.simantics.scl.compiler.internal.codegen.ssa.SSAExit;
+
+
+public final class ContRef {
+ public static final ValRef[] EMPTY_ARRAY = new ValRef[0];
+
+ Cont binding;
+ ContRef prev; // FreeVars with the same binding form a linked list
+ ContRef next;
+ SSAExit parent;
+
+ ContRef(Cont binding) {
+ this.binding = binding;
+
+ ContRef head = binding.occurrence;
+ binding.occurrence = this;
+ this.next = head;
+ if(head != null)
+ head.prev = this;
+ }
+
+ public void remove() {
+ if(prev == null)
+ binding.occurrence = next;
+ else
+ prev.next = next;
+ if(next != null)
+ next.prev = prev;
+ }
+
+ public Cont getBinding() {
+ return binding;
+ }
+
+ public ContRef getNext() {
+ return next;
+ }
+
+ public void setParent(SSAExit parent) {
+ this.parent = parent;
+ }
+
+ public Cont addParametersInFront(Val[] newParameters, Val[] oldParameters, Cont proxy) {
+ return parent.addParametersInFrontOf(this, newParameters, oldParameters, proxy);
+ }
+
+ public SSAExit getParent() {
+ return parent;
+ }
+}