Skip to content

Commit 4e00cad

Browse files
committed
Add a comment in ClosureScopeAnalysis.
As a follow-up to reviewing the dynamically replaceable implementation, document the place where this analysis will likely crash in the future once we start optimizing non-escaping closure captures.
1 parent 868156c commit 4e00cad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SILOptimizer/Mandatory/AccessEnforcementSelection.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ class DynamicCaptures {
107107
void recordCapture(AddressCapture capture) {
108108
LLVM_DEBUG(llvm::dbgs() << "Dynamic Capture: " << capture);
109109

110+
// *NOTE* For dynamically replaceable local functions, getCalleeFunction()
111+
// returns nullptr. This assert verifies the assumption that a captured
112+
// local variable can never be promoted to capture-by-address for
113+
// dynamically replaceable local functions.
110114
auto callee = capture.site.getCalleeFunction();
111115
assert(callee && "cannot locate function ref for nonescaping closure");
112116

0 commit comments

Comments
 (0)