diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-08-07 10:38:34 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-07 09:54:51 -0700 |
commit | 9d27d6818f83308c4853e3d8870d5b88a374453f (patch) | |
tree | 50c25e5177efb7a8e910e586398aab3cfd1522c7 /src/passes/Print.cpp | |
parent | 0783d60d9490666ab4b365e738b0132b378c6018 (diff) | |
download | binaryen-9d27d6818f83308c4853e3d8870d5b88a374453f.tar.gz binaryen-9d27d6818f83308c4853e3d8870d5b88a374453f.tar.bz2 binaryen-9d27d6818f83308c4853e3d8870d5b88a374453f.zip |
add drop and tee expressions
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 7486e07f1..ac349abc7 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -240,7 +240,12 @@ struct PrintSExpression : public Visitor<PrintSExpression> { printOpening(o, "get_local ") << printableLocal(curr->index) << ')'; } void visitSetLocal(SetLocal *curr) { - printOpening(o, "set_local ") << printableLocal(curr->index); + if (curr->isTee()) { + printOpening(o, "tee_local "); + } else { + printOpening(o, "set_local "); + } + o << printableLocal(curr->index); incIndent(); printFullLine(curr->value); decIndent(); @@ -282,7 +287,7 @@ struct PrintSExpression : public Visitor<PrintSExpression> { } void visitStore(Store *curr) { o << '('; - prepareColor(o) << printWasmType(curr->type) << ".store"; + prepareColor(o) << printWasmType(curr->valueType) << ".store"; if (curr->bytes < 4 || (curr->type == i64 && curr->bytes < 8)) { if (curr->bytes == 1) { o << '8'; @@ -467,6 +472,13 @@ struct PrintSExpression : public Visitor<PrintSExpression> { printFullLine(curr->condition); decIndent(); } + void visitDrop(Drop *curr) { + o << '('; + prepareColor(o) << "drop"; + incIndent(); + printFullLine(curr->value); + decIndent(); + } void visitReturn(Return *curr) { printOpening(o, "return"); if (!curr->value || curr->value->is<Nop>()) { |