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 | 05898da9cbc7358698f8da1a93cf6a79ca2dfeae (patch) | |
tree | 77057467aabf7f9597464d6afd355798933b4d8c /clang/tools/index-test/index-test.cpp | |
parent | fad334ce5b6c5a72bc7230928c7f887bd1e49c1c (diff) | |
download | bcm5719-llvm-05898da9cbc7358698f8da1a93cf6a79ca2dfeae.tar.gz bcm5719-llvm-05898da9cbc7358698f8da1a93cf6a79ca2dfeae.zip |
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.
llvm-svn: 76298
Diffstat (limited to 'clang/tools/index-test/index-test.cpp')
-rw-r--r-- | clang/tools/index-test/index-test.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/clang/tools/index-test/index-test.cpp b/clang/tools/index-test/index-test.cpp index a188cd103ed..10449ed0baa 100644 --- a/clang/tools/index-test/index-test.cpp +++ b/clang/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; } |