summaryrefslogtreecommitdiff
path: root/tools/c-index-test/core_main.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2016-02-29 07:56:07 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2016-02-29 07:56:07 +0000
commitcf6bc2febef128c40996325dfa20192e9f203211 (patch)
tree66d6a0e6cdd2183deae6297882a51bc19ce43e63 /tools/c-index-test/core_main.cpp
parent46f43fd040ae2bb2aabf81807c72e7351868743c (diff)
downloadclang-cf6bc2febef128c40996325dfa20192e9f203211.tar.gz
[index] Print and test module import references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262208 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/c-index-test/core_main.cpp')
-rw-r--r--tools/c-index-test/core_main.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/c-index-test/core_main.cpp b/tools/c-index-test/core_main.cpp
index e72b9f93ef..1881e31e20 100644
--- a/tools/c-index-test/core_main.cpp
+++ b/tools/c-index-test/core_main.cpp
@@ -107,6 +107,26 @@ public:
return true;
}
+
+ bool handleModuleOccurence(const ImportDecl *ImportD, SymbolRoleSet Roles,
+ FileID FID, unsigned Offset) override {
+ ASTContext &Ctx = ImportD->getASTContext();
+ SourceManager &SM = Ctx.getSourceManager();
+
+ unsigned Line = SM.getLineNumber(FID, Offset);
+ unsigned Col = SM.getColumnNumber(FID, Offset);
+ OS << Line << ':' << Col << " | ";
+
+ printSymbolInfo(getSymbolInfo(ImportD), OS);
+ OS << " | ";
+
+ OS << ImportD->getImportedModule()->getFullModuleName() << " | ";
+
+ printSymbolRoles(Roles, OS);
+ OS << " |\n";
+
+ return true;
+ }
};
} // anonymous namespace