From 2a138faec4b21ee2eae89f00d1e00987bab6305a Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Wed, 3 Jul 2019 15:56:04 -0700 Subject: Initial tail call implementation (#2197) Including parsing, printing, assembling, disassembling. TODO: - interpreting - effects - finalization and typing - fuzzing - JS/C API --- src/passes/Print.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/passes/Print.cpp') diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index e1ed788c4..bae5b25d4 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -106,11 +106,20 @@ struct PrintExpressionContents o << ' ' << curr->default_; } void visitCall(Call* curr) { - printMedium(o, "call "); + if (curr->isReturn) { + printMedium(o, "return_call "); + } else { + printMedium(o, "call "); + } printName(curr->target, o); } void visitCallIndirect(CallIndirect* curr) { - printMedium(o, "call_indirect (type ") << curr->fullType << ')'; + if (curr->isReturn) { + printMedium(o, "return_call_indirect (type "); + } else { + printMedium(o, "call_indirect (type "); + } + o << curr->fullType << ')'; } void visitLocalGet(LocalGet* curr) { printMedium(o, "local.get ") << printableLocal(curr->index, currFunction); -- cgit v1.2.3