ObjCForCollectionStmts are block-level expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59160 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/CFG.cpp b/lib/AST/CFG.cpp
index 95e1882..4b7085a 100644
--- a/lib/AST/CFG.cpp
+++ b/lib/AST/CFG.cpp
@@ -1259,11 +1259,11 @@
// Look at terminators. The condition is a block-level expression.
- Expr* Exp = I->getTerminatorCondition();
+ Stmt* S = I->getTerminatorCondition();
- if (Exp && M->find(Exp) == M->end()) {
+ if (S && M->find(S) == M->end()) {
unsigned x = M->size();
- (*M)[Exp] = x;
+ (*M)[S] = x;
}
}
@@ -1608,7 +1608,7 @@
TPrinter.Visit(const_cast<Stmt*>(getTerminator()));
}
-Expr* CFGBlock::getTerminatorCondition() {
+Stmt* CFGBlock::getTerminatorCondition() {
if (!Terminator)
return NULL;
@@ -1653,7 +1653,10 @@
case Stmt::BinaryOperatorClass: // '&&' and '||'
E = cast<BinaryOperator>(Terminator)->getLHS();
- break;
+ break;
+
+ case Stmt::ObjCForCollectionStmtClass:
+ return Terminator;
}
return E ? E->IgnoreParens() : NULL;