ObjCForCollectionStmts are block-level expressions.

llvm-svn: 59160
This commit is contained in:
Ted Kremenek 2008-11-12 21:11:49 +00:00
parent 0c6b786ab2
commit 6d8b46e71d
2 changed files with 10 additions and 7 deletions

View File

@ -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();
}

View File

@ -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;