mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Replace uses of getReferencedFunction() by getReferencedFunctionOrNull() and getInitialReferencedFunction()
With the advent of dynamic_function_ref the actual callee of such a ref my vary. Optimizations should not assume to know the content of a function referenced by dynamic_function_ref. Introduce getReferencedFunctionOrNull which will return null for such function refs. And getInitialReferencedFunction to return the referenced function. Use as appropriate. rdar://50959798
This commit is contained in:
@@ -471,7 +471,7 @@ bool FunctionSideEffects::summarizeCall(FullApplySite fullApply) {
|
||||
}
|
||||
}
|
||||
|
||||
if (SILFunction *SingleCallee = fullApply.getReferencedFunction()) {
|
||||
if (SILFunction *SingleCallee = fullApply.getReferencedFunctionOrNull()) {
|
||||
// Does the function have any @_effects?
|
||||
if (setDefinedEffects(SingleCallee))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user