diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-12-07 22:05:27 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-12-07 22:05:27 +0000 |
commit | 04af9f20fba8de19ddf6f660f41df176dcd0b252 (patch) | |
tree | ac469ae3b59fe8b13c9867656fbd4d64f1553aa0 /clang/lib/Analysis/ValueManager.cpp | |
parent | 54ad1ab56f8047b7a5cc37825ca8bc39906dc183 (diff) | |
download | bcm5719-llvm-04af9f20fba8de19ddf6f660f41df176dcd0b252.tar.gz bcm5719-llvm-04af9f20fba8de19ddf6f660f41df176dcd0b252.zip |
Add analysis support for blocks. This includes a few key changes:
- Refactor the MemRegion hierarchy to distinguish between different StackSpaceRegions for locals and parameters.
- VarRegions for "captured" variables now have the BlockDataRegion as their super region (except those passed by reference)
- Add transfer function support to GRExprEngine for BlockDeclRefExprs.
This change also supports analyzing blocks as an analysis entry point
(top-of-the-stack), which required pushing more context-sensitivity
around in the MemRegion hierarchy via the use of LocationContext
objects. Functionally almost everything is the same, except we track
LocationContexts in a few more areas and StackSpaceRegions now refer
to a StackFrameContext object. In the future we will need to modify
MemRegionManager to allow multiple StackSpaceRegions in flight at once
(for the analysis of multiple stack frames).
llvm-svn: 90809
Diffstat (limited to 'clang/lib/Analysis/ValueManager.cpp')
-rw-r--r-- | clang/lib/Analysis/ValueManager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Analysis/ValueManager.cpp b/clang/lib/Analysis/ValueManager.cpp index 1e7a5fced0a..d09137330cb 100644 --- a/clang/lib/Analysis/ValueManager.cpp +++ b/clang/lib/Analysis/ValueManager.cpp @@ -14,6 +14,7 @@ //===----------------------------------------------------------------------===// #include "clang/Analysis/PathSensitive/ValueManager.h" +#include "clang/Analysis/PathSensitive/AnalysisContext.h" using namespace clang; using namespace llvm; @@ -144,7 +145,8 @@ DefinedSVal ValueManager::getFunctionPointer(const FunctionDecl* FD) { DefinedSVal ValueManager::getBlockPointer(const BlockDecl *D, CanQualType locTy, const LocationContext *LC) { - const BlockTextRegion *BC = MemMgr.getBlockTextRegion(D, locTy); + const BlockTextRegion *BC = + MemMgr.getBlockTextRegion(D, locTy, LC->getAnalysisContext()); const BlockDataRegion *BD = MemMgr.getBlockDataRegion(BC, LC); return loc::MemRegionVal(BD); } |