diff options
-rw-r--r-- | src/passes/Print.cpp | 22 | ||||
-rw-r--r-- | test/wasm2asm/i64-rotate.2asm.js | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index f894c0d36..fc07b23b9 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -157,6 +157,13 @@ struct PrintSExpression : public Visitor<PrintSExpression> { if (curr != top && i == 0) { // one of the block recursions we already handled decIndent(); + if (full) { + o << " ;; end block"; + auto* child = list[0]->cast<Block>(); + if (child->name.is()) { + o << ' ' << child->name; + } + } o << '\n'; continue; } @@ -164,6 +171,12 @@ struct PrintSExpression : public Visitor<PrintSExpression> { } } decIndent(); + if (full) { + o << " ;; end block"; + if (curr->name.is()) { + o << ' ' << curr->name; + } + } } void visitIf(If *curr) { printOpening(o, "if"); @@ -186,6 +199,9 @@ struct PrintSExpression : public Visitor<PrintSExpression> { } } decIndent(); + if (full) { + o << " ;; end if"; + } } void visitLoop(Loop *curr) { printOpening(o, "loop"); @@ -207,6 +223,12 @@ struct PrintSExpression : public Visitor<PrintSExpression> { printFullLine(curr->body); } decIndent(); + if (full) { + o << " ;; end loop"; + if (curr->name.is()) { + o << ' ' << curr->name; + } + } } void visitBreak(Break *curr) { if (curr->condition) { diff --git a/test/wasm2asm/i64-rotate.2asm.js b/test/wasm2asm/i64-rotate.2asm.js index c76c41e39..2d30f3f40 100644 --- a/test/wasm2asm/i64-rotate.2asm.js +++ b/test/wasm2asm/i64-rotate.2asm.js @@ -14,6 +14,9 @@ function asmFunc(global, env, buffer) { var Math_clz32 = global.Math.clz32; var Math_min = global.Math.min; var Math_max = global.Math.max; + var Math_floor = global.Math.floor; + var Math_ceil = global.Math.ceil; + var Math_sqrt = global.Math.sqrt; var i64toi32_i32$HIGH_BITS = 0; function dummy() { |