diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-29 23:38:21 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-29 23:38:21 +0000 |
commit | b17dc46c795d5eceeceb1424b96d63739d12a522 (patch) | |
tree | d41ccd8f87a22fa6ff2efea2375c96c088b1a640 /tools/index-test/index-test.cpp | |
parent | 8e9e9ef5348bce1a8f0741a5684fac3de9701c28 (diff) |
-Make IndexProvider an abstract interface for getting indexing information.
-Introduce Indexer as an IndexProvider implementation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/index-test/index-test.cpp')
-rw-r--r-- | tools/index-test/index-test.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp index 4516e31365..a88d270327 100644 --- a/tools/index-test/index-test.cpp +++ b/tools/index-test/index-test.cpp @@ -33,7 +33,7 @@ //===----------------------------------------------------------------------===// #include "clang/Index/Program.h" -#include "clang/Index/IndexProvider.h" +#include "clang/Index/Indexer.h" #include "clang/Index/Entity.h" #include "clang/Index/TranslationUnit.h" #include "clang/Index/ASTLocation.h" @@ -141,7 +141,7 @@ static void ProcessDecl(Decl *D) { } } -static void ProcessASTLocation(ASTLocation ASTLoc, IndexProvider &IdxProvider) { +static void ProcessASTLocation(ASTLocation ASTLoc, Indexer &Idxer) { assert(ASTLoc.isValid()); Decl *D = ASTLoc.getReferencedDecl(); @@ -151,14 +151,14 @@ static void ProcessASTLocation(ASTLocation ASTLoc, IndexProvider &IdxProvider) { return; } - Entity Ent = Entity::get(D, IdxProvider.getProgram()); + Entity Ent = Entity::get(D, Idxer.getProgram()); if (Ent.isInvalid() || Ent.isInternalToTU()) return ProcessDecl(D); // Find the "same" Decl in other translation units and print information. - for (IndexProvider::translation_unit_iterator - I = IdxProvider.translation_units_begin(Ent), - E = IdxProvider.translation_units_end(Ent); I != E; ++I) { + for (Indexer::translation_unit_iterator + I = Idxer.translation_units_begin(Ent), + E = Idxer.translation_units_end(Ent); I != E; ++I) { TUnit *TU = static_cast<TUnit*>(*I); Decl *OtherD = Ent.getDecl(TU->getASTContext()); assert(OtherD && "Couldn't resolve Entity"); @@ -178,7 +178,7 @@ int main(int argc, char **argv) { FileManager FileMgr; Program Prog; - IndexProvider IdxProvider(Prog); + Indexer Idxer(Prog); llvm::SmallVector<TUnit*, 4> TUnits; // If no input was specified, read from stdin. @@ -200,7 +200,7 @@ int main(int argc, char **argv) { TUnit *TU = new TUnit(AST.take(), InFile); TUnits.push_back(TU); - IdxProvider.IndexAST(TU); + Idxer.IndexAST(TU); } ASTLocation ASTLoc; @@ -253,7 +253,7 @@ int main(int argc, char **argv) { FirstAST->getASTContext().getCommentForDecl(ASTLoc.getDecl())) OS << "Comment associated with this declaration:\n" << Comment << "\n"; } else { - ProcessASTLocation(ASTLoc, IdxProvider); + ProcessASTLocation(ASTLoc, Idxer); } } |