diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ir/type-updating.cpp | 9 | ||||
-rw-r--r-- | src/passes/SignatureRefining.cpp | 5 | ||||
-rw-r--r-- | src/passes/TypeRefining.cpp | 5 |
3 files changed, 15 insertions, 4 deletions
diff --git a/src/ir/type-updating.cpp b/src/ir/type-updating.cpp index b9bbf7a03..b08cca295 100644 --- a/src/ir/type-updating.cpp +++ b/src/ir/type-updating.cpp @@ -32,6 +32,15 @@ void GlobalTypeRewriter::update() { } typeBuilder.grow(indexedTypes.types.size()); + // All the input types are distinct, so we need to make sure the output types + // are distinct as well. Further, the new types may have more recursions than + // the original types, so the old recursion groups may not be sufficient any + // more. Both of these problems are solved by putting all the new types into a + // single large recursion group. + // TODO: When we properly analyze which types are external and which are + // internal to the module, only optimize internal types. + typeBuilder.createRecGroup(0, typeBuilder.size()); + // Create the temporary heap types. for (Index i = 0; i < indexedTypes.types.size(); i++) { auto type = indexedTypes.types[i]; diff --git a/src/passes/SignatureRefining.cpp b/src/passes/SignatureRefining.cpp index 8a8c45872..11df83f4d 100644 --- a/src/passes/SignatureRefining.cpp +++ b/src/passes/SignatureRefining.cpp @@ -51,8 +51,9 @@ struct SignatureRefining : public Pass { if (!module->features.hasGC()) { return; } - if (getTypeSystem() != TypeSystem::Nominal) { - Fatal() << "SignatureRefining requires nominal typing"; + if (getTypeSystem() != TypeSystem::Nominal && + getTypeSystem() != TypeSystem::Isorecursive) { + Fatal() << "SignatureRefining requires nominal/hybrid typing"; } if (!module->tables.empty()) { diff --git a/src/passes/TypeRefining.cpp b/src/passes/TypeRefining.cpp index c755c1af6..258feae32 100644 --- a/src/passes/TypeRefining.cpp +++ b/src/passes/TypeRefining.cpp @@ -81,8 +81,9 @@ struct TypeRefining : public Pass { if (!module->features.hasGC()) { return; } - if (getTypeSystem() != TypeSystem::Nominal) { - Fatal() << "TypeRefining requires nominal typing"; + if (getTypeSystem() != TypeSystem::Nominal && + getTypeSystem() != TypeSystem::Isorecursive) { + Fatal() << "TypeRefining requires nominal/hybrid typing"; } // Find and analyze struct operations inside each function. |