Express stack updates using return values. (#747)

This enables the interpreter logic to express its intent more directly, especially in the common cases, and enables us to get rid of ValAction. It's also a step toward simplifying and encapsulating `state->stack`.
This commit is contained in:
Geoff Romer
2021-08-19 13:35:47 -07:00
committed by GitHub
parent 0619b4ce6a
commit d71f5b1784
4 changed files with 360 additions and 389 deletions
@@ -35,9 +35,6 @@ void Action::Print(llvm::raw_ostream& out) const {
case Action::Kind::StatementAction:
cast<StatementAction>(*this).Stmt()->PrintDepth(1, out);
break;
case Action::Kind::ValAction:
out << *cast<ValAction>(*this).Val();
break;
}
out << "<" << pos << ">";
if (results.size() > 0) {