Rewrite ClosureScopeAnalysis for generality.

Handle recursive non-escaping local functions.

Previously, it was thought that recursion would force a closure to be
escaping. This is not necessarilly true.

Update AccessEnforcementSelection to conservatively handle closure cycles.

Fixes rdar://88726092 (Compiler hangs when building)
This commit is contained in:
Andrew Trick
2022-03-14 19:51:34 -07:00
parent 268309e268
commit ddf0965d3f
7 changed files with 517 additions and 216 deletions

View File

@@ -169,6 +169,10 @@ public:
FOREACH_IMPL_RETURN(getCalleeFunction());
}
bool isCalleeDynamicallyReplaceable() const {
FOREACH_IMPL_RETURN(isCalleeDynamicallyReplaceable());
}
/// Return the referenced function if the callee is a function_ref
/// instruction.
SILFunction *getReferencedFunctionOrNull() const {