aboutsummaryrefslogtreecommitdiff
path: root/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
commit94431b5b4ceca8831e1ed6d6f646b99052680a85 (patch)
tree25e2c68a9df801ac429dea75dbd6a3eb3bc89e5a /tools/index-test/index-test.cpp
parentdaf253d73d6a6248edc458587f4e88763e1e1583 (diff)
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
Diffstat (limited to 'tools/index-test/index-test.cpp')
-rw-r--r--tools/index-test/index-test.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp
index a88d270327..78ffd37b1e 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 @@ 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);
}