[clang] [LifetimeSafety] Add missing origins stats for lifetime analysis (PR #166568)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 17 03:00:40 PST 2025


================
@@ -68,11 +70,22 @@ void LifetimeSafetyAnalysis::run() {
 
   runLifetimeChecker(*LoanPropagation, *LiveOrigins, FactMgr, AC, Reporter);
 }
+
+void collectLifetimeStats(AnalysisDeclContext &AC, OriginManager &OM,
+                          LifetimeSafetyStats &Stats) {
+  if (!AC.getBody())
+    return;
+  Stmt *FunctionBody = AC.getBody();
----------------
Xazax-hun wrote:

Nit: You could hoist this to before the early return and check `FunctionBody` for nullness.

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


More information about the cfe-commits mailing list