diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-11-25 23:53:07 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-11-25 23:53:07 +0000 |
commit | 0a8112a78d00b5140c5b7f16c3b34c2c0c13c1a0 (patch) | |
tree | 5184e8fe0c1fca393801801e1b7a7ee0da01e951 /lib/Analysis/ValueManager.cpp | |
parent | a44a59092cab406c844976be9cd19c630f7f0feb (diff) |
Refine MemRegions for blocks. Add a new region called
'BlockDataRegion' to distinguish between the code associated with a
block (which is represented by 'BlockTextRegion') and an instance of a
block, which includes both code and data. 'BlockDataRegion' has an
associated LocationContext, which can be used to eventually model the
lifetime of a block object once LocationContexts can represent scopes
(and iterations around a loop, etc.).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ValueManager.cpp')
-rw-r--r-- | lib/Analysis/ValueManager.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Analysis/ValueManager.cpp b/lib/Analysis/ValueManager.cpp index 37df443602..22a821149d 100644 --- a/lib/Analysis/ValueManager.cpp +++ b/lib/Analysis/ValueManager.cpp @@ -142,9 +142,11 @@ DefinedSVal ValueManager::getFunctionPointer(const FunctionDecl* FD) { return loc::MemRegionVal(R); } -DefinedSVal ValueManager::getBlockPointer(const BlockDecl *BD, - CanQualType locTy) { - CodeTextRegion *R = MemMgr.getBlockTextRegion(BD, locTy); - return loc::MemRegionVal(R); +DefinedSVal ValueManager::getBlockPointer(const BlockDecl *D, + CanQualType locTy, + const LocationContext *LC) { + BlockTextRegion *BC = MemMgr.getBlockTextRegion(D, locTy); + BlockDataRegion *BD = MemMgr.getBlockDataRegion(BC, LC); + return loc::MemRegionVal(BD); } |