[cfe-commits] r68024 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRState.h include/clang/Analysis/PathSensitive/Store.h lib/Analysis/BasicStore.cpp lib/Analysis/GRExprEngine.cpp lib/Analysis/RegionStore.cpp

Zhongxing Xu xuzhongxing at gmail.com
Sun Mar 29 22:55:47 PDT 2009


Author: zhongxingxu
Date: Mon Mar 30 00:55:46 2009
New Revision: 68024

URL: http://llvm.org/viewvc/llvm-project?rev=68024&view=rev
Log:
Implement a FIXME.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
    cfe/trunk/include/clang/Analysis/PathSensitive/Store.h
    cfe/trunk/lib/Analysis/BasicStore.cpp
    cfe/trunk/lib/Analysis/GRExprEngine.cpp
    cfe/trunk/lib/Analysis/RegionStore.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h?rev=68024&r1=68023&r2=68024&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h Mon Mar 30 00:55:46 2009
@@ -461,7 +461,7 @@
     return BindExpr(St, Ex, V, isBlkExpr, Invalidate);
   }
 
-  SVal ArrayToPointer(SVal Array) {
+  SVal ArrayToPointer(Loc Array) {
     return StoreMgr->ArrayToPointer(Array);
   }
   

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/Store.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/Store.h?rev=68024&r1=68023&r2=68024&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/Store.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/Store.h Mon Mar 30 00:55:46 2009
@@ -106,7 +106,7 @@
 
   /// 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 {

Modified: cfe/trunk/lib/Analysis/BasicStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicStore.cpp?rev=68024&r1=68023&r2=68024&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BasicStore.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicStore.cpp Mon Mar 30 00:55:46 2009
@@ -85,7 +85,7 @@
 
   /// 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

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=68024&r1=68023&r2=68024&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Mon Mar 30 00:55:46 2009
@@ -1877,7 +1877,7 @@
     // 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.

Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=68024&r1=68023&r2=68024&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Mon Mar 30 00:55:46 2009
@@ -199,7 +199,7 @@
   ///  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 @@
 ///  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();
   





More information about the cfe-commits mailing list