diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-12-09 00:14:14 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-12-09 00:14:14 +0000 |
commit | e0dbda136444b2f3550a421f4436d438230c732f (patch) | |
tree | a5f969951743ba0a1dddcc50819cc1b116b0b8e7 /include/clang/Analysis/Support/BlkExprDeclBitVector.h | |
parent | 447d7aeb9499d7ade42be7d63fa03b37b1d2fc09 (diff) |
Fixed LiveVariables bug where we didn't consider block-level expressions that functioned as the size of a VLA to be live.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/Support/BlkExprDeclBitVector.h')
-rw-r--r-- | include/clang/Analysis/Support/BlkExprDeclBitVector.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/clang/Analysis/Support/BlkExprDeclBitVector.h b/include/clang/Analysis/Support/BlkExprDeclBitVector.h index 00513a5aed..675e3548b2 100644 --- a/include/clang/Analysis/Support/BlkExprDeclBitVector.h +++ b/include/clang/Analysis/Support/BlkExprDeclBitVector.h @@ -25,6 +25,7 @@ namespace clang { class Stmt; + class ASTContext; struct DeclBitVector_Types { @@ -170,12 +171,19 @@ struct StmtDeclBitVector_Types { //===--------------------------------------------------------------------===// class AnalysisDataTy : public DeclBitVector_Types::AnalysisDataTy { + ASTContext* ctx; CFG* cfg; public: - AnalysisDataTy() {} + AnalysisDataTy() : ctx(0), cfg(0) {} virtual ~AnalysisDataTy() {} - void setCFG(CFG* c) { cfg = c; } + void setContext(ASTContext& c) { ctx = &c; } + ASTContext& getContext() { + assert(ctx && "ASTContext should not be NULL."); + return *ctx; + } + + void setCFG(CFG& c) { cfg = &c; } CFG& getCFG() { assert(cfg && "CFG should not be NULL."); return *cfg; } bool isTracked(const Stmt* S) { return cfg->isBlkExpr(S); } |