diff options
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 15ab97098..916615e07 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -1430,16 +1430,8 @@ struct PrintExpressionContents } void visitDrop(Drop* curr) { printMedium(o, "drop"); } void visitReturn(Return* curr) { printMedium(o, "return"); } - void visitHost(Host* curr) { - switch (curr->op) { - case MemorySize: - printMedium(o, "memory.size"); - break; - case MemoryGrow: - printMedium(o, "memory.grow"); - break; - } - } + void visitMemorySize(MemorySize* curr) { printMedium(o, "memory.size"); } + void visitMemoryGrow(MemoryGrow* curr) { printMedium(o, "memory.grow"); } void visitRefNull(RefNull* curr) { printMedium(o, "ref.null "); o << curr->type.getHeapType(); @@ -1577,7 +1569,9 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { o << ')'; } void printFullLine(Expression* expression) { - !minify && doIndent(o, indent); + if (!minify) { + doIndent(o, indent); + } if (full) { o << "[" << expression->type << "] "; } @@ -1945,20 +1939,17 @@ struct PrintSExpression : public OverriddenVisitor<PrintSExpression> { printFullLine(curr->value); decIndent(); } - void visitHost(Host* curr) { + void visitMemorySize(MemorySize* curr) { o << '('; PrintExpressionContents(currFunction, o).visit(curr); - switch (curr->op) { - case MemoryGrow: { - incIndent(); - printFullLine(curr->operands[0]); - decIndent(); - break; - } - case MemorySize: { - o << ')'; - } - } + o << ')'; + } + void visitMemoryGrow(MemoryGrow* curr) { + o << '('; + PrintExpressionContents(currFunction, o).visit(curr); + incIndent(); + printFullLine(curr->delta); + decIndent(); } void visitRefNull(RefNull* curr) { o << '('; |