diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-18 08:50:35 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-18 08:50:35 +0000 |
commit | 1e4bc099882626059f14d687ed7a1a5518b7f3c2 (patch) | |
tree | 8f7309284f4789d87f4712e354c5aed9cbb8188e /tools/index-test/index-test.cpp | |
parent | f23e839e9ddea324c743d26da43fb767f90ca223 (diff) |
Introduce a redecl_iterator in Decl class, so that we can do a "iterate over all declarations of the same decl" without knowing the exact type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/index-test/index-test.cpp')
-rw-r--r-- | tools/index-test/index-test.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp index a188cd103e..10449ed0ba 100644 --- a/tools/index-test/index-test.cpp +++ b/tools/index-test/index-test.cpp @@ -133,16 +133,9 @@ static void ProcessDecl(Decl *D) { } case PrintDecls : - if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { - 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)) { - for (VarDecl::redecl_iterator I = VD->redecls_begin(), - E = VD->redecls_end(); I != E; ++I) - ASTLocation(*I).print(OS); - } else - ASTLocation(D).print(OS); + for (Decl::redecl_iterator I = D->redecls_begin(), + E = D->redecls_end(); I != E; ++I) + ASTLocation(*I).print(OS); break; } |