X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Finternal%2Fcodegen%2Fssa%2Fstatements%2FLetApply.java;h=210e3ded3243fc20755dd4553dd19bd309f0d0ba;hb=1a70d6085093907f2120e5319554420b1ada614a;hp=b8b7def598175705f4beb2cb1f3b768688afe873;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java index b8b7def59..210e3ded3 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java @@ -77,7 +77,7 @@ public class LetApply extends LetStatement implements ValRefBinder { @Override public void toString(PrintingContext context) { - if(determineGenerateOnFly()) + if(/*target.getLabel() == null &&*/ determineGenerateOnFly()) context.addInlineExpression(target, this); else toStringAux(context); @@ -356,6 +356,8 @@ public class LetApply extends LetStatement implements ValRefBinder { SSABlock headBlock = getParent(); SSAFunction thisFunction = headBlock.getParent(); + if(thisFunction == function) + return; /*System.out.println("--- INLINING -------------------------------"); System.out.println(thisFunction); @@ -399,7 +401,7 @@ public class LetApply extends LetStatement implements ValRefBinder { tailBlock.setExit(headBlock.getExit()); // Merge blocks - thisFunction.mergeBlocks(function); + thisFunction.mergeBlocks(function); headBlock.setExit(new Jump(function.getFirstBlock().createOccurrence(), parameters)); @@ -488,4 +490,11 @@ public class LetApply extends LetStatement implements ValRefBinder { for(ValRef parameter : parameters) visitor.visit(parameter); } + + @Override + public void cleanup() { + function.remove(); + for(ValRef parameter : parameters) + parameter.remove(); + } }