================
@@ -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;
+    auto AddFunctionToList = [&](const Decl *D) -> void {
+      if (const auto *FD = dyn_cast<FunctionDecl>(D))
+        if (FD->doesThisDeclarationHaveABody() &&
+            !S.getSourceManager().isInSystemHeader(FD->getLocation()))
+          AllFunctions.push_back(FD);
+    };
+    CallableVisitor(AddFunctionToList, TU->getOwningModule())
+        .TraverseTranslationUnitDecl(TU);
+
+    if (AllFunctions.empty())
+      return;
+
+    clang::CallGraph CG;
----------------
Xazax-hun wrote:

Do you need the `clang::` qualifiers here?

https://github.com/llvm/llvm-project/pull/174178
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to