mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Witness stores SubstitutionList instead of SubstitutionMap
This simplifies serialization and removes some calls of SubstitutionMap::addSubstitution() and addConformance().
This commit is contained in:
@@ -32,13 +32,14 @@ using namespace swift;
|
||||
|
||||
Witness::Witness(ValueDecl *decl, SubstitutionList substitutions,
|
||||
GenericEnvironment *syntheticEnv,
|
||||
SubstitutionMap reqToSynthesizedEnvMap) {
|
||||
SubstitutionList reqToSynthesizedEnvSubs) {
|
||||
auto &ctx = decl->getASTContext();
|
||||
|
||||
auto declRef = ConcreteDeclRef(ctx, decl, substitutions);
|
||||
auto storedMem = ctx.Allocate(sizeof(StoredWitness), alignof(StoredWitness));
|
||||
auto stored = new (storedMem)
|
||||
StoredWitness{declRef, syntheticEnv, std::move(reqToSynthesizedEnvMap)};
|
||||
StoredWitness{declRef, syntheticEnv,
|
||||
ctx.AllocateCopy(reqToSynthesizedEnvSubs)};
|
||||
ctx.addDestructorCleanup(*stored);
|
||||
|
||||
storage = stored;
|
||||
|
||||
Reference in New Issue
Block a user