summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-01 23:30:34 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-01 23:30:34 +0000
commit873db258791b2c16ede203276737b3d46d5798bd (patch)
tree5c58798c2d3f311f4359beeb0cca790b7fc49611 /clang/lib/Analysis/RegionStore.cpp
parente4d00dd7f67ccb5ffe73e57e52aa637396c41fe7 (diff)
downloadbcm5719-llvm-873db258791b2c16ede203276737b3d46d5798bd.tar.gz
bcm5719-llvm-873db258791b2c16ede203276737b3d46d5798bd.zip
Minor code cleanup: pull variables into scope of 'if' statement, limiting their
actual lifetime to their logical lifetime. llvm-svn: 74665
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r--clang/lib/Analysis/RegionStore.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index bc83d1636d2..dc9a2be6282 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/lib/Analysis/RegionStore.cpp
@@ -990,13 +990,11 @@ SVal RegionStoreManager::RetrieveField(const GRState* state,
// Check if the region has a binding.
RegionBindingsTy B = GetRegionBindings(state->getStore());
- const SVal* V = B.lookup(R);
- if (V)
+ if (const SVal* V = B.lookup(R))
return *V;
- const MemRegion* SuperR = R->getSuperRegion();
- const SVal* D = state->get<RegionDefaultValue>(SuperR);
- if (D) {
+ const MemRegion* superR = R->getSuperRegion();
+ if (const SVal* D = state->get<RegionDefaultValue>(superR)) {
if (D->hasConjuredSymbol())
return ValMgr.getRegionValueSymbolVal(R);
@@ -1389,19 +1387,19 @@ Store RegionStoreManager::RemoveDeadBindings(const GRState *state, Stmt* Loc,
}
else {
// Get the super region for R.
- const MemRegion* SuperR = cast<SubRegion>(R)->getSuperRegion();
+ const MemRegion* superR = cast<SubRegion>(R)->getSuperRegion();
// Get the current set of subregions for SuperR.
- const SubRegionsTy* SRptr = SubRegMap.lookup(SuperR);
+ const SubRegionsTy* SRptr = SubRegMap.lookup(superR);
SubRegionsTy SRs = SRptr ? *SRptr : SubRegF.GetEmptySet();
// Add R to the subregions of SuperR.
- SubRegMap = SubRegMapF.Add(SubRegMap, SuperR, SubRegF.Add(SRs, R));
+ SubRegMap = SubRegMapF.Add(SubRegMap, superR, SubRegF.Add(SRs, R));
// Super region may be VarRegion or subregion of another VarRegion. Add it
// to the work list.
- if (isa<SubRegion>(SuperR))
- IntermediateRoots.push_back(SuperR);
+ if (isa<SubRegion>(superR))
+ IntermediateRoots.push_back(superR);
}
}
OpenPOWER on IntegriCloud