From 15b4a4c66fdad9a31bfb3912673378c1c9cf7e1c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 14 Aug 2018 11:29:34 -0700 Subject: Print Stack IR in proper .wat format (#1630) This now makes --generate-stack-ir --print-stack-ir emit a fully valid .wat wasm file, in stacky format. --- src/wasm/literal.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/wasm/literal.cpp') diff --git a/src/wasm/literal.cpp b/src/wasm/literal.cpp index e68dd5d5f..032b3f7f8 100644 --- a/src/wasm/literal.cpp +++ b/src/wasm/literal.cpp @@ -168,7 +168,6 @@ void Literal::printDouble(std::ostream& o, double d) { } std::ostream& operator<<(std::ostream& o, Literal literal) { - o << '('; prepareMinorColor(o) << printType(literal.type) << ".const "; switch (literal.type) { case none: o << "?"; break; @@ -179,7 +178,7 @@ std::ostream& operator<<(std::ostream& o, Literal literal) { default: WASM_UNREACHABLE(); } restoreNormalColor(o); - return o << ')'; + return o; } Literal Literal::countLeadingZeroes() const { -- cgit v1.2.3