[cfe-commits] r95534 - in /cfe/trunk: include/clang/Checker/PathSensitive/Store.h lib/Checker/BasicStore.cpp lib/Checker/RegionStore.cpp lib/Checker/Store.cpp

Zhongxing Xu xuzhongxing at gmail.com
Sun Feb 7 23:10:36 PST 2010


Author: zhongxingxu
Date: Mon Feb  8 01:10:35 2010
New Revision: 95534

URL: http://llvm.org/viewvc/llvm-project?rev=95534&view=rev
Log:
Move common methods to the base StoreManager class.

Modified:
    cfe/trunk/include/clang/Checker/PathSensitive/Store.h
    cfe/trunk/lib/Checker/BasicStore.cpp
    cfe/trunk/lib/Checker/RegionStore.cpp
    cfe/trunk/lib/Checker/Store.cpp

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

==============================================================================
--- cfe/trunk/include/clang/Checker/PathSensitive/Store.h (original)
+++ cfe/trunk/include/clang/Checker/PathSensitive/Store.h Mon Feb  8 01:10:35 2010
@@ -89,12 +89,18 @@
   //   caller's responsibility to 'delete' the returned map.
   virtual SubRegionMap *getSubRegionMap(Store store) = 0;
 
-  virtual SVal getLValueVar(const VarDecl *VD, const LocationContext *LC) = 0;
+  virtual SVal getLValueVar(const VarDecl *VD, const LocationContext *LC) {
+    return ValMgr.makeLoc(MRMgr.getVarRegion(VD, LC));
+  }
 
-  virtual SVal getLValueString(const StringLiteral* sl) = 0;
+  virtual SVal getLValueString(const StringLiteral* S) {
+    return ValMgr.makeLoc(MRMgr.getStringRegion(S));
+  }
 
-  SVal getLValueCompoundLiteral(const CompoundLiteralExpr* cl,
-                                const LocationContext *LC);
+  SVal getLValueCompoundLiteral(const CompoundLiteralExpr* CL,
+                                const LocationContext *LC) {
+    return loc::MemRegionVal(MRMgr.getCompoundLiteralRegion(CL, LC));
+  }
 
   virtual SVal getLValueIvar(const ObjCIvarDecl* decl, SVal base) = 0;
 

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

==============================================================================
--- cfe/trunk/lib/Checker/BasicStore.cpp (original)
+++ cfe/trunk/lib/Checker/BasicStore.cpp Mon Feb  8 01:10:35 2010
@@ -70,8 +70,6 @@
     return store;
   }
 
-  SVal getLValueVar(const VarDecl *VD, const LocationContext *LC);
-  SVal getLValueString(const StringLiteral *S);
   SVal getLValueIvar(const ObjCIvarDecl* D, SVal Base);
   SVal getLValueField(const FieldDecl *D, SVal Base);
   SVal getLValueElement(QualType elementType, SVal Offset, SVal Base);
@@ -115,15 +113,6 @@
   return new BasicStoreManager(StMgr);
 }
 
-SVal BasicStoreManager::getLValueVar(const VarDecl* VD, 
-                                     const LocationContext *LC) {
-  return ValMgr.makeLoc(MRMgr.getVarRegion(VD, LC));
-}
-
-SVal BasicStoreManager::getLValueString(const StringLiteral* S) {
-  return ValMgr.makeLoc(MRMgr.getStringRegion(S));
-}
-
 SVal BasicStoreManager::getLValueIvar(const ObjCIvarDecl* D, SVal Base) {
 
   if (Base.isUnknownOrUndef())

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

==============================================================================
--- cfe/trunk/lib/Checker/RegionStore.cpp (original)
+++ cfe/trunk/lib/Checker/RegionStore.cpp Mon Feb  8 01:10:35 2010
@@ -232,23 +232,6 @@
   ///  the value is not specified.  
   Store setImplicitDefaultValue(Store store, const MemRegion *R, QualType T);
 
-  /// getLValueString - Returns an SVal representing the lvalue of a
-  ///  StringLiteral.  Within RegionStore a StringLiteral has an
-  ///  associated StringRegion, and the lvalue of a StringLiteral is
-  ///  the lvalue of that region.
-  SVal getLValueString(const StringLiteral* S);
-
-  /// getLValueCompoundLiteral - Returns an SVal representing the
-  ///   lvalue of a compound literal.  Within RegionStore a compound
-  ///   literal has an associated region, and the lvalue of the
-  ///   compound literal is the lvalue of that region.
-  SVal getLValueCompoundLiteral(const CompoundLiteralExpr*);
-
-  /// getLValueVar - Returns an SVal that represents the lvalue of a
-  ///  variable.  Within RegionStore a variable has an associated
-  ///  VarRegion, and the lvalue of the variable is the lvalue of that region.
-  SVal getLValueVar(const VarDecl *VD, const LocationContext *LC);
-
   SVal getLValueIvar(const ObjCIvarDecl* D, SVal Base);
 
   SVal getLValueField(const FieldDecl* D, SVal Base);
@@ -680,22 +663,6 @@
 // getLValueXXX methods.
 //===----------------------------------------------------------------------===//
 
-/// getLValueString - Returns an SVal representing the lvalue of a
-///  StringLiteral.  Within RegionStore a StringLiteral has an
-///  associated StringRegion, and the lvalue of a StringLiteral is the
-///  lvalue of that region.
-SVal RegionStoreManager::getLValueString(const StringLiteral* S) {
-  return loc::MemRegionVal(MRMgr.getStringRegion(S));
-}
-
-/// getLValueVar - Returns an SVal that represents the lvalue of a
-///  variable.  Within RegionStore a variable has an associated
-///  VarRegion, and the lvalue of the variable is the lvalue of that region.
-SVal RegionStoreManager::getLValueVar(const VarDecl *VD, 
-                                      const LocationContext *LC) {
-  return loc::MemRegionVal(MRMgr.getVarRegion(VD, LC));
-}
-
 SVal RegionStoreManager::getLValueIvar(const ObjCIvarDecl* D, SVal Base) {
   return getLValueFieldOrIvar(D, Base);
 }

Modified: cfe/trunk/lib/Checker/Store.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/Store.cpp?rev=95534&r1=95533&r2=95534&view=diff

==============================================================================
--- cfe/trunk/lib/Checker/Store.cpp (original)
+++ cfe/trunk/lib/Checker/Store.cpp Mon Feb  8 01:10:35 2010
@@ -234,16 +234,3 @@
   
   return store;
 }
-
-//===----------------------------------------------------------------------===//
-// Common getLValueXXX methods.
-//===----------------------------------------------------------------------===//
-
-/// getLValueCompoundLiteral - Returns an SVal representing the lvalue
-///   of a compound literal.  Within RegionStore a compound literal
-///   has an associated region, and the lvalue of the compound literal
-///   is the lvalue of that region.
-SVal StoreManager::getLValueCompoundLiteral(const CompoundLiteralExpr* CL,
-                                            const LocationContext *LC) {
-  return loc::MemRegionVal(MRMgr.getCompoundLiteralRegion(CL, LC));
-}





More information about the cfe-commits mailing list