Author: Balázs Benics Date: 2026-10-25T20:27:26Z New Revision: d95fb01bb62ef627cdf631c25085fe8b0f314d0c
URL: https://github.com/llvm/llvm-project/commit/d95fb01bb62ef627cdf631c25085fe8b0f314d0c DIFF: https://github.com/llvm/llvm-project/commit/d95fb01bb62ef627cdf631c25085fe8b0f314d0c.diff LOG: [analyzer][NFC] BugReporterVisitors.h should include MemRegion.h (#235283) BugReporterVisitors.h includes RangedConstraintManager.h but uses nothing it declares: RangeSet, Range, ConstraintMap and SimpleConstraintManager appear nowhere in the file. What the header actually needs is MemRegion.h, which supplies SubRegion, MemRegionManager and MemRegion completeness for an inline constructor; today those arrive only by accident, transitively through RangedConstraintManager.h -> ProgramState.h. Swapping the include for the one that carries the used declarations makes the dependency honest and adds a forward declaration of CallEvent in namespace clang::ento for the one name that only needs to be incomplete. One header needs a compensating include: Z3CrosscheckVisitor.h uses ConstraintMap and was getting RangedConstraintManager.h through BugReporterVisitors.h, so it now includes it directly. No translation unit in clangStaticAnalyzerCore, clangStaticAnalyzerCheckers or clangStaticAnalyzerFrontend required any other change. This patch doesn't improve compile time but improves include hygiene. Authored-By: Claude Added: Modified: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h clang/include/clang/StaticAnalyzer/Core/BugReporter/Z3CrosscheckVisitor.h Removed: ################################################################################ diff --git a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h index 18d299f8bf7e2..9b1da8ce5e828 100644 --- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h +++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h @@ -16,7 +16,7 @@ #include "clang/Analysis/ProgramPoint.h" #include "clang/Basic/LLVM.h" -#include "clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h" #include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" @@ -40,6 +40,7 @@ namespace ento { class PathSensitiveBugReport; class BugReporterContext; +class CallEvent; class ExplodedNode; class MemRegion; class PathDiagnosticPiece; diff --git a/clang/include/clang/StaticAnalyzer/Core/BugReporter/Z3CrosscheckVisitor.h b/clang/include/clang/StaticAnalyzer/Core/BugReporter/Z3CrosscheckVisitor.h index 952ee09902dde..60e00a7535dbf 100644 --- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/Z3CrosscheckVisitor.h +++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/Z3CrosscheckVisitor.h @@ -15,6 +15,7 @@ #define LLVM_CLANG_STATICANALYZER_CORE_BUGREPORTER_Z3CROSSCHECKVISITOR_H #include "clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h" namespace clang::ento { _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
