Skip to content

Commit 22f6a52

Browse files
authored
Merge pull request swiftlang#28391 from gottesmm/pr-387c0c7db76bf23d1538f79b329f5657a6431965
[existential-specializer] Do not process callees with ownership as well as callers without ownership.
2 parents 7ff18df + 5224218 commit 22f6a52

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/SILOptimizer/FunctionSignatureTransforms/ExistentialSpecializer.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ bool ExistentialSpecializer::canSpecializeExistentialArgsInFunction(
207207

208208
/// Determine if this callee function can be specialized or not.
209209
bool ExistentialSpecializer::canSpecializeCalleeFunction(FullApplySite &Apply) {
210-
211210
/// Determine the caller of the apply.
212211
auto *Callee = Apply.getReferencedFunctionOrNull();
213212
if (!Callee)
@@ -221,6 +220,13 @@ bool ExistentialSpecializer::canSpecializeCalleeFunction(FullApplySite &Apply) {
221220
if (!Callee->isDefinition())
222221
return false;
223222

223+
// If the callee has ownership enabled, bail.
224+
//
225+
// FIXME: We should be able to handle callees that have ownership, but the
226+
// pass has not been updated yet.
227+
if (Callee->hasOwnership())
228+
return false;
229+
224230
/// Ignore functions with indirect results.
225231
if (Callee->getConventions().hasIndirectSILResults())
226232
return false;

0 commit comments

Comments
 (0)