From 12563b8111dcc8b47a5821c5e21ac1f01e93a8b8 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 14 Jul 2009 03:20:31 +0000 Subject: Handle redeclarations properly at the index-test tool. llvm-svn: 75605 --- clang/tools/index-test/index-test.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'clang/tools/index-test/index-test.cpp') diff --git a/clang/tools/index-test/index-test.cpp b/clang/tools/index-test/index-test.cpp index 63c86aac464..a188cd103ed 100644 --- a/clang/tools/index-test/index-test.cpp +++ b/clang/tools/index-test/index-test.cpp @@ -134,15 +134,13 @@ static void ProcessDecl(Decl *D) { case PrintDecls : if (const FunctionDecl *FD = dyn_cast(D)) { - while (FD) { - ASTLocation(FD).print(OS); - FD = FD->getPreviousDeclaration(); - } + for (FunctionDecl::redecl_iterator I = FD->redecls_begin(), + E = FD->redecls_end(); I != E; ++I) + ASTLocation(*I).print(OS); } else if (const VarDecl *VD = dyn_cast(D)) { - while (VD) { - ASTLocation(VD).print(OS); - VD = VD->getPreviousDeclaration(); - } + for (VarDecl::redecl_iterator I = VD->redecls_begin(), + E = VD->redecls_end(); I != E; ++I) + ASTLocation(*I).print(OS); } else ASTLocation(D).print(OS); break; -- cgit v1.2.3