From: Ted Kremenek Date: Thu, 18 Oct 2007 16:25:40 +0000 (+0000) Subject: Fixed broken build. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7c326ad0c407dbd2a406de0f961283a790f8725;p=clang 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 aca1f81095..16d8223a06 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(D)); + + if (!D) S = NULL; +} + +void StmtIterator::PrevDecl() { + assert (isa(*S)); + DeclStmt* DS = cast(*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(D));