Skip to content

Commit 586a36a

Browse files
committed
SIL: Remove call to old form of getOpenedExistentialSignature()
1 parent 07e8e07 commit 586a36a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/SILOptimizer/Utils/Existential.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "swift/SILOptimizer/Utils/Existential.h"
1414
#include "swift/AST/ConformanceLookup.h"
15+
#include "swift/AST/LocalArchetypeRequirementCollector.h"
1516
#include "swift/AST/ProtocolConformance.h"
1617
#include "swift/Basic/Assertions.h"
1718
#include "swift/SIL/BasicBlockUtils.h"
@@ -250,15 +251,20 @@ void ConcreteExistentialInfo::initializeSubstitutionMap(
250251
// Construct a single-generic-parameter substitution map directly to the
251252
// ConcreteType with this existential's full list of conformances.
252253
//
253-
// NOTE: getOpenedExistentialSignature() generates the signature for passing an
254+
// NOTE: LocalArchetypeRequirementCollector generates the signature for passing an
254255
// opened existential as a generic parameter. No opened archetypes are
255256
// actually involved here--the API is only used as a convenient way to create
256257
// a substitution map. Since opened archetypes have different conformances
257258
// than their corresponding existential, ExistentialConformances needs to be
258259
// filtered when using it with this (phony) generic signature.
259-
CanGenericSignature ExistentialSig =
260-
M->getASTContext().getOpenedExistentialSignature(ExistentialType,
261-
GenericSignature());
260+
261+
auto &ctx = M->getASTContext();
262+
LocalArchetypeRequirementCollector collector(ctx, CanGenericSignature());
263+
collector.addOpenedExistential(ExistentialType);
264+
auto ExistentialSig = buildGenericSignature(
265+
ctx, collector.OuterSig, collector.Params, collector.Requirements,
266+
/*allowInverses=*/true).getCanonicalSignature();
267+
262268
ExistentialSubs = SubstitutionMap::get(
263269
ExistentialSig, [&](SubstitutableType *type) { return ConcreteType; },
264270
[&](CanType /*depType*/, Type /*replaceType*/,

0 commit comments

Comments
 (0)