Skip to content

Commit 5afe207

Browse files
committed
remove ReturnTo(DirectCall) continuation
1 parent 78bdbcb commit 5afe207

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

src/main/scala/ir/eval/InterpretBasilIR.scala

-22
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ object InterpFuns {
311311
r: Next[InterpretReturn] <- (next match {
312312
case Intrinsic(tgt) => LibcIntrinsic.intrinsics(tgt)(f).map(_ => Next.Continue)
313313
case Run(c: Statement) => interpretStatement(f)(c).map(_ => Next.Continue)
314-
case ReturnTo(c) => interpretReturn(f)(c).map(v => Next.Stop(InterpretReturn.ReturnVal(v)))
315314
case ReturnFrom(c) => evaluateReturn(f)(c).map(v => Next.Stop(InterpretReturn.ReturnVal(v)))
316315
case Run(c: Jump) => interpretJump(f)(c).map(_ => Next.Continue)
317316
case Stopped() => State.pure(Next.Stop(InterpretReturn.Void))
@@ -367,27 +366,6 @@ object InterpFuns {
367366
}
368367
}
369368

370-
/**
371-
* Evaluates the formal out params and assigns them to the corresponding lhs variables of the direct call.
372-
*/
373-
def interpretReturn[S, T <: Effects[S, InterpreterError]](
374-
f: T
375-
)(s: DirectCall): State[S, Map[LocalVar, Literal], InterpreterError] = {
376-
case class Param(val lhs: Variable, formal: LocalVar, value: Literal)
377-
for {
378-
outs <- State.mapM(
379-
((bindout: (LocalVar, Variable)) => {
380-
for {
381-
rhs <- Eval.evalLiteral(f)(bindout._1)
382-
} yield (Param(bindout._2, bindout._1, rhs))
383-
}),
384-
s.outParams
385-
)
386-
_ <- State.sequence(State.pure(()), outs.map(m => f.storeVar(m.lhs.name, m.lhs.toBoogie.scope, Scalar(m.value))))
387-
_ <- f.setNext(Run(s.successor))
388-
} yield (outs.map(p => (p.formal, p.value)).toMap)
389-
}
390-
391369
/**
392370
* Evaluates the formal out params and returns a map totheir values.
393371
*/

src/main/scala/ir/eval/Interpreter.scala

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ sealed trait ExecutionContinuation
3434
case class Stopped() extends ExecutionContinuation /* normal program stop */
3535
case class ErrorStop(error: InterpreterError) extends ExecutionContinuation /* program stop in error state */
3636
case class Run(next: Command) extends ExecutionContinuation /* continue by executing next command */
37-
case class ReturnTo(call: DirectCall) extends ExecutionContinuation /* return from a call and continue at caller */
3837
case class ReturnFrom(target: ProcSig) extends ExecutionContinuation /* return from a call without continuing */
3938
case class Intrinsic(name: String) extends ExecutionContinuation /* a named intrinsic instruction */
4039

0 commit comments

Comments
 (0)