llvm-project
22644657 - [analyzer][NFC] Drop `SourceManager.h` from `CallEvent.h` (#248179)

Commit
1 day ago
[analyzer][NFC] Drop `SourceManager.h` from `CallEvent.h` (#248179) - `CallEvent::isInSystemHeader` was the only user of `SourceManager` in `CallEvent.h`, yet its inline body made every includer of the header parse `clang/Basic/SourceManager.h`. Move the body into `CallEvent.cpp` and drop the include. - Include `clang/Basic/SourceManager.h` explicitly in `ErrnoChecker.cpp`, `ErrnoModeling.cpp`, `LocalizationChecker.cpp`, `NullabilityChecker.cpp`, `VirtualCallChecker.cpp` and `ExprEngineCallAndReturn.cpp`, which relied on it transitively. Build-time impact (instructions retired, 196 `lib/StaticAnalyzer` TUs): - Total: -0.79% (5 paired sweeps, all faster; run-to-run noise 0.3%). - 140 TUs change by more than 0.15%, by -1.07% over those (net, including the TUs that regain the include). Run-time impact (analyzer, 20 TUs of clang/lib/{AST,Sema,Parse,CodeGen}, elapsed cycles, 10 interleaved rounds per binary, before = merge base a26d5a8): - Result: no slowdown detected. Median of per-round totals +0.04%: no measurable change (95% CI -0.06%..+0.30% includes zero); at 95% confidence any slowdown is below +0.30%. - Total per round (%): +0.77, -0.02, -0.23, +0.02, +0.06, +0.49, -0.15, -0.18, +0.21, +0.10. - Worst / best single TU (median over rounds): +0.63% / -0.48%. - Noise reference (same binary measured twice): total mean +0.01% (per-round -0.23%..+0.21%), single TU worst/best +0.79% / -0.73%. Assisted-by: Claude Code
Author
Parents
Loading