[clang] [LifetimeSafety] Run analysis in post-order of CallGraph for better annotation propagation (PR #174178)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 5 10:07:28 PST 2026
================
@@ -2969,6 +3009,46 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(
CallableVisitor(CallAnalyzers, TU->getOwningModule())
.TraverseTranslationUnitDecl(TU);
}
+
+ if (S.getLangOpts().EnableLifetimeSafety && S.getLangOpts().CPlusPlus &&
+ S.getLangOpts().EnableLifetimeSafetyInferencePostOrder) {
+ llvm::SmallVector<const FunctionDecl *, 64> AllFunctions;
----------------
usx95 wrote:
I would suggest to move the body of the `if` to a separate function. Also add a TimeTraceScope for that function. That would help in estimating the cost of doing this. I am primarily concerned about the CFG rebuilding and CallGraph building although I am positive that would be smallish and acceptable regression.
https://github.com/llvm/llvm-project/pull/174178
More information about the cfe-commits
mailing list