Fixed broken build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43132 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtIterator.cpp b/AST/StmtIterator.cpp
index aca1f81..16d8223 100644
--- a/AST/StmtIterator.cpp
+++ b/AST/StmtIterator.cpp
@@ -17,8 +17,31 @@
using namespace clang;
-void StmtIterator::NextDecl() { assert(false); }
-void StmtIterator::PrevDecl() { assert(false); }
+void StmtIterator::NextDecl() {
+ assert (D);
+ do D = D->getNextDeclarator();
+ while (D != NULL && !isa<VarDecl>(D));
+
+ if (!D) S = NULL;
+}
+
+void StmtIterator::PrevDecl() {
+ assert (isa<DeclStmt>(*S));
+ DeclStmt* DS = cast<DeclStmt>(*S);
+
+ ScopedDecl* d = DS->getDecl();
+ assert (d);
+
+ if (d == D) { assert(false) ; return; }
+
+ // March through the list of decls until we find the decl just before
+ // the one we currently point
+
+ while (d->getNextDeclarator() != D)
+ d = d->getNextDeclarator();
+
+ D = d;
+}
Stmt*& StmtIterator::GetInitializer() const {
assert (D && isa<VarDecl>(D));