AST: Simplify SubstitutionMap representation

There was a bunch of logic to lazily populate replacement types
corresponding to reducible generic parameters. This didn't seem
to have a clear purpose so let's remove it.
This commit is contained in:
Slava Pestov
2024-07-07 14:25:15 -04:00
parent 977b444eb3
commit 26fffae30a
8 changed files with 38 additions and 141 deletions

View File

@@ -5296,21 +5296,11 @@ void SubstitutionMap::Storage::Profile(
id.AddPointer(genericSig.getPointer());
if (!genericSig) return;
// Profile those replacement types that corresponding to canonical generic
// parameters within the generic signature.
id.AddInteger(replacementTypes.size());
unsigned i = 0;
genericSig->forEachParam([&](GenericTypeParamType *gp, bool canonical) {
if (canonical)
id.AddPointer(replacementTypes[i].getPointer());
else
id.AddPointer(nullptr);
++i;
});
// Replacement types.
for (auto replacementType : replacementTypes)
id.AddPointer(replacementType.getPointer());
// Conformances.
id.AddInteger(conformances.size());
for (auto conformance : conformances)
id.AddPointer(conformance.getOpaqueValue());
}