[cfe-commits] r57282 - in /cfe/trunk/lib/AST: Expr.cpp StmtIterator.cpp

Ted Kremenek kremenek at apple.com
Tue Oct 7 16:35:42 PDT 2008


Author: kremenek
Date: Tue Oct  7 18:35:42 2008
New Revision: 57282

URL: http://llvm.org/viewvc/llvm-project?rev=57282&view=rev
Log:
A little more tweaking with StmtIterator and SizeOfAlignofExpr.  A recent commit actually introduced a regression, not fixed a bug.

Modified:
    cfe/trunk/lib/AST/Expr.cpp
    cfe/trunk/lib/AST/StmtIterator.cpp

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=57282&r1=57281&r2=57282&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Tue Oct  7 18:35:42 2008
@@ -1264,10 +1264,10 @@
   if (VariableArrayType* T = dyn_cast<VariableArrayType>(Ty.getTypePtr()))
     return child_iterator(T);
   else
-    return child_iterator((VariableArrayType*)0); 
+    return child_iterator(); 
 }
 Stmt::child_iterator SizeOfAlignOfTypeExpr::child_end() {
-  return child_iterator((VariableArrayType*)0); 
+  return child_iterator(); 
 }
 
 // ArraySubscriptExpr

Modified: cfe/trunk/lib/AST/StmtIterator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtIterator.cpp?rev=57282&r1=57281&r2=57282&view=diff

==============================================================================
--- cfe/trunk/lib/AST/StmtIterator.cpp (original)
+++ cfe/trunk/lib/AST/StmtIterator.cpp Tue Oct  7 18:35:42 2008
@@ -35,22 +35,25 @@
   p = FindVA(p->getElementType().getTypePtr());
   setVAPtr(p);
 
-  if (!p) {
-    if (inDecl()) {
-      if (VarDecl* VD = dyn_cast<VarDecl>(decl)) 
-        if (VD->Init)
-          return;
-      
-      NextDecl();
-    }
-    else if (inDeclGroup()) {
-      if (VarDecl* VD = dyn_cast<VarDecl>(*DGI)) 
-        if (VD->Init)
-          return;
-      
-      NextDecl();  
-    }
-  } else if (inSizeOfTypeVA()) {
+  if (p)
+    return;
+  
+  if (inDecl()) {
+    if (VarDecl* VD = dyn_cast<VarDecl>(decl)) 
+      if (VD->Init)
+        return;
+    
+    NextDecl();
+  }
+  else if (inDeclGroup()) {
+    if (VarDecl* VD = dyn_cast<VarDecl>(*DGI)) 
+      if (VD->Init)
+        return;
+    
+    NextDecl();  
+  }
+  else {
+    assert (inSizeOfTypeVA());
     assert(!decl);
     RawVAPtr = 0;
   }





More information about the cfe-commits mailing list