]> granicus.if.org Git - clang/commit
[analyzer] Add TK_EntireMemSpace invalidation trait.
authorDevin Coughlin <dcoughlin@apple.com>
Thu, 1 Oct 2015 20:09:11 +0000 (20:09 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Thu, 1 Oct 2015 20:09:11 +0000 (20:09 +0000)
commit6fd4426a8bb2808525cae8beae93306e8060f40d
tree26054f43723731b75e3441069f26ad04c4ede3b5
parent4007fb7d76039627f1d9df805867d864e8481124
[analyzer] Add TK_EntireMemSpace invalidation trait.

This commit supports Sean Eveson's work on loop widening. It is NFC for now.
It adds a new TK_EntireMemSpace invalidation trait that, when applied to a
MemSpaceRegion, indicates that the entire memory space should be invalidated.

Clients can add this trait before invalidating. For example:

RegionAndSymbolInvalidationTraits ITraits;
ITraits.setTrait(MRMgr.getStackLocalsRegion(STC),
                 RegionAndSymbolInvalidationTraits::TK_EntireMemSpace);

This commit updates the existing logic invalidating global memspace regions for
calls to additionally handle arbitrary memspaces. When generating initial
clusters during cluster analysis we now add a cluster to the worklist if
the memspace for its base is marked with TK_EntireMemSpace.

This also moves the logic for invalidating globals from ClusterAnalysis to
invalidateRegionsWorker so that it is not shared with removeDeadBindingsWorker.

There are no explicit tests with this patch -- but when applied to Sean's patch
for loop widening in http://reviews.llvm.org/D12358 and after updating his code
to set the trait, the failing tests in that patch now pass.

Differential Revision: http://reviews.llvm.org/D12993

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249063 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
lib/StaticAnalyzer/Core/RegionStore.cpp