summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-11-12 21:11:49 +0000
committerTed Kremenek <kremenek@apple.com>2008-11-12 21:11:49 +0000
commit6d8b46e71dba895529004c1edeb9976e3aea5b23 (patch)
treeb61726d207321724f35d302ca60a73aa72734fae /clang
parent0c6b786ab25ee402da24893c0c3f5923bf947c16 (diff)
downloadbcm5719-llvm-6d8b46e71dba895529004c1edeb9976e3aea5b23.tar.gz
bcm5719-llvm-6d8b46e71dba895529004c1edeb9976e3aea5b23.zip
ObjCForCollectionStmts are block-level expressions.
llvm-svn: 59160
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/AST/CFG.h4
-rw-r--r--clang/lib/AST/CFG.cpp13
2 files changed, 10 insertions, 7 deletions
diff --git a/clang/include/clang/AST/CFG.h b/clang/include/clang/AST/CFG.h
index 2f3183c5335..0b179f9edfe 100644
--- a/clang/include/clang/AST/CFG.h
+++ b/clang/include/clang/AST/CFG.h
@@ -153,9 +153,9 @@ public:
Stmt* getTerminator() { return Terminator; }
const Stmt* getTerminator() const { return Terminator; }
- Expr* getTerminatorCondition();
+ Stmt* getTerminatorCondition();
- const Expr* getTerminatorCondition() const {
+ const Stmt* getTerminatorCondition() const {
return const_cast<CFGBlock*>(this)->getTerminatorCondition();
}
diff --git a/clang/lib/AST/CFG.cpp b/clang/lib/AST/CFG.cpp
index 95e188269e1..4b7085a03db 100644
--- a/clang/lib/AST/CFG.cpp
+++ b/clang/lib/AST/CFG.cpp
@@ -1259,11 +1259,11 @@ static BlkExprMapTy* PopulateBlkExprMap(CFG& cfg) {
// 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 @@ void CFGBlock::printTerminator(llvm::raw_ostream& OS) const {
TPrinter.Visit(const_cast<Stmt*>(getTerminator()));
}
-Expr* CFGBlock::getTerminatorCondition() {
+Stmt* CFGBlock::getTerminatorCondition() {
if (!Terminator)
return NULL;
@@ -1653,7 +1653,10 @@ Expr* CFGBlock::getTerminatorCondition() {
case Stmt::BinaryOperatorClass: // '&&' and '||'
E = cast<BinaryOperator>(Terminator)->getLHS();
- break;
+ break;
+
+ case Stmt::ObjCForCollectionStmtClass:
+ return Terminator;
}
return E ? E->IgnoreParens() : NULL;
OpenPOWER on IntegriCloud