diff options
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 6198218d8..6a41961a2 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -1985,15 +1985,18 @@ struct PrintExpressionContents } void visitStructNew(StructNew* curr) { - if (printUnreachableReplacement(curr->rtt)) { + if (printUnreachableReplacement(curr)) { return; } - printMedium(o, "struct.new_"); + printMedium(o, "struct.new"); if (curr->isWithDefault()) { - o << "default_"; + printMedium(o, "_default"); } - o << "with_rtt "; - TypeNamePrinter(o, wasm).print(curr->rtt->type.getHeapType()); + if (curr->rtt) { + printMedium(o, "_with_rtt"); + } + o << ' '; + TypeNamePrinter(o, wasm).print(curr->type.getHeapType()); } void printFieldName(HeapType type, Index index) { @@ -2035,16 +2038,29 @@ struct PrintExpressionContents printFieldName(heapType, curr->index); } void visitArrayNew(ArrayNew* curr) { - printMedium(o, "array.new_"); + if (printUnreachableReplacement(curr)) { + return; + } + printMedium(o, "array.new"); if (curr->isWithDefault()) { - o << "default_"; + printMedium(o, "_default"); + } + if (curr->rtt) { + printMedium(o, "_with_rtt"); } - o << "with_rtt "; - TypeNamePrinter(o, wasm).print(curr->rtt->type.getHeapType()); + o << ' '; + TypeNamePrinter(o, wasm).print(curr->type.getHeapType()); } void visitArrayInit(ArrayInit* curr) { - printMedium(o, "array.init "); - TypeNamePrinter(o, wasm).print(curr->rtt->type.getHeapType()); + if (printUnreachableReplacement(curr)) { + return; + } + printMedium(o, "array.init"); + if (!curr->rtt) { + printMedium(o, "_static"); + } + o << ' '; + TypeNamePrinter(o, wasm).print(curr->type.getHeapType()); } void visitArrayGet(ArrayGet* curr) { if (printUnreachableReplacement(curr->ref)) { |