]> granicus.if.org Git - clang/commitdiff
We return Loc where we know.
authorZhongxing Xu <xuzhongxing@gmail.com>
Wed, 16 Jun 2010 06:16:46 +0000 (06:16 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Wed, 16 Jun 2010 06:16:46 +0000 (06:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106087 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Checker/PathSensitive/GRState.h
include/clang/Checker/PathSensitive/Store.h
lib/Checker/StackAddrLeakChecker.cpp

index 624058e6e4b833025458d64509002c5b20750965..a872edc064326c49e8f25300f315376ebb485b11 100644 (file)
@@ -216,13 +216,13 @@ public:
   const GRState *unbindLoc(Loc LV) const;
 
   /// Get the lvalue for a variable reference.
-  SVal getLValue(const VarDecl *D, const LocationContext *LC) const;
+  Loc getLValue(const VarDecl *D, const LocationContext *LC) const;
 
   /// Get the lvalue for a StringLiteral.
-  SVal getLValue(const StringLiteral *literal) const;
+  Loc getLValue(const StringLiteral *literal) const;
 
-  SVal getLValue(const CompoundLiteralExpr *literal,
-                 const LocationContext *LC) const;
+  Loc getLValue(const CompoundLiteralExpr *literal, 
+                const LocationContext *LC) const;
 
   /// Get the lvalue for an ivar reference.
   SVal getLValue(const ObjCIvarDecl *decl, SVal base) const;
@@ -628,16 +628,16 @@ inline const GRState *GRState::bindDefault(SVal loc, SVal V) const {
   return makeWithStore(new_store);
 }
 
-inline SVal GRState::getLValue(const VarDecl* VD,
+inline Loc GRState::getLValue(const VarDecl* VD,
                                const LocationContext *LC) const {
   return getStateManager().StoreMgr->getLValueVar(VD, LC);
 }
 
-inline SVal GRState::getLValue(const StringLiteral *literal) const {
+inline Loc GRState::getLValue(const StringLiteral *literal) const {
   return getStateManager().StoreMgr->getLValueString(literal);
 }
 
-inline SVal GRState::getLValue(const CompoundLiteralExpr *literal,
+inline Loc GRState::getLValue(const CompoundLiteralExpr *literal,
                                const LocationContext *LC) const {
   return getStateManager().StoreMgr->getLValueCompoundLiteral(literal, LC);
 }
index 030f5401f33bdf3abdaa1fe4ba343579bc546039..87a8314041d7d123f505229edd434aa33e7a497e 100644 (file)
@@ -91,16 +91,16 @@ public:
   //   caller's responsibility to 'delete' the returned map.
   virtual SubRegionMap *getSubRegionMap(Store store) = 0;
 
-  virtual SVal getLValueVar(const VarDecl *VD, const LocationContext *LC) {
+  virtual Loc getLValueVar(const VarDecl *VD, const LocationContext *LC) {
     return ValMgr.makeLoc(MRMgr.getVarRegion(VD, LC));
   }
 
-  virtual SVal getLValueString(const StringLiteral* S) {
+  virtual Loc getLValueString(const StringLiteral* S) {
     return ValMgr.makeLoc(MRMgr.getStringRegion(S));
   }
 
-  SVal getLValueCompoundLiteral(const CompoundLiteralExpr* CL,
-                                const LocationContext *LC) {
+  Loc getLValueCompoundLiteral(const CompoundLiteralExpr* CL,
+                               const LocationContext *LC) {
     return loc::MemRegionVal(MRMgr.getCompoundLiteralRegion(CL, LC));
   }
 
index 5e6058ddc2e2c12a6f7b2b828596e40d98294231..ae410ed27d230b52fcead176081b7f330dec711e 100644 (file)
@@ -133,8 +133,8 @@ void StackAddrLeakChecker::EvalEndPath(GREndPathNodeBuilder &B, void *tag,
        I != E; ++I) {
     if (VarDecl *VD = dyn_cast<VarDecl>(*I)) {
       const LocationContext *LCtx = B.getPredecessor()->getLocationContext();
-      SVal L = state->getLValue(VD, LCtx);
-      SVal V = state->getSVal(cast<Loc>(L));
+      Loc L = state->getLValue(VD, LCtx);
+      SVal V = state->getSVal(L);
       if (loc::MemRegionVal *RV = dyn_cast<loc::MemRegionVal>(&V)) {
         const MemRegion *R = RV->getRegion();