[cfe-commits] r69577 - in /cfe/trunk: include/clang/Analysis/PathSensitive/SVals.h lib/Analysis/BasicStore.cpp lib/Analysis/GRSimpleVals.cpp lib/Analysis/RegionStore.cpp lib/Analysis/SVals.cpp lib/Analysis/SimpleConstraintManager.cpp

Zhongxing Xu xuzhongxing at gmail.com
Sun Apr 19 23:35:22 PDT 2009


Author: zhongxingxu
Date: Mon Apr 20 01:35:22 2009
New Revision: 69577

URL: http://llvm.org/viewvc/llvm-project?rev=69577&view=rev
Log:
Remove loc::FuncVal.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h
    cfe/trunk/lib/Analysis/BasicStore.cpp
    cfe/trunk/lib/Analysis/GRSimpleVals.cpp
    cfe/trunk/lib/Analysis/RegionStore.cpp
    cfe/trunk/lib/Analysis/SVals.cpp
    cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp

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

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h Mon Apr 20 01:35:22 2009
@@ -362,7 +362,7 @@
 
 namespace loc {
   
-enum Kind { GotoLabelKind, MemRegionKind, FuncValKind, ConcreteIntKind };
+enum Kind { GotoLabelKind, MemRegionKind, ConcreteIntKind };
 
 class GotoLabel : public Loc {
 public:
@@ -415,33 +415,6 @@
   }    
 };
 
-class FuncVal : public Loc {
-public:
-  FuncVal(const FunctionDecl* fd) : Loc(FuncValKind, fd) {}
-  
-  FunctionDecl* getDecl() const {
-    return static_cast<FunctionDecl*>(Data);
-  }
-  
-  inline bool operator==(const FuncVal& R) const {
-    return getDecl() == R.getDecl();
-  }
-  
-  inline bool operator!=(const FuncVal& R) const {
-    return getDecl() != R.getDecl();
-  }
-  
-  // Implement isa<T> support.
-  static inline bool classof(const SVal* V) {
-    return V->getBaseKind() == LocKind &&
-           V->getSubKind() == FuncValKind;
-  }
-  
-  static inline bool classof(const Loc* V) {
-    return V->getSubKind() == FuncValKind;
-  }
-};
-
 class ConcreteInt : public Loc {
 public:
   ConcreteInt(const llvm::APSInt& V) : Loc(ConcreteIntKind, &V) {}

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

==============================================================================
--- cfe/trunk/lib/Analysis/BasicStore.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicStore.cpp Mon Apr 20 01:35:22 2009
@@ -200,8 +200,6 @@
   
   switch(BaseL.getSubKind()) {
     case loc::GotoLabelKind:
-    case loc::FuncValKind:
-      // Technically we can get here if people do funny things with casts.
       return UndefinedVal();
 
     case loc::MemRegionKind:
@@ -234,7 +232,6 @@
   
   switch(BaseL.getSubKind()) {
     case loc::GotoLabelKind:
-    case loc::FuncValKind:
       // Technically we can get here if people do funny things with casts.
       return UndefinedVal();
       
@@ -338,8 +335,6 @@
       // they are doing a quick scan through their Locs (potentially to
       // invalidate their bindings).  Just return Undefined.
       return UndefinedVal();            
-    case loc::FuncValKind:
-      return loc;
       
     default:
       assert (false && "Invalid Loc.");

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.cpp (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.cpp Mon Apr 20 01:35:22 2009
@@ -307,7 +307,6 @@
     
     // Fall-through.
       
-    case loc::FuncValKind:
     case loc::GotoLabelKind:
       return NonLoc::MakeIntTruthVal(BasicVals, L == R);
   }
@@ -356,7 +355,6 @@
       // Fall through:
     }
       
-    case loc::FuncValKind:
     case loc::GotoLabelKind:
       return NonLoc::MakeIntTruthVal(BasicVals, L != R);
   }

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

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Mon Apr 20 01:35:22 2009
@@ -365,7 +365,6 @@
     break;
 
   case loc::GotoLabelKind:
-  case loc::FuncValKind:
     // These are anormal cases. Flag an undefined value.
     return UndefinedVal();
 
@@ -662,11 +661,6 @@
   if (isa<loc::ConcreteInt>(L))
     return UndefinedVal();
 
-  // FIXME: Should this be refactored into GRExprEngine or GRStateManager?
-  //  It seems that all StoreManagers would do the same thing here.
-  if (isa<loc::FuncVal>(L))
-    return L;
-
   const MemRegion* MR = cast<loc::MemRegionVal>(L).getRegion();
 
   // We return unknown for symbolic region for now. This might be improved.

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

==============================================================================
--- cfe/trunk/lib/Analysis/SVals.cpp (original)
+++ cfe/trunk/lib/Analysis/SVals.cpp Mon Apr 20 01:35:22 2009
@@ -31,10 +31,6 @@
 //===----------------------------------------------------------------------===//
 
 const FunctionDecl* SVal::getAsFunctionDecl() const {
-  if (const loc::FuncVal* FV = dyn_cast<loc::FuncVal>(this)) {
-    return FV->getDecl();
-  }
-
   if (const loc::MemRegionVal* X = dyn_cast<loc::MemRegionVal>(this)) {
     const MemRegion* R = X->getRegion();
     if (const CodeTextRegion* CTR = dyn_cast<CodeTextRegion>(R)) {
@@ -481,11 +477,6 @@
       Out << '&' << cast<loc::MemRegionVal>(this)->getRegion()->getString();
       break;
       
-    case loc::FuncValKind:
-      Out << "function " 
-          << cast<loc::FuncVal>(this)->getDecl()->getIdentifier()->getName();
-      break;
-      
     default:
       assert (false && "Pretty-printing not implemented for this Loc.");
       break;

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

==============================================================================
--- cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp (original)
+++ cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp Mon Apr 20 01:35:22 2009
@@ -116,7 +116,6 @@
     // FALL-THROUGH.
   }
       
-  case loc::FuncValKind:
   case loc::GotoLabelKind:
     isFeasible = Assumption;
     return St;





More information about the cfe-commits mailing list