Fixed DeclStmt::child_begin() to actually create an iterator that
visits its decls, rather than just creating an "end()" iterator.

Fixed child_end() for statements and expressions to use
child_iterator() to create the end() iterator, rather than just
returning NULL.

Fixed bug in StmtIterator where we did not correctly detect if we had
marched off the end of the ScopedDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43156 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtIterator.cpp b/AST/StmtIterator.cpp
index d618db8..b7a03bb 100644
--- a/AST/StmtIterator.cpp
+++ b/AST/StmtIterator.cpp
@@ -22,6 +22,8 @@
 
   do Ptr.D = Ptr.D->getNextDeclarator();
   while (Ptr.D != NULL && !isa<VarDecl>(Ptr.D));
+  
+  if (Ptr.D == NULL) FirstDecl = NULL;
 }
 
 StmtIteratorBase::StmtIteratorBase(ScopedDecl* d) {