A recent discussion prompted us (Sonar) to share an early prototype of an alternative region store implementation using extents. This prototype was driven by the earlier shared algorithm.
As we don’t think we can invest more time in the prototype in the close/medium term, we think the best course of action would be to open-source what we got, with the intent of fostering development in this direction.
We still believe that a region store with extents is the right way, we just can’t allocate the resources here.
This prototype was made by @necto and @steakhal at Sonar.
…/StaticAnalyzer/Core/AnalyzerOptions.def | 4 +
…/Core/PathSensitive/ProgramState.h | 7 ±
…/StaticAnalyzer/Core/PathSensitive/Store.h | 17 ±
…/Checkers/CStringChecker.cpp | 6 ±
…/StaticAnalyzer/Checkers/MallocChecker.cpp | 6 ±
…/Checkers/NoOwnershipChangeVisitor.cpp | 7 ±
…/RetainCountDiagnostics.cpp | 11 ±
…/Checkers/StackAddrEscapeChecker.cpp | 25 ±
clang/lib/StaticAnalyzer/Core/CMakeLists.txt | 1 +
…/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | 14 ±
…/lib/StaticAnalyzer/Core/ProgramState.cpp | 24 ±
clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 8 ±
…/lib/StaticAnalyzer/Core/RegionStoreV2.cpp | 1319 +++++++++++++++++
clang/lib/StaticAnalyzer/Core/Store.cpp | 20 ±
…/Frontend/AnalysisConsumer.cpp | 3 ±
clang/test/Analysis/analyzer-config.c | 1 +
clang/test/Analysis/new-store-notes.cpp | 15 +
clang/test/Analysis/new-store.cpp | 1000 +++++++++++++
clang/unittests/StaticAnalyzer/StoreTest.cpp | 19 ±
19 files changed, 2432 insertions(+), 75 deletions(-)
create mode 100644 clang/lib/StaticAnalyzer/Core/RegionStoreV2.cpp
create mode 100644 clang/test/Analysis/new-store-notes.cpp
create mode 100644 clang/test/Analysis/new-store.cpp
0001-analyzer-Early-PoC-of-RegionStore-with-extents.patch (109.6 KB)
This cleanly applies on 372d3fb10c9dd0ff4e780d68b86220e30fd00b27 2025.10.01
Here is the same as a branch, if that’s more convinient.