summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
diff options
context:
space:
mode:
authorAnton Yartsev <anton.yartsev@gmail.com>2013-04-24 10:24:38 +0000
committerAnton Yartsev <anton.yartsev@gmail.com>2013-04-24 10:24:38 +0000
commit67f1ab0de81df1c14ff90e264ddd149e62fa8e7c (patch)
treec65765f15e3c90809782e9544bc0ac808accc9f9 /clang/lib/StaticAnalyzer/Core/RegionStore.cpp
parent54d9c81082737bd367dab0e125564239b002a14a (diff)
downloadbcm5719-llvm-67f1ab0de81df1c14ff90e264ddd149e62fa8e7c.tar.gz
bcm5719-llvm-67f1ab0de81df1c14ff90e264ddd149e62fa8e7c.zip
[analyzer] Refactoring + explanatory comment.
llvm-svn: 180181
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/RegionStore.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/RegionStore.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index 20ee6bf6bed..dbfd9d6c990 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -1011,6 +1011,7 @@ void invalidateRegionsWorker::VisitCluster(const MemRegion *baseR,
for (ClusterBindings::iterator I = C->begin(), E = C->end(); I != E; ++I)
VisitBinding(I.getData());
+ // Invalidate the contents of a non-const base region.
if (!IsConst)
B = B.remove(baseR);
}
@@ -1043,18 +1044,19 @@ void invalidateRegionsWorker::VisitCluster(const MemRegion *baseR,
}
// Symbolic region?
- SymbolRef RegionSym = 0;
- if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(baseR))
- RegionSym = SR->getSymbol();
+ if (const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(baseR)) {
+ SymbolRef RegionSym = SR->getSymbol();
- if (IsConst) {
// Mark that symbol touched by the invalidation.
- ConstIS.insert(RegionSym);
- return;
+ if (IsConst)
+ ConstIS.insert(RegionSym);
+ else
+ IS.insert(RegionSym);
}
-
- // Mark that symbol touched by the invalidation.
- IS.insert(RegionSym);
+
+ // Nothing else should be done for a const region.
+ if (IsConst)
+ return;
// Otherwise, we have a normal data region. Record that we touched the region.
if (Regions)
OpenPOWER on IntegriCloud