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%2Fcontinuations%2FReturnCont.java;h=7fae8e8d8e32e7749a9eff0779f9ea19325d8013;hb=refs%2Fchanges%2F38%2F238%2F2;hp=bd3be958e48764e45d1793714ca6c36298c33994;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/continuations/ReturnCont.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/continuations/ReturnCont.java index bd3be958e..7fae8e8d8 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/continuations/ReturnCont.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/continuations/ReturnCont.java @@ -1,51 +1,51 @@ -package org.simantics.scl.compiler.internal.codegen.continuations; - -import org.simantics.scl.compiler.internal.codegen.ssa.SSAFunction; -import org.simantics.scl.compiler.internal.codegen.utils.CopyContext; -import org.simantics.scl.compiler.types.TVar; -import org.simantics.scl.compiler.types.Type; -import org.simantics.scl.compiler.types.util.Typed; - - -public final class ReturnCont extends Cont implements Typed { - Type returnType; - transient SSAFunction parent; - - public ReturnCont(Type returnType) { - this.returnType = returnType; - } - - public void setParent(SSAFunction parent) { - this.parent = parent; - } - - @Override - public Type getType() { - return returnType; - } - - @Override - public int getArity() { - return 1; - } - - @Override - public Type getParameterType(int parameterId) { - if(parameterId != 0) - throw new IllegalArgumentException(); - return returnType; - } - - public ReturnCont copy(CopyContext context) { - return new ReturnCont(context.copyType(returnType)); - } - - @Override - public void replace(TVar[] vars, Type[] replacements) { - returnType = returnType.replace(vars, replacements); - } - - public void setType(Type type) { - this.returnType = type; - } -} +package org.simantics.scl.compiler.internal.codegen.continuations; + +import org.simantics.scl.compiler.internal.codegen.ssa.SSAFunction; +import org.simantics.scl.compiler.internal.codegen.utils.CopyContext; +import org.simantics.scl.compiler.types.TVar; +import org.simantics.scl.compiler.types.Type; +import org.simantics.scl.compiler.types.util.Typed; + + +public final class ReturnCont extends Cont implements Typed { + Type returnType; + transient SSAFunction parent; + + public ReturnCont(Type returnType) { + this.returnType = returnType; + } + + public void setParent(SSAFunction parent) { + this.parent = parent; + } + + @Override + public Type getType() { + return returnType; + } + + @Override + public int getArity() { + return 1; + } + + @Override + public Type getParameterType(int parameterId) { + if(parameterId != 0) + throw new IllegalArgumentException(); + return returnType; + } + + public ReturnCont copy(CopyContext context) { + return new ReturnCont(context.copyType(returnType)); + } + + @Override + public void replace(TVar[] vars, Type[] replacements) { + returnType = returnType.replace(vars, replacements); + } + + public void setType(Type type) { + this.returnType = type; + } +}