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 | b63ad7a6c1bb28a3a9aaecde44f8f5fe5097b98d (patch) | |
tree | 5fd808e50e9d02754945485fe0bf2ac94806c9d8 /clang/lib/Analysis/ValueManager.cpp | |
parent | 979ac9fce425fa9266512f24641cf73abf2a3d76 (diff) | |
download | bcm5719-llvm-b63ad7a6c1bb28a3a9aaecde44f8f5fe5097b98d.tar.gz bcm5719-llvm-b63ad7a6c1bb28a3a9aaecde44f8f5fe5097b98d.zip |
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.).
llvm-svn: 89900
Diffstat (limited to 'clang/lib/Analysis/ValueManager.cpp')
-rw-r--r-- | clang/lib/Analysis/ValueManager.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Analysis/ValueManager.cpp b/clang/lib/Analysis/ValueManager.cpp index 37df4436022..22a821149db 100644 --- a/clang/lib/Analysis/ValueManager.cpp +++ b/clang/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); } |