summaryrefslogtreecommitdiff
path: root/src/wasm/literal.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-08-14 11:29:34 -0700
committerGitHub <noreply@github.com>2018-08-14 11:29:34 -0700
commit15b4a4c66fdad9a31bfb3912673378c1c9cf7e1c (patch)
treedea56d226fffa2fb832e6981a930efc3f9a7f0d8 /src/wasm/literal.cpp
parent9f8fa5a14d3b48c650c2574529fd95c329cb5358 (diff)
downloadbinaryen-15b4a4c66fdad9a31bfb3912673378c1c9cf7e1c.tar.gz
binaryen-15b4a4c66fdad9a31bfb3912673378c1c9cf7e1c.tar.bz2
binaryen-15b4a4c66fdad9a31bfb3912673378c1c9cf7e1c.zip
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.
Diffstat (limited to 'src/wasm/literal.cpp')
-rw-r--r--src/wasm/literal.cpp3
1 files changed, 1 insertions, 2 deletions
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 {