]> granicus.if.org Git - clang/commitdiff
ObjCForCollectionStmts are block-level expressions.
authorTed Kremenek <kremenek@apple.com>
Wed, 12 Nov 2008 21:11:49 +0000 (21:11 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 12 Nov 2008 21:11:49 +0000 (21:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59160 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/CFG.h
lib/AST/CFG.cpp

index 2f3183c53359f3f05b9bd87b77f03f6df508e2df..0b179f9edfeffacd40ce6c9b615d87f8effa6fd0 100644 (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();
   }
   
index 95e188269e1496ef257e1d22c7ab9ffc368caa20..4b7085a03dbeec0742eb71fc08e0a8462c20bb90 100644 (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;