diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-08-21 22:28:32 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-08-21 22:28:32 +0000 |
commit | 14536f6ee01a9c0381d1e905c43a8b714ddfb030 (patch) | |
tree | f4058d96c5a49f263d48a811ed03e557b0ccd6a0 /clang/lib/Analysis/RegionStore.cpp | |
parent | 25e8e363dff82a06e0b9a19c33baf3ae3f2613e6 (diff) | |
download | bcm5719-llvm-14536f6ee01a9c0381d1e905c43a8b714ddfb030.tar.gz bcm5719-llvm-14536f6ee01a9c0381d1e905c43a8b714ddfb030.zip |
Add LocationContext* field to VarRegion. This is needed for interprocedural analysis.
llvm-svn: 79680
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
-rw-r--r-- | clang/lib/Analysis/RegionStore.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index 518978cfb13..13768eca8ca 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/lib/Analysis/RegionStore.cpp @@ -204,7 +204,8 @@ public: /// 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 GRState *state, const VarDecl* VD); + SVal getLValueVar(const GRState *ST, const VarDecl *VD, + const LocationContext *LC); SVal getLValueIvar(const GRState *state, const ObjCIvarDecl* D, SVal Base); @@ -243,7 +244,7 @@ public: if (MD->getSelfDecl() == PD) { SelfRegion = MRMgr.getObjCObjectRegion(MD->getClassInterface(), MRMgr.getHeapRegion()); - B = RBFactory.Add(B, MRMgr.getVarRegion(PD), + B = RBFactory.Add(B, MRMgr.getVarRegion(PD, InitLoc), ValMgr.makeLoc(SelfRegion)); } } @@ -280,9 +281,11 @@ public: const GRState *BindCompoundLiteral(const GRState *state, const CompoundLiteralExpr* CL, SVal V); - const GRState *BindDecl(const GRState *state, const VarDecl* VD, SVal InitVal); + const GRState *BindDecl(const GRState *ST, const VarDecl *VD, + const LocationContext *LC, SVal InitVal); - const GRState *BindDeclWithNoInit(const GRState *state, const VarDecl* VD) { + const GRState *BindDeclWithNoInit(const GRState *state, const VarDecl*, + const LocationContext *) { return state; } @@ -547,8 +550,9 @@ SVal RegionStoreManager::getLValueString(const GRState *St, /// 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 GRState *St, const VarDecl* VD) { - return loc::MemRegionVal(MRMgr.getVarRegion(VD)); +SVal RegionStoreManager::getLValueVar(const GRState *ST, const VarDecl *VD, + const LocationContext *LC) { + return loc::MemRegionVal(MRMgr.getVarRegion(VD, LC)); } /// getLValueCompoundLiteral - Returns an SVal representing the lvalue @@ -1345,18 +1349,20 @@ const GRState *RegionStoreManager::Bind(const GRState *state, Loc L, SVal V) { return state->makeWithStore(RBFactory.Add(B, R, V).getRoot()); } -const GRState *RegionStoreManager::BindDecl(const GRState *state, - const VarDecl* VD, SVal InitVal) { +const GRState *RegionStoreManager::BindDecl(const GRState *ST, + const VarDecl *VD, + const LocationContext *LC, + SVal InitVal) { QualType T = VD->getType(); - VarRegion* VR = MRMgr.getVarRegion(VD); + VarRegion* VR = MRMgr.getVarRegion(VD, LC); if (T->isArrayType()) - return BindArray(state, VR, InitVal); + return BindArray(ST, VR, InitVal); if (T->isStructureType()) - return BindStruct(state, VR, InitVal); + return BindStruct(ST, VR, InitVal); - return Bind(state, ValMgr.makeLoc(VR), InitVal); + return Bind(ST, ValMgr.makeLoc(VR), InitVal); } // FIXME: this method should be merged into Bind(). |