From a64037480b83373953292469c1fa1f80ec80e13c Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Thu, 5 Sep 2024 13:42:05 -0700 Subject: Fix supertype counts when collecting heap types (#6905) We previous incremented the use count for a declared supertype only if it was also a type we had never seen before. Fix the count by treating the supertype the same as any other type used in a type definition. Update tests accordingly, including by manually moving input types around to better match the output. --- src/ir/module-utils.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src') diff --git a/src/ir/module-utils.cpp b/src/ir/module-utils.cpp index e0bd9592a..3c81d6679 100644 --- a/src/ir/module-utils.cpp +++ b/src/ir/module-utils.cpp @@ -506,9 +506,7 @@ InsertOrderedMap collectHeapTypeInfo( while (!newTypes.empty()) { while (!newTypes.empty()) { auto ht = newTypes.pop(); - // TODO: Use getReferencedHeapTypes instead and remove separate - // consideration of supertypes below. - for (HeapType child : ht.getHeapTypeChildren()) { + for (HeapType child : ht.getReferencedHeapTypes()) { if (!child.isBasic()) { if (!info.contains(child)) { noteNewType(child); @@ -517,15 +515,6 @@ InsertOrderedMap collectHeapTypeInfo( } } - if (auto super = ht.getDeclaredSuperType()) { - if (!info.contains(*super)) { - noteNewType(*super); - // TODO: This should be unconditional for the count to be correct, but - // this will be moot once we use getReferencedHeapTypes above. - info.note(*super); - } - } - // Make sure we've noted the complete recursion group of each type as // well. if (inclusion != TypeInclusion::UsedIRTypes) { -- cgit v1.2.3