Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/passes/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
15 changes: 11 additions & 4 deletions src/wasm/wasm-type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 << ")";
Expand Down
Loading