]> granicus.if.org Git - clang/commitdiff
Implement a FIXME.
authorZhongxing Xu <xuzhongxing@gmail.com>
Mon, 30 Mar 2009 05:55:46 +0000 (05:55 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Mon, 30 Mar 2009 05:55:46 +0000 (05:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68024 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/GRState.h
include/clang/Analysis/PathSensitive/Store.h
lib/Analysis/BasicStore.cpp
lib/Analysis/GRExprEngine.cpp
lib/Analysis/RegionStore.cpp

index 7110c7bc2d2416697114a5f503f58bf8a9f4654e..c1736116a7a762e2afa705b35d0335a4fae1d76f 100644 (file)
@@ -461,7 +461,7 @@ public:
     return BindExpr(St, Ex, V, isBlkExpr, Invalidate);
   }
 
-  SVal ArrayToPointer(SVal Array) {
+  SVal ArrayToPointer(Loc Array) {
     return StoreMgr->ArrayToPointer(Array);
   }
   
index c52f389370d998b57763bc01495ee911221f6550..ea7c496ff92a99970d9970c0770d12efb5d432a3 100644 (file)
@@ -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 {
index 8c5b71f234128d4fb21b57e77bf1ab1062ffd216..cb6fcab3805d193b6aafead30721d17417dbcee2 100644 (file)
@@ -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
index 8241d13a0b32f06eb5dbbf6bc362101a9a0bac98..41f6453a9033e2c87841d4ef8a5c193c42993803 100644 (file)
@@ -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.
index 59891f27cf0016455e5fb291176a6ef7e48afbe8..60948062f6f9f54db3f9ba05668da9edaa0bae34 100644 (file)
@@ -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();