aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Analysis/AnalysisDeclContext.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-03-10 09:33:50 +0000
committerJohn McCall <rjmccall@apple.com>2012-03-10 09:33:50 +0000
commit113bee05361d648adb51edd0e2ec281432d2009f (patch)
treed5af8b7b0a95c04343a9f2e8f7fe40e8c769b656 /clang/lib/Analysis/AnalysisDeclContext.cpp
parent97f6f03c42f32a5edf59a27b56940f68c89d146b (diff)
downloadllvm-113bee05361d648adb51edd0e2ec281432d2009f.zip
llvm-113bee05361d648adb51edd0e2ec281432d2009f.tar.gz
llvm-113bee05361d648adb51edd0e2ec281432d2009f.tar.bz2
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. llvm-svn: 152491
Diffstat (limited to 'clang/lib/Analysis/AnalysisDeclContext.cpp')
-rw-r--r--clang/lib/Analysis/AnalysisDeclContext.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/clang/lib/Analysis/AnalysisDeclContext.cpp b/clang/lib/Analysis/AnalysisDeclContext.cpp
index cbb08fd..1020898 100644
--- a/clang/lib/Analysis/AnalysisDeclContext.cpp
+++ b/clang/lib/Analysis/AnalysisDeclContext.cpp
@@ -362,20 +362,16 @@ public:
flag = 1;
BEVals.push_back(VD, BC);
}
+ } else if (DR->refersToEnclosingLocal()) {
+ unsigned &flag = Visited[VD];
+ if (!flag) {
+ flag = 1;
+ if (IsTrackedDecl(VD))
+ BEVals.push_back(VD, BC);
+ }
}
}
- void VisitBlockDeclRefExpr(BlockDeclRefExpr *DR) {
- if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) {
- unsigned &flag = Visited[VD];
- if (!flag) {
- flag = 1;
- if (IsTrackedDecl(VD))
- BEVals.push_back(VD, BC);
- }
- }
- }
-
void VisitBlockExpr(BlockExpr *BR) {
// Blocks containing blocks can transitively capture more variables.
IgnoredContexts.insert(BR->getBlockDecl());