diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-08-09 22:55:51 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-08-09 22:55:51 +0000 |
commit | 1e934431adba0f459668a59c6059b9596fd627b4 (patch) | |
tree | 8a0019a8e8830dab5cd6c875f6da268537bab43a /lib/StaticAnalyzer/Core/MemRegion.cpp | |
parent | 824e07ac8f5c9efdddb4254de0203b9675b1ef0b (diff) |
[analyzer] Cluster bindings in RegionStore by base region.
This should speed up activities that need to access bindings by cluster,
such as invalidation and dead-bindings cleaning. In some cases all we save
is the cost of building the region cluster map, but other times we can
actually avoid traversing the rest of the store.
In casual testing, this produced a speedup of nearly 10% analyzing SQLite,
with /less/ memory used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/MemRegion.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/MemRegion.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Core/MemRegion.cpp b/lib/StaticAnalyzer/Core/MemRegion.cpp index 58abc9a280..19548be5e1 100644 --- a/lib/StaticAnalyzer/Core/MemRegion.cpp +++ b/lib/StaticAnalyzer/Core/MemRegion.cpp @@ -1052,10 +1052,17 @@ RegionOffset MemRegion::getAsOffset() const { case CXXThisRegionKind: case StringRegionKind: case VarRegionKind: - case ObjCIvarRegionKind: case CXXTempObjectRegionKind: goto Finish; + case ObjCIvarRegionKind: + // This is a little strange, but it's a compromise between + // ObjCIvarRegions having unknown compile-time offsets (when using the + // non-fragile runtime) and yet still being distinct, non-overlapping + // regions. Thus we treat them as "like" base regions for the purposes + // of computing offsets. + goto Finish; + case CXXBaseObjectRegionKind: { const CXXBaseObjectRegion *BOR = cast<CXXBaseObjectRegion>(R); R = BOR->getSuperRegion(); |