]> granicus.if.org Git - clang/commitdiff
A little more tweaking with StmtIterator and SizeOfAlignofExpr. A recent commit...
authorTed Kremenek <kremenek@apple.com>
Tue, 7 Oct 2008 23:35:42 +0000 (23:35 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 7 Oct 2008 23:35:42 +0000 (23:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57282 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Expr.cpp
lib/AST/StmtIterator.cpp

index 78d83d85081c5e550c8df15277b91dae0133308e..6cdaacd6897903b935a2b199de83486a56ac11c5 100644 (file)
@@ -1264,10 +1264,10 @@ Stmt::child_iterator SizeOfAlignOfTypeExpr::child_begin() {
   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
index 1b0e9d57c06a303e52d26b9153358cedd55e9982..46882422e1ccfdc1e9cb688ace609378bca4d56d 100644 (file)
@@ -35,22 +35,25 @@ void StmtIteratorBase::NextVA() {
   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;
   }