diff options
| author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-06-16 06:16:46 +0000 |
|---|---|---|
| committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-06-16 06:16:46 +0000 |
| commit | abd60dd1fc2c4b6d02fdd54a6f749c872c0b041b (patch) | |
| tree | e6ff2477bad799a8d3a0e7c46674b571059b29d7 /clang | |
| parent | 7880db8a8917eab01ab9c80fe3ef2deecd4a93f2 (diff) | |
| download | bcm5719-llvm-abd60dd1fc2c4b6d02fdd54a6f749c872c0b041b.tar.gz bcm5719-llvm-abd60dd1fc2c4b6d02fdd54a6f749c872c0b041b.zip | |
We return Loc where we know.
llvm-svn: 106087
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Checker/PathSensitive/GRState.h | 14 | ||||
| -rw-r--r-- | clang/include/clang/Checker/PathSensitive/Store.h | 8 | ||||
| -rw-r--r-- | clang/lib/Checker/StackAddrLeakChecker.cpp | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/clang/include/clang/Checker/PathSensitive/GRState.h b/clang/include/clang/Checker/PathSensitive/GRState.h index 624058e6e4b..a872edc0643 100644 --- a/clang/include/clang/Checker/PathSensitive/GRState.h +++ b/clang/include/clang/Checker/PathSensitive/GRState.h @@ -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); } diff --git a/clang/include/clang/Checker/PathSensitive/Store.h b/clang/include/clang/Checker/PathSensitive/Store.h index 030f5401f33..87a8314041d 100644 --- a/clang/include/clang/Checker/PathSensitive/Store.h +++ b/clang/include/clang/Checker/PathSensitive/Store.h @@ -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)); } diff --git a/clang/lib/Checker/StackAddrLeakChecker.cpp b/clang/lib/Checker/StackAddrLeakChecker.cpp index 5e6058ddc2e..ae410ed27d2 100644 --- a/clang/lib/Checker/StackAddrLeakChecker.cpp +++ b/clang/lib/Checker/StackAddrLeakChecker.cpp @@ -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(); |

