[clang] [Fix] Speedup -Wunsafe-buffer-usage when using clang modules. (PR #127161)

via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 16 18:11:32 PST 2025


================
@@ -2633,7 +2646,7 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(
                        SourceLocation()) ||
       (!Diags.isIgnored(diag::warn_unsafe_buffer_libc_call, SourceLocation()) &&
        S.getLangOpts().CPlusPlus /* only warn about libc calls in C++ */)) {
-    CallableVisitor(CallAnalyzers).TraverseTranslationUnitDecl(TU);
+    CallableVisitor(CallAnalyzers, TU->getOwningModuleID()).TraverseTranslationUnitDecl(TU);
----------------
matts1 wrote:

There's no `operator==` on the `Module` class. Would I be correct in assuming that comparing pointers is the correct way to check for equality (in other words, can I assume that each module only has one associated instance)?

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


More information about the cfe-commits mailing list