[cfe-commits] r59160 - in /cfe/trunk: include/clang/AST/CFG.h lib/AST/CFG.cpp
Ted Kremenek
kremenek at apple.com
Wed Nov 12 13:12:05 PST 2008
Author: kremenek
Date: Wed Nov 12 15:11:49 2008
New Revision: 59160
URL: http://llvm.org/viewvc/llvm-project?rev=59160&view=rev
Log:
ObjCForCollectionStmts are block-level expressions.
Modified:
cfe/trunk/include/clang/AST/CFG.h
cfe/trunk/lib/AST/CFG.cpp
Modified: cfe/trunk/include/clang/AST/CFG.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CFG.h?rev=59160&r1=59159&r2=59160&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/CFG.h (original)
+++ cfe/trunk/include/clang/AST/CFG.h Wed Nov 12 15:11:49 2008
@@ -153,9 +153,9 @@
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();
}
Modified: cfe/trunk/lib/AST/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CFG.cpp?rev=59160&r1=59159&r2=59160&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CFG.cpp (original)
+++ cfe/trunk/lib/AST/CFG.cpp Wed Nov 12 15:11:49 2008
@@ -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;
More information about the cfe-commits
mailing list