diff options
author | John McCall <rjmccall@apple.com> | 2012-03-10 09:33:50 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-03-10 09:33:50 +0000 |
commit | f4b88a45902af1802a1cb42ba48b1c474474f228 (patch) | |
tree | 7f613834b56ecad44c6a1a99d69d2230a034e7b6 /lib/StaticAnalyzer/Checkers | |
parent | 1659c3758b4b2dbd618aed9ff8d1863f11b1bd9b (diff) |
Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context. I'm amenable to suggestions about the exact meaning
of this bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp | 1 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp | 8 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp b/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp index df47b04e37..c08f163a1f 100644 --- a/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp @@ -650,7 +650,6 @@ bool IdempotentOperationChecker::CanVary(const Expr *Ex, case Stmt::InitListExprClass: case Stmt::DesignatedInitExprClass: case Stmt::BlockExprClass: - case Stmt::BlockDeclRefExprClass: return false; // Cases requiring custom logic diff --git a/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp b/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp index 8a46035fee..d57767eec9 100644 --- a/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp @@ -33,16 +33,16 @@ public: }; } // end anonymous namespace -static const BlockDeclRefExpr *FindBlockDeclRefExpr(const Stmt *S, - const VarDecl *VD){ - if (const BlockDeclRefExpr *BR = dyn_cast<BlockDeclRefExpr>(S)) +static const DeclRefExpr *FindBlockDeclRefExpr(const Stmt *S, + const VarDecl *VD) { + if (const DeclRefExpr *BR = dyn_cast<DeclRefExpr>(S)) if (BR->getDecl() == VD) return BR; for (Stmt::const_child_iterator I = S->child_begin(), E = S->child_end(); I!=E; ++I) if (const Stmt *child = *I) { - const BlockDeclRefExpr *BR = FindBlockDeclRefExpr(child, VD); + const DeclRefExpr *BR = FindBlockDeclRefExpr(child, VD); if (BR) return BR; } |