[llvm-branch-commits] [clang] [analyzer] Only bind aggregate lifetime sources in LifetimeModeling for annotated functions (PR #214824)

Balázs Benics via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Aug 9 09:06:29 PDT 2026


================
@@ -167,6 +167,17 @@ lifetime_modeling::getRegionsFromAggrVal(SVal Val, CheckerContext &C) {
   return {};
 }
 
+static bool isAnnotated(const FunctionDecl *FD) {
+  for (const ParmVarDecl *PVD : FD->parameters()) {
+    if (PVD->hasAttr<LifetimeBoundAttr>())
+      return true;
+  }
+
+  if (lifetimes::implicitObjectParamIsLifetimeBound(FD))
+    return true;
+  return false;
----------------
steakhal wrote:

```suggestion
  return lifetimes::implicitObjectParamIsLifetimeBound(FD);
```

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


More information about the llvm-branch-commits mailing list