[clang] [clang] Cache the analysis-based warning policy in effect (PR #212213)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 27 05:34:47 PDT 2026
================
@@ -226,6 +227,10 @@ class SemaPPCallbacks : public PPCallbacks {
}
void PragmaDiagnostic(SourceLocation Loc, StringRef Namespace,
diag::Severity Mapping, StringRef Str) override {
+ // The pragma changed diagnostic severities; drop any cached analysis
+ // warning policies derived from the previous state.
+ S->AnalysisWarnings.clearPolicyCache();
+
// If one of the analysis-based diagnostics was enabled while processing
----------------
AaronBallman wrote:
Is this now effectively dead code? (We don't need to keep the cached information up to date because we have cleared the cache anyway?)
https://github.com/llvm/llvm-project/pull/212213
More information about the cfe-commits
mailing list