diff options
Diffstat (limited to 'tools/index-test/index-test.cpp')
-rw-r--r-- | tools/index-test/index-test.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp index 63c86aac46..a188cd103e 100644 --- a/tools/index-test/index-test.cpp +++ b/tools/index-test/index-test.cpp @@ -134,15 +134,13 @@ static void ProcessDecl(Decl *D) { case PrintDecls : if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(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<VarDecl>(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; |