summaryrefslogtreecommitdiffstats
path: root/clang/tools/index-test/index-test.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-14 03:20:31 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-14 03:20:31 +0000
commit12563b8111dcc8b47a5821c5e21ac1f01e93a8b8 (patch)
tree3947804c20a2056e03f20383efaf686b1cc6d460 /clang/tools/index-test/index-test.cpp
parent1506d9bc2580f0fa4a4b4e128c462864ae8aa9e1 (diff)
downloadbcm5719-llvm-12563b8111dcc8b47a5821c5e21ac1f01e93a8b8.tar.gz
bcm5719-llvm-12563b8111dcc8b47a5821c5e21ac1f01e93a8b8.zip
Handle redeclarations properly at the index-test tool.
llvm-svn: 75605
Diffstat (limited to 'clang/tools/index-test/index-test.cpp')
-rw-r--r--clang/tools/index-test/index-test.cpp14
1 files changed, 6 insertions, 8 deletions
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<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;
OpenPOWER on IntegriCloud