aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LiveVariables.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-12-22 01:30:46 +0000
committerTed Kremenek <kremenek@apple.com>2011-12-22 01:30:46 +0000
commit15ce164836472bfba88b30e53aa3f6ac0fb8a95d (patch)
tree3260a62044a3b2309f779bb92ea6048226cc66fb /lib/Analysis/LiveVariables.cpp
parent974c5f93d0ce4f0699a6f0a4402f6b367da495e3 (diff)
Enhance AnalysisDeclContext::getReferencedBlockVars() to understand PseudoObjExprs. It turns out
that the information collected by this method is a super set of the captured variables in BlockDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVariables.cpp')
-rw-r--r--lib/Analysis/LiveVariables.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp
index 89cf9f8bbb..ff6607d51a 100644
--- a/lib/Analysis/LiveVariables.cpp
+++ b/lib/Analysis/LiveVariables.cpp
@@ -354,10 +354,11 @@ void TransferFunctions::VisitBinaryOperator(BinaryOperator *B) {
}
void TransferFunctions::VisitBlockExpr(BlockExpr *BE) {
- const BlockDecl *BD = BE->getBlockDecl();
- for (BlockDecl::capture_const_iterator it = BD->capture_begin(),
- ei = BD->capture_end(); it != ei; ++it) {
- const VarDecl *VD = it->getVariable();
+ AnalysisDeclContext::referenced_decls_iterator I, E;
+ llvm::tie(I, E) =
+ LV.analysisContext.getReferencedBlockVars(BE->getBlockDecl());
+ for ( ; I != E ; ++I) {
+ const VarDecl *VD = *I;
if (isAlwaysAlive(VD))
continue;
val.liveDecls = LV.DSetFact.add(val.liveDecls, VD);