diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-04-20 05:24:46 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-04-20 05:24:46 +0000 |
commit | 369f447eded97e6048ced02c0c2be3842f61fc1c (patch) | |
tree | 54b9a91bb2c1d4438eaea591715cad10e09a1357 /include/clang/Analysis/PathSensitive/MemRegion.h | |
parent | 5c3074f3cd4c33e30c55e851a3ecf21ebec0769e (diff) |
get a CodeTextRegion when visiting FunctionDecl reference.
get FunctionDecl with more general utility method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/PathSensitive/MemRegion.h')
-rw-r--r-- | include/clang/Analysis/PathSensitive/MemRegion.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/clang/Analysis/PathSensitive/MemRegion.h b/include/clang/Analysis/PathSensitive/MemRegion.h index d9568b3eb1..3f287a0eb0 100644 --- a/include/clang/Analysis/PathSensitive/MemRegion.h +++ b/include/clang/Analysis/PathSensitive/MemRegion.h @@ -39,11 +39,11 @@ class MemRegionManager; class MemRegion : public llvm::FoldingSetNode { public: enum Kind { MemSpaceRegionKind, - CodeTextRegionKind, SymbolicRegionKind, AllocaRegionKind, // Typed regions. BEG_TYPED_REGIONS, + CodeTextRegionKind, CompoundLiteralRegionKind, StringRegionKind, ElementRegionKind, TypedViewRegionKind, @@ -215,6 +215,13 @@ public: QualType getLValueType(ASTContext &C) const { return LocationType; } + + bool isDeclared() const { return codekind == Declared; } + + const FunctionDecl* getDecl() const { + assert(codekind == Declared); + return static_cast<const FunctionDecl*>(Data); + } virtual bool isBoundable(ASTContext&) const { return false; } |