]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/expressions/EIf.java
(refs #7278, refs #7279) Small fixes to InternalCompilerExceptions
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / expressions / EIf.java
index e3bb2fe0a313d86e24c3b82d1a32d04eb0e47a65..661de4261e260c09b1cd543f3ac5e2dc97df7339 100644 (file)
@@ -1,10 +1,10 @@
 package org.simantics.scl.compiler.elaboration.expressions;
 
+import org.simantics.scl.compiler.compilation.CompilationContext;
 import org.simantics.scl.compiler.elaboration.contexts.ReplaceContext;
 import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext;
 import org.simantics.scl.compiler.elaboration.contexts.TranslationContext;
 import org.simantics.scl.compiler.elaboration.contexts.TypingContext;
-import org.simantics.scl.compiler.environment.Environment;
 import org.simantics.scl.compiler.errors.Locations;
 import org.simantics.scl.compiler.internal.codegen.references.IVal;
 import org.simantics.scl.compiler.internal.codegen.writer.CodeWriter;
@@ -62,21 +62,21 @@ public class EIf extends Expression {
        }
        
        @Override
-       public IVal toVal(Environment env, CodeWriter w) {
-        IVal conditionVal = condition.toVal(env, w); 
+       public IVal toVal(CompilationContext context, CodeWriter w) {
+        IVal conditionVal = condition.toVal(context, w); 
         CodeWriter joinPoint = w.createBlock(getType());
         CodeWriter thenBlock = w.createBlock();
         if(else_ != null) {
             CodeWriter elseBlock = w.createBlock();        
             w.if_(conditionVal, thenBlock.getContinuation(), elseBlock.getContinuation());
                 
-            IVal elseVal = else_.toVal(env, elseBlock);
+            IVal elseVal = else_.toVal(context, elseBlock);
             elseBlock.jump(joinPoint.getContinuation(), elseVal);
         }
         else {
             w.if_(conditionVal, thenBlock.getContinuation(), joinPoint.getContinuation());
         }
-        IVal thenVal = then_.toVal(env, thenBlock);
+        IVal thenVal = then_.toVal(context, thenBlock);
         thenBlock.jump(joinPoint.getContinuation(), thenVal);
         w.continueAs(joinPoint);