mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ExistentialTransform fixes for swiftpm bugs and enable existential-specializer in sil-opt
This commit is contained in:
@@ -101,7 +101,8 @@ static bool findConcreteType(ApplySite AI, int ArgIdx, CanType &ConcreteType) {
|
||||
SILValue InitExistential =
|
||||
findInitExistentialFromGlobalAddrAndApply(GAI, AI, ArgIdx);
|
||||
/// If the Arg is already init_existential, return the concrete type.
|
||||
if (findConcreteTypeFromInitExistential(InitExistential, ConcreteType)) {
|
||||
if (InitExistential &&
|
||||
findConcreteTypeFromInitExistential(InitExistential, ConcreteType)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -257,6 +258,12 @@ bool ExistentialSpecializer::canSpecializeCalleeFunction(ApplySite &Apply) {
|
||||
if (Callee->getInlineStrategy() == Inline_t::AlwaysInline)
|
||||
return false;
|
||||
|
||||
/// Ignore externally linked functions with public_external or higher
|
||||
/// linkage.
|
||||
if (isAvailableExternally(Callee->getLinkage())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Only choose a select few function representations for specialization.
|
||||
switch (Callee->getRepresentation()) {
|
||||
case SILFunctionTypeRepresentation::ObjCMethod:
|
||||
|
||||
Reference in New Issue
Block a user