diff options
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/AbstractTypeRefining.cpp | 6 | ||||
-rw-r--r-- | src/passes/GlobalStructInference.cpp | 4 | ||||
-rw-r--r-- | src/passes/SignaturePruning.cpp | 2 | ||||
-rw-r--r-- | src/passes/SignatureRefining.cpp | 2 | ||||
-rw-r--r-- | src/passes/TypeMerging.cpp | 10 | ||||
-rw-r--r-- | src/passes/TypeRefining.cpp | 4 | ||||
-rw-r--r-- | src/passes/TypeSSA.cpp | 2 | ||||
-rw-r--r-- | src/passes/Unsubtyping.cpp | 4 |
8 files changed, 17 insertions, 17 deletions
diff --git a/src/passes/AbstractTypeRefining.cpp b/src/passes/AbstractTypeRefining.cpp index 8de0301a7..313ad5f4d 100644 --- a/src/passes/AbstractTypeRefining.cpp +++ b/src/passes/AbstractTypeRefining.cpp @@ -269,14 +269,14 @@ struct AbstractTypeRefining : public Pass { AbstractTypeRefiningTypeMapper(Module& wasm, const TypeUpdates& mapping) : TypeMapper(wasm, mapping) {} - std::optional<HeapType> getSuperType(HeapType oldType) override { - auto super = oldType.getSuperType(); + std::optional<HeapType> getDeclaredSuperType(HeapType oldType) override { + auto super = oldType.getDeclaredSuperType(); // Go up the chain of supertypes, skipping things we are mapping away, // as those things will not appear in the output. This skips B in the // example above. while (super && mapping.count(*super)) { - super = super->getSuperType(); + super = super->getDeclaredSuperType(); } return super; } diff --git a/src/passes/GlobalStructInference.cpp b/src/passes/GlobalStructInference.cpp index ceee8b02d..9fc906971 100644 --- a/src/passes/GlobalStructInference.cpp +++ b/src/passes/GlobalStructInference.cpp @@ -170,7 +170,7 @@ struct GlobalStructInference : public Pass { // empty, below. typeGlobals.erase(type); - auto super = type.getSuperType(); + auto super = type.getDeclaredSuperType(); if (!super) { break; } @@ -184,7 +184,7 @@ struct GlobalStructInference : public Pass { for (auto& [type, globals] : typeGlobalsCopy) { auto curr = type; while (1) { - auto super = curr.getSuperType(); + auto super = curr.getDeclaredSuperType(); if (!super) { break; } diff --git a/src/passes/SignaturePruning.cpp b/src/passes/SignaturePruning.cpp index e25f9555f..23295a66a 100644 --- a/src/passes/SignaturePruning.cpp +++ b/src/passes/SignaturePruning.cpp @@ -184,7 +184,7 @@ struct SignaturePruning : public Pass { if (!subTypes.getImmediateSubTypes(type).empty()) { continue; } - if (auto super = type.getSuperType()) { + if (auto super = type.getDeclaredSuperType()) { if (super->isSignature()) { continue; } diff --git a/src/passes/SignatureRefining.cpp b/src/passes/SignatureRefining.cpp index 6d2c243c2..24d120dda 100644 --- a/src/passes/SignatureRefining.cpp +++ b/src/passes/SignatureRefining.cpp @@ -148,7 +148,7 @@ struct SignatureRefining : public Pass { for (auto& [type, info] : allInfo) { if (!subTypes.getImmediateSubTypes(type).empty()) { info.canModify = false; - } else if (type.getSuperType()) { + } else if (type.getDeclaredSuperType()) { // Also avoid modifying types with supertypes, as we do not handle // contravariance here. That is, when we refine parameters we look for // a more refined type, but the type must be *less* refined than the diff --git a/src/passes/TypeMerging.cpp b/src/passes/TypeMerging.cpp index 7bd4ad7fe..f827e097c 100644 --- a/src/passes/TypeMerging.cpp +++ b/src/passes/TypeMerging.cpp @@ -169,8 +169,8 @@ struct MergeableSupertypesFirst MergeableSupertypesFirst(TypeMerging& merging) : merging(merging) {} - std::optional<HeapType> getSuperType(HeapType type) { - if (auto super = type.getSuperType()) { + std::optional<HeapType> getDeclaredSuperType(HeapType type) { + if (auto super = type.getDeclaredSuperType()) { return merging.getMerged(*super); } return std::nullopt; @@ -291,7 +291,7 @@ bool TypeMerging::merge(MergeKind kind) { // Similar to the above, but look up or create a partition associated with the // type's supertype and top-level shape rather than its identity. auto ensureShapePartition = [&](HeapType type) -> Partitions::iterator { - auto super = type.getSuperType(); + auto super = type.getDeclaredSuperType(); if (super) { super = getMerged(*super); } @@ -321,7 +321,7 @@ bool TypeMerging::merge(MergeKind kind) { switch (kind) { case Supertypes: { - auto super = type.getSuperType(); + auto super = type.getDeclaredSuperType(); if (super && shapeEq(type, *super)) { // The current type and its supertype have the same top-level // structure and are not distinguished, so add the current type to its @@ -454,7 +454,7 @@ TypeMerging::splitSupertypePartition(const std::vector<HeapType>& types) { std::unordered_map<HeapType, Index> partitionIndices; MergeableSupertypesFirst sortedTypes(*this); for (auto type : sortedTypes.sort(types)) { - auto super = type.getSuperType(); + auto super = type.getDeclaredSuperType(); if (super && includedTypes.count(*super)) { // We must already have a partition for the supertype we can add to. auto index = partitionIndices.at(*super); diff --git a/src/passes/TypeRefining.cpp b/src/passes/TypeRefining.cpp index 211df8186..c7a1fce6e 100644 --- a/src/passes/TypeRefining.cpp +++ b/src/passes/TypeRefining.cpp @@ -148,7 +148,7 @@ struct TypeRefining : public Pass { auto& subTypes = propagator.subTypes; UniqueDeferredQueue<HeapType> work; for (auto type : subTypes.types) { - if (type.isStruct() && !type.getSuperType()) { + if (type.isStruct() && !type.getDeclaredSuperType()) { work.push(type); } } @@ -170,7 +170,7 @@ struct TypeRefining : public Pass { } // Next ensure proper subtyping of this struct's fields versus its super. - if (auto super = type.getSuperType()) { + if (auto super = type.getDeclaredSuperType()) { auto& superFields = super->getStruct().fields; for (Index i = 0; i < superFields.size(); i++) { auto newSuperType = finalInfos[*super][i].getLUB(); diff --git a/src/passes/TypeSSA.cpp b/src/passes/TypeSSA.cpp index 6c50cb2a9..3736f3ccf 100644 --- a/src/passes/TypeSSA.cpp +++ b/src/passes/TypeSSA.cpp @@ -107,7 +107,7 @@ std::vector<HeapType> ensureTypesAreInNewRecGroup(RecGroup recGroup, assert(type.isArray()); builder[i] = type.getArray(); } - if (auto super = type.getSuperType()) { + if (auto super = type.getDeclaredSuperType()) { builder[i].subTypeOf(*super); } builder[i].setOpen(type.isOpen()); diff --git a/src/passes/Unsubtyping.cpp b/src/passes/Unsubtyping.cpp index 3e88a7f91..87da111f0 100644 --- a/src/passes/Unsubtyping.cpp +++ b/src/passes/Unsubtyping.cpp @@ -201,7 +201,7 @@ struct Unsubtyping void analyzePublicTypes(Module& wasm) { // We cannot change supertypes for anything public. for (auto type : ModuleUtils::getPublicHeapTypes(wasm)) { - if (auto super = type.getSuperType()) { + if (auto super = type.getDeclaredSuperType()) { noteSubtype(type, *super); } } @@ -276,7 +276,7 @@ struct Unsubtyping Unsubtyping& parent; Rewriter(Unsubtyping& parent, Module& wasm) : GlobalTypeRewriter(wasm), parent(parent) {} - std::optional<HeapType> getSuperType(HeapType type) override { + std::optional<HeapType> getDeclaredSuperType(HeapType type) override { if (auto it = parent.supertypes.find(type); it != parent.supertypes.end() && !it->second.isBasic()) { return it->second; |