diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-14 03:20:31 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-14 03:20:31 +0000 |
commit | c7377632d08e9a6492779b7241b76cbc42304050 (patch) | |
tree | ab04356ae5ec8a5ea186264de9f19beb1d4e4d68 /tools/index-test/index-test.cpp | |
parent | c37929c9e0dba89770dc5f0fbcfa0c9046da0b06 (diff) |
Handle redeclarations properly at the index-test tool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75605 91177308-0d34-0410-b5e6-96231b3b80d8
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; |