diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 75c5452f238..52ccd8330be 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -3518,6 +3518,12 @@ void PrintSExpression::visitModule(Module* curr) { incIndent(); } } + if (auto it = curr->typeNames.find(type); it != curr->typeNames.end()) { + auto name = it->second.name.str; + if (name.find(".vtable") == name.size() - 7) { + continue; + } + } doIndent(o, indent); o << typePrinter(type) << maybeNewLine; } diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp index b54116258e8..042a4ea52f3 100644 --- a/src/wasm/wasm-type.cpp +++ b/src/wasm/wasm-type.cpp @@ -1919,17 +1919,24 @@ TypePrinter::print(HeapType type, const auto& struct_ = type.getStruct(); os << "(struct"; if (auto desc = type.getDescriptorType()) { - os << " (field $vtable "; - print(Type(*desc, NonNullable)); + os << " (field $vtable"; + // print(Type(*desc, NonNullable)); os << ')'; } for (Index i = 0; i < struct_.fields.size(); ++i) { // TODO: move this to the function for printing fields. os << " (field "; + bool isVTable = false; if (auto it = fieldNames.find(i); it != fieldNames.end()) { - it->second.print(os) << ' '; + if (it->second == Name("vtable")) { + isVTable = true; + } + it->second.print(os); + } + if (!isVTable) { + os << ' '; + print(struct_.fields[i]); } - print(struct_.fields[i]); os << ')'; } return os << ")";