Skip to content

Commit df2afaa

Browse files
authored
Merge pull request swiftlang#24936 from atrick/comment-closure-scope
Add a comment in ClosureScopeAnalysis.
2 parents bdf7b2a + 4e00cad commit df2afaa

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)