summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/GRState.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-02-11 04:20:16 +0000
committerTed Kremenek <kremenek@apple.com>2011-02-11 04:20:16 +0000
commit5662dfefadd4cde10105f4acf6181b6e2051388f (patch)
tree566dacd8486c5074cbedf2790cd740e4a3c82551 /clang/lib/StaticAnalyzer/Core/GRState.cpp
parent4be2ab48946c44be65a7aabdca3836ed8a219537 (diff)
downloadbcm5719-llvm-5662dfefadd4cde10105f4acf6181b6e2051388f.tar.gz
bcm5719-llvm-5662dfefadd4cde10105f4acf6181b6e2051388f.zip
Allow the 'Eng' entry in GRStateManager to be a (possibly null) pointer instead of a reference.
llvm-svn: 125362
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/GRState.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/GRState.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/GRState.cpp b/clang/lib/StaticAnalyzer/Core/GRState.cpp
index 5fddcec94c6..0278a0d385f 100644
--- a/clang/lib/StaticAnalyzer/Core/GRState.cpp
+++ b/clang/lib/StaticAnalyzer/Core/GRState.cpp
@@ -94,8 +94,8 @@ const GRState *GRState::bindLoc(Loc LV, SVal V) const {
const GRState *new_state = makeWithStore(new_store);
const MemRegion *MR = LV.getAsRegion();
- if (MR)
- return Mgr.getOwningEngine().processRegionChange(new_state, MR);
+ if (MR && Mgr.getOwningEngine())
+ return Mgr.getOwningEngine()->processRegionChange(new_state, MR);
return new_state;
}
@@ -105,7 +105,9 @@ const GRState *GRState::bindDefault(SVal loc, SVal V) const {
const MemRegion *R = cast<loc::MemRegionVal>(loc).getRegion();
Store new_store = Mgr.StoreMgr->BindDefault(St, R, V);
const GRState *new_state = makeWithStore(new_store);
- return Mgr.getOwningEngine().processRegionChange(new_state, R);
+ return Mgr.getOwningEngine() ?
+ Mgr.getOwningEngine()->processRegionChange(new_state, R) :
+ new_state;
}
const GRState *GRState::InvalidateRegions(const MemRegion * const *Begin,
@@ -114,9 +116,9 @@ const GRState *GRState::InvalidateRegions(const MemRegion * const *Begin,
StoreManager::InvalidatedSymbols *IS,
bool invalidateGlobals) const {
GRStateManager &Mgr = getStateManager();
- SubEngine &Eng = Mgr.getOwningEngine();
-
- if (Eng.wantsRegionChangeUpdate(this)) {
+ SubEngine* Eng = Mgr.getOwningEngine();
+
+ if (Eng && Eng->wantsRegionChangeUpdate(this)) {
StoreManager::InvalidatedRegions Regions;
Store new_store = Mgr.StoreMgr->InvalidateRegions(St, Begin, End,
@@ -125,9 +127,9 @@ const GRState *GRState::InvalidateRegions(const MemRegion * const *Begin,
&Regions);
const GRState *new_state = makeWithStore(new_store);
- return Eng.processRegionChanges(new_state,
- &Regions.front(),
- &Regions.back()+1);
+ return Eng->processRegionChanges(new_state,
+ &Regions.front(),
+ &Regions.back()+1);
}
Store new_store = Mgr.StoreMgr->InvalidateRegions(St, Begin, End,
OpenPOWER on IntegriCloud