Skip to content

Commit fe87b99

Browse files
committed
PerformanceDiagnostics: when checking closure values, look through convert_function
1 parent fccecbe commit fe87b99

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ bool PerformanceDiagnostics::checkClosureValue(SILValue closure,
217217
closure = tfi->getOperand();
218218
} else if (auto *cp = dyn_cast<CopyValueInst>(closure)) {
219219
closure = cp->getOperand();
220+
} else if (auto *cv = dyn_cast<ConvertFunctionInst>(closure)) {
221+
closure = cv->getOperand();
220222
} else if (acceptFunctionArgs && isa<SILFunctionArgument>(closure)) {
221223
// We can assume that a function closure argument is already checked at
222224
// the call site.

0 commit comments

Comments
 (0)