[cfe-commits] r68063 - in /cfe/trunk: include/clang/Analysis/PathSensitive/SVals.h lib/Analysis/SVals.cpp

Ted Kremenek kremenek at apple.com
Mon Mar 30 14:27:52 PDT 2009


Author: kremenek
Date: Mon Mar 30 16:27:41 2009
New Revision: 68063

URL: http://llvm.org/viewvc/llvm-project?rev=68063&view=rev
Log:
Remove dead code.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h
    cfe/trunk/lib/Analysis/SVals.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=68063&r1=68062&r2=68063&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SVals.h Mon Mar 30 16:27:41 2009
@@ -208,15 +208,18 @@
 class Loc : public SVal {
 protected:
   Loc(unsigned SubKind, const void* D)
-    : SVal(const_cast<void*>(D), true, SubKind) {}
+  : SVal(const_cast<void*>(D), true, SubKind) {}
   
-  // Equality operators.
-  NonLoc EQ(SymbolManager& SM, const Loc& R) const;
-  NonLoc NE(SymbolManager& SM, const Loc& R) const;
+//  // Equality operators.
+//  NonLoc EQ(SymbolManager& SM, Loc R) const;
+//  NonLoc NE(SymbolManager& SM, Loc R) const;
   
 public:
   void print(llvm::raw_ostream& Out) const;
 
+  Loc(const Loc& X) : SVal(X.Data, true, X.getSubKind()) {}
+  Loc& operator=(const Loc& X) { memcpy(this, &X, sizeof(Loc)); return *this; }
+    
   static Loc MakeVal(const MemRegion* R);
     
   static Loc MakeVal(AddrLabelExpr* E);

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

==============================================================================
--- cfe/trunk/lib/Analysis/SVals.cpp (original)
+++ cfe/trunk/lib/Analysis/SVals.cpp Mon Mar 30 16:27:41 2009
@@ -201,109 +201,6 @@
     return UndefinedVal();
 }
 
-NonLoc Loc::EQ(SymbolManager& SymMgr, const Loc& R) const {
-  
-  switch (getSubKind()) {
-    default:
-      assert(false && "EQ not implemented for this Loc.");
-      break;
-      
-    case loc::ConcreteIntKind:
-      if (isa<loc::ConcreteInt>(R)) {
-        bool b = cast<loc::ConcreteInt>(this)->getValue() ==
-                 cast<loc::ConcreteInt>(R).getValue();
-        
-        return NonLoc::MakeIntTruthVal(SymMgr.getBasicVals(), b);
-      }
-      else if (isa<loc::SymbolVal>(R)) {
-        const SymIntExpr *SE =
-          SymMgr.getSymIntExpr(cast<loc::SymbolVal>(R).getSymbol(),
-                               BinaryOperator::EQ,
-                               cast<loc::ConcreteInt>(this)->getValue(),
-                               SymMgr.getContext().IntTy);
-        
-        return nonloc::SymExprVal(SE);        
-      }
-      
-      break;
-      
-      case loc::SymbolValKind: {
-        if (isa<loc::ConcreteInt>(R)) {
-          const SymIntExpr *SE =
-            SymMgr.getSymIntExpr(cast<loc::SymbolVal>(this)->getSymbol(),
-                                 BinaryOperator::EQ,
-                                 cast<loc::ConcreteInt>(R).getValue(),
-                                 SymMgr.getContext().IntTy);
-          
-          return nonloc::SymExprVal(SE);
-        }
-                                 
-        assert (!isa<loc::SymbolVal>(R) && "FIXME: Implement unification.");        
-        break;
-      }
-      
-      case loc::MemRegionKind:
-      if (isa<loc::MemRegionVal>(R)) {        
-        bool b = cast<loc::MemRegionVal>(*this) == cast<loc::MemRegionVal>(R);
-        return NonLoc::MakeIntTruthVal(SymMgr.getBasicVals(), b);
-      }
-      
-      break;
-  }
-  
-  return NonLoc::MakeIntTruthVal(SymMgr.getBasicVals(), false);
-}
-
-NonLoc Loc::NE(SymbolManager& SymMgr, const Loc& R) const {
-  switch (getSubKind()) {
-    default:
-      assert(false && "NE not implemented for this Loc.");
-      break;
-      
-    case loc::ConcreteIntKind:
-      if (isa<loc::ConcreteInt>(R)) {
-        bool b = cast<loc::ConcreteInt>(this)->getValue() !=
-                 cast<loc::ConcreteInt>(R).getValue();
-        
-        return NonLoc::MakeIntTruthVal(SymMgr.getBasicVals(), b);
-      }
-      else if (isa<loc::SymbolVal>(R)) {
-        const SymIntExpr *SE =
-          SymMgr.getSymIntExpr(cast<loc::SymbolVal>(R).getSymbol(),
-                               BinaryOperator::NE,
-                               cast<loc::ConcreteInt>(this)->getValue(),
-                               SymMgr.getContext().IntTy);
-        return nonloc::SymExprVal(SE);
-      }
-      break;
-      
-      case loc::SymbolValKind: {
-        if (isa<loc::ConcreteInt>(R)) {
-          const SymIntExpr *SE =
-            SymMgr.getSymIntExpr(cast<loc::SymbolVal>(this)->getSymbol(),
-                                 BinaryOperator::NE,
-                                 cast<loc::ConcreteInt>(R).getValue(),
-                                 SymMgr.getContext().IntTy);
-          
-          return nonloc::SymExprVal(SE);
-        }
-        
-        assert (!isa<loc::SymbolVal>(R) && "FIXME: Implement sym !=.");
-        break;
-      }
-      
-      case loc::MemRegionKind:
-        if (isa<loc::MemRegionVal>(R)) {        
-          bool b = cast<loc::MemRegionVal>(*this)==cast<loc::MemRegionVal>(R);
-          return NonLoc::MakeIntTruthVal(SymMgr.getBasicVals(), b);
-        }
-      
-        break;
-  }
-  
-  return NonLoc::MakeIntTruthVal(SymMgr.getBasicVals(), true);
-}
-
 //===----------------------------------------------------------------------===//
 // Utility methods for constructing Non-Locs.
 //===----------------------------------------------------------------------===//





More information about the cfe-commits mailing list