[clang] [LifetimeSafety] Handle escape through function call (PR #186126)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 1 02:54:29 PDT 2026


================
@@ -232,6 +225,34 @@ class GlobalEscapeFact : public OriginEscapesFact {
             const OriginManager &OM) const override;
 };
 
+/// Represents escape of an origin through a function call.
+/// Example:
+/// void f(int *i);
+/// void g(int *j[[clang::noescape]]) {f(j)};
+/// This fact enables us to catch that the noescape parameter j escapes through
+/// the call to function f
+class CallEscapeFact : public OriginEscapesFact {
+  const Expr *Call;
+  const Expr *Argument;
----------------
Xazax-hun wrote:

Do we need both the argument and the argument index? I wonder if we could always use one to get the other?

https://github.com/llvm/llvm-project/pull/186126


More information about the cfe-commits mailing list