Introduce a helper template for the Handler classes and use it instead
of the iterator of the Indexer class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77528 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp
index a88d270..78ffd37 100644
--- a/tools/index-test/index-test.cpp
+++ b/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 @@
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);
}