@@ -129,15 +129,6 @@ template<typename K, typename V> using Map = std::unordered_map<K, V>;
129129template <typename T> using Set = std::unordered_set<T>;
130130#endif
131131
132- #if UNSUBTYPING_DEBUG
133- Name getTypeName (Module& wasm, HeapType type) {
134- if (auto it = wasm.typeNames .find (type); it != wasm.typeNames .end ()) {
135- return it->second .name ;
136- }
137- return Name (" (unnamed)" );
138- }
139- #endif
140-
141132// A tree (or rather a forest) of types with the ability to query and set
142133// supertypes in constant time and efficiently iterate over supertypes and
143134// subtypes.
@@ -291,13 +282,13 @@ struct TypeTree {
291282#if UNSUBTYPING_DEBUG
292283 void dump (Module& wasm) {
293284 for (auto & node : nodes) {
294- std::cerr << getTypeName (wasm, node.type );
285+ std::cerr << ModuleHeapType (wasm, node.type );
295286 if (auto super = getSupertype (node.type )) {
296- std::cerr << " <: " << getTypeName (wasm, *super);
287+ std::cerr << " <: " << ModuleHeapType (wasm, *super);
297288 }
298289 std::cerr << " , children:" ;
299290 for (auto child : node.children ) {
300- std::cerr << " " << getTypeName (wasm, nodes[child].type );
291+ std::cerr << " " << ModuleHeapType (wasm, nodes[child].type );
301292 }
302293 std::cerr << ' \n ' ;
303294 }
@@ -360,8 +351,8 @@ struct Unsubtyping : Pass {
360351 if (sub == super || sub.isBottom ()) {
361352 return ;
362353 }
363- DBG (std::cerr << " noting " << getTypeName (*wasm, sub)
364- << " <: " << getTypeName (*wasm, super) << ' \n ' );
354+ DBG (std::cerr << " noting " << ModuleHeapType (*wasm, sub)
355+ << " <: " << ModuleHeapType (*wasm, super) << ' \n ' );
365356 work.push_back ({sub, super});
366357 }
367358
@@ -520,8 +511,8 @@ struct Unsubtyping : Pass {
520511 }
521512
522513 void process (HeapType sub, HeapType super) {
523- DBG (std::cerr << " processing " << getTypeName (*wasm, sub)
524- << " <: " << getTypeName (*wasm, super) << ' \n ' );
514+ DBG (std::cerr << " processing " << ModuleHeapType (*wasm, sub)
515+ << " <: " << ModuleHeapType (*wasm, super) << ' \n ' );
525516 assert (HeapType::isSubType (sub, super));
526517 auto oldSuper = types.getSupertype (sub);
527518 if (oldSuper) {
0 commit comments