summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/Store.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-11-16 04:49:44 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-11-16 04:49:44 +0000
commit731f46264f7f8b79a79765e467ec518f49b549b8 (patch)
tree564ba3a665f481af469d80d0eda6fb94b5ba2a43 /clang/lib/Analysis/Store.cpp
parent5bf807688e07ff84788aa2cc6f511121b7cfb5ac (diff)
downloadbcm5719-llvm-731f46264f7f8b79a79765e467ec518f49b549b8.tar.gz
bcm5719-llvm-731f46264f7f8b79a79765e467ec518f49b549b8.zip
* Do the same thing to the basicstore as in r84163.
* Add a load type to GRExprEngine::EvalLoad(). * When retrieve from 'theValue' of OSAtomic funcitions, use the type of the region instead of the argument expression as the load type. * Then we can convert CastRetrievedSVal to a pure assertion. In the future we can let all Retrieve() methods simply return SVal. llvm-svn: 88888
Diffstat (limited to 'clang/lib/Analysis/Store.cpp')
-rw-r--r--clang/lib/Analysis/Store.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/clang/lib/Analysis/Store.cpp b/clang/lib/Analysis/Store.cpp
index 16af1be91ec..afe2b4e7bd6 100644
--- a/clang/lib/Analysis/Store.cpp
+++ b/clang/lib/Analysis/Store.cpp
@@ -21,7 +21,7 @@ StoreManager::StoreManager(GRStateManager &stateMgr)
MRMgr(ValMgr.getRegionManager()) {}
const MemRegion *StoreManager::MakeElementRegion(const MemRegion *Base,
- QualType EleTy, uint64_t index) {
+ QualType EleTy, uint64_t index) {
SVal idx = ValMgr.makeArrayIndex(index);
return MRMgr.getElementRegion(EleTy, idx, Base, ValMgr.getContext());
}
@@ -192,14 +192,16 @@ const MemRegion *StoreManager::CastRegion(const MemRegion *R, QualType CastToTy)
/// CastRetrievedVal - Used by subclasses of StoreManager to implement
/// implicit casts that arise from loads from regions that are reinterpreted
/// as another region.
-SValuator::CastResult StoreManager::CastRetrievedVal(SVal V,
- const GRState *state,
- const TypedRegion *R,
- QualType castTy) {
+SVal StoreManager::CastRetrievedVal(SVal V, const TypedRegion *R,
+ QualType castTy) {
+ ASTContext &Ctx = ValMgr.getContext();
+
if (castTy.isNull())
- return SValuator::CastResult(state, V);
+ return V;
+
+ assert(Ctx.getCanonicalType(castTy).getUnqualifiedType() ==
+ Ctx.getCanonicalType(R->getValueType(Ctx)).getUnqualifiedType());
- ASTContext &Ctx = ValMgr.getContext();
- return ValMgr.getSValuator().EvalCast(V, state, castTy, R->getValueType(Ctx));
+ return V;
}
OpenPOWER on IntegriCloud