mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[mangler][specializer] When mangling ExistentialMetatypes or Metatypes, mangle in the representation of the metatype.
rdar://16937175 Swift SVN r18219
This commit is contained in:
@@ -799,6 +799,17 @@ GenericSpecializer::specializeApplyInstGroup(SILFunction *F, AIList &List) {
|
||||
if (auto PrevF = M->lookUpFunction(ClonedName)) {
|
||||
NewF = PrevF;
|
||||
createdFunction = false;
|
||||
|
||||
#ifndef NDEBUG
|
||||
// Make sure that NewF's subst type matches the expected type.
|
||||
auto Subs = Bucket[0]->getSubstitutions();
|
||||
auto FTy =
|
||||
F->getLoweredFunctionType()->substInterfaceGenericArgs(*M,
|
||||
M->getSwiftModule(),
|
||||
Subs);
|
||||
assert(FTy == NewF->getLoweredFunctionType() &&
|
||||
"Previously specialized function does not match expected type.");
|
||||
#endif
|
||||
} else {
|
||||
// Create a new function.
|
||||
NewF = TypeSubCloner::cloneFunction(F, InterfaceSubs, ContextSubs,
|
||||
|
||||
Reference in New Issue
Block a user