summaryrefslogtreecommitdiffstats
path: root/clang/tools/index-test/index-test.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-29 23:39:03 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-07-29 23:39:03 +0000
commitf1a0fd852f29d3ff6f1ee7a39f4d339dd24aa9ea (patch)
tree05dbbcca9c0d205ff987d13e98b2b4d285d81d0f /clang/tools/index-test/index-test.cpp
parentd3e037ff892146de2db44f465b2985ea0e3dfb27 (diff)
downloadbcm5719-llvm-f1a0fd852f29d3ff6f1ee7a39f4d339dd24aa9ea.tar.gz
bcm5719-llvm-f1a0fd852f29d3ff6f1ee7a39f4d339dd24aa9ea.zip
Introduce a helper template for the Handler classes and use it instead
of the iterator of the Indexer class. llvm-svn: 77528
Diffstat (limited to 'clang/tools/index-test/index-test.cpp')
-rw-r--r--clang/tools/index-test/index-test.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/tools/index-test/index-test.cpp b/clang/tools/index-test/index-test.cpp
index a88d2703275..78ffd37b1ef 100644
--- a/clang/tools/index-test/index-test.cpp
+++ b/clang/tools/index-test/index-test.cpp
@@ -38,6 +38,7 @@
#include "clang/Index/TranslationUnit.h"
#include "clang/Index/ASTLocation.h"
#include "clang/Index/DeclReferenceMap.h"
+#include "clang/Index/Handlers.h"
#include "clang/Index/Utils.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CommandLineSourceLoc.h"
@@ -155,12 +156,13 @@ static void ProcessASTLocation(ASTLocation ASTLoc, Indexer &Idxer) {
if (Ent.isInvalid() || Ent.isInternalToTU())
return ProcessDecl(D);
+ Storing<TranslationUnitHandler> TURes;
+ Idxer.GetTranslationUnitsFor(Ent, TURes);
+
// Find the "same" Decl in other translation units and print information.
- 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());
+ for (Storing<TranslationUnitHandler>::iterator
+ I = TURes.begin(), E = TURes.end(); I != E; ++I) {
+ Decl *OtherD = Ent.getDecl((*I)->getASTContext());
assert(OtherD && "Couldn't resolve Entity");
ProcessDecl(OtherD);
}
OpenPOWER on IntegriCloud