diff options
Diffstat (limited to 'lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | lib/Analysis/LiveVariables.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 7b04beb2b5..4b181a954c 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -179,6 +179,9 @@ void TransferFuncs::VisitBinaryOperator(BinaryOperator* B) { void TransferFuncs::BlockStmt_VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) { + // This is a block-level expression. Its value is 'dead' before this point. + LiveState(S, AD) = Dead; + // This represents a 'use' of the collection. Visit(S->getCollection()); @@ -193,6 +196,10 @@ TransferFuncs::BlockStmt_VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) { Expr* ElemExpr = cast<Expr>(Element)->IgnoreParens(); if ((DR = dyn_cast<DeclRefExpr>(ElemExpr))) VD = cast<VarDecl>(DR->getDecl()); + else { + Visit(ElemExpr); + return; + } } if (VD) { |