diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-03-30 05:55:46 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-03-30 05:55:46 +0000 |
commit | a865b79f871cb894efe42bed04b818c9c1f13570 (patch) | |
tree | de7c1c70b44ff0e7738c23e657a0a521d4ead66a | |
parent | b92a76ff4f81df71562f3c07697555013e044eec (diff) | |
download | bcm5719-llvm-a865b79f871cb894efe42bed04b818c9c1f13570.tar.gz bcm5719-llvm-a865b79f871cb894efe42bed04b818c9c1f13570.zip |
Implement a FIXME.
llvm-svn: 68024
-rw-r--r-- | clang/include/clang/Analysis/PathSensitive/GRState.h | 2 | ||||
-rw-r--r-- | clang/include/clang/Analysis/PathSensitive/Store.h | 2 | ||||
-rw-r--r-- | clang/lib/Analysis/BasicStore.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Analysis/RegionStore.cpp | 9 |
5 files changed, 6 insertions, 11 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/GRState.h b/clang/include/clang/Analysis/PathSensitive/GRState.h index 7110c7bc2d2..c1736116a7a 100644 --- a/clang/include/clang/Analysis/PathSensitive/GRState.h +++ b/clang/include/clang/Analysis/PathSensitive/GRState.h @@ -461,7 +461,7 @@ public: return BindExpr(St, Ex, V, isBlkExpr, Invalidate); } - SVal ArrayToPointer(SVal Array) { + SVal ArrayToPointer(Loc Array) { return StoreMgr->ArrayToPointer(Array); } diff --git a/clang/include/clang/Analysis/PathSensitive/Store.h b/clang/include/clang/Analysis/PathSensitive/Store.h index c52f389370d..ea7c496ff92 100644 --- a/clang/include/clang/Analysis/PathSensitive/Store.h +++ b/clang/include/clang/Analysis/PathSensitive/Store.h @@ -106,7 +106,7 @@ public: /// ArrayToPointer - Used by GRExprEngine::VistCast to handle implicit /// conversions between arrays and pointers. - virtual SVal ArrayToPointer(SVal Array) = 0; + virtual SVal ArrayToPointer(Loc Array) = 0; class CastResult { diff --git a/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp index 8c5b71f2341..cb6fcab3805 100644 --- a/clang/lib/Analysis/BasicStore.cpp +++ b/clang/lib/Analysis/BasicStore.cpp @@ -85,7 +85,7 @@ public: /// ArrayToPointer - Used by GRExprEngine::VistCast to handle implicit /// conversions between arrays and pointers. - SVal ArrayToPointer(SVal Array) { return Array; } + SVal ArrayToPointer(Loc Array) { return Array; } /// CastRegion - Used by GRExprEngine::VisitCast to handle casts from /// a MemRegion* to a specific location type. 'R' is the region being diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index 8241d13a0b3..41f6453a903 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/lib/Analysis/GRExprEngine.cpp @@ -1877,7 +1877,7 @@ void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet& Dst){ // Check for casts from array type to another type. if (ExTy->isArrayType()) { // We will always decay to a pointer. - V = StateMgr.ArrayToPointer(V); + V = StateMgr.ArrayToPointer(cast<Loc>(V)); // Are we casting from an array to a pointer? If so just pass on // the decayed value. diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index 59891f27cf0..60948062f6f 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/lib/Analysis/RegionStore.cpp @@ -199,7 +199,7 @@ public: /// version of that lvalue (i.e., a pointer to the first element of /// the array). This is called by GRExprEngine when evaluating /// casts from arrays to pointers. - SVal ArrayToPointer(SVal Array); + SVal ArrayToPointer(Loc Array); /// CastRegion - Used by GRExprEngine::VisitCast to handle casts from /// a MemRegion* to a specific location type. 'R' is the region being @@ -562,12 +562,7 @@ SVal RegionStoreManager::getSizeInElements(const GRState* St, /// version of that lvalue (i.e., a pointer to the first element of /// the array). This is called by GRExprEngine when evaluating casts /// from arrays to pointers. -SVal RegionStoreManager::ArrayToPointer(SVal Array) { - // FIXME: This should be factored into GRExprEngine. This allows - // us to pass a "loc" instead of an "SVal" for "Array". - if (Array.isUnknownOrUndef()) - return Array; - +SVal RegionStoreManager::ArrayToPointer(Loc Array) { if (!isa<loc::MemRegionVal>(Array)) return UnknownVal(); |