================ @@ -2625,14 +2636,10 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings( // More analysis ... }; + // Emit per-function analysis-based warnings that require the whole-TU - // reasoning. Check if any of them is enabled at all before scanning the AST: - if (!Diags.isIgnored(diag::warn_unsafe_buffer_operation, SourceLocation()) || - !Diags.isIgnored(diag::warn_unsafe_buffer_variable, SourceLocation()) || - !Diags.isIgnored(diag::warn_unsafe_buffer_usage_in_container, - SourceLocation()) || - (!Diags.isIgnored(diag::warn_unsafe_buffer_libc_call, SourceLocation()) && - S.getLangOpts().CPlusPlus /* only warn about libc calls in C++ */)) { + // reasoning. + if (DefaultPolicy.enableUnsafeBufferUsage) { ---------------- kadircet wrote:
i know this is going to sound ugly, but by preserving the enabled-ness check here, in addition to doing it in the beginning ensures we won't regress behavior. leaving a fixme, similar to the one in the test file below should be good enough. https://github.com/llvm/llvm-project/pull/128603 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits