summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-06-28 14:16:39 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-06-28 14:16:39 +0000
commit0628f539a801df1667c100bdb76fd38fa3f8ee02 (patch)
tree9522351b2b40217244eecdf4fe3b205bd977bb34 /clang/lib/Analysis/RegionStore.cpp
parent6f610707cf0919effb0c18337ca45579a37b0870 (diff)
downloadbcm5719-llvm-0628f539a801df1667c100bdb76fd38fa3f8ee02.tar.gz
bcm5719-llvm-0628f539a801df1667c100bdb76fd38fa3f8ee02.zip
Adjust retrieve handler priority. If a field is of array type, it should be
handled by RetrieveArray(). llvm-svn: 74409
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r--clang/lib/Analysis/RegionStore.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index 65864196c7d..493f14d499a 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/lib/Analysis/RegionStore.cpp
@@ -822,12 +822,6 @@ SVal RegionStoreManager::Retrieve(const GRState *state, Loc L, QualType T) {
const TypedRegion *R = cast<TypedRegion>(MR);
assert(R && "bad region");
- if (const FieldRegion* FR = dyn_cast<FieldRegion>(R))
- return RetrieveField(state, FR);
-
- if (const ElementRegion* ER = dyn_cast<ElementRegion>(R))
- return RetrieveElement(state, ER);
-
// FIXME: We should eventually handle funny addressing. e.g.:
//
// int x = ...;
@@ -848,6 +842,12 @@ SVal RegionStoreManager::Retrieve(const GRState *state, Loc L, QualType T) {
// FIXME: handle Vector types.
if (RTy->isVectorType())
return UnknownVal();
+
+ if (const FieldRegion* FR = dyn_cast<FieldRegion>(R))
+ return RetrieveField(state, FR);
+
+ if (const ElementRegion* ER = dyn_cast<ElementRegion>(R))
+ return RetrieveElement(state, ER);
RegionBindingsTy B = GetRegionBindings(state->getStore());
RegionBindingsTy::data_type* V = B.lookup(R);
OpenPOWER on IntegriCloud