diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2016-02-29 07:56:07 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2016-02-29 07:56:07 +0000 |
commit | 113387e08e55e28d0614373e168b5202bc83339a (patch) | |
tree | 490ad63b80f576122a754da65bca0b7ea3909fdd /clang/tools/c-index-test | |
parent | a8b51c1e200a8f7f8cb274b5d8d744d94e0fdb59 (diff) | |
download | bcm5719-llvm-113387e08e55e28d0614373e168b5202bc83339a.tar.gz bcm5719-llvm-113387e08e55e28d0614373e168b5202bc83339a.zip |
[index] Print and test module import references.
llvm-svn: 262208
Diffstat (limited to 'clang/tools/c-index-test')
-rw-r--r-- | clang/tools/c-index-test/core_main.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/tools/c-index-test/core_main.cpp b/clang/tools/c-index-test/core_main.cpp index e72b9f93efd..1881e31e207 100644 --- a/clang/tools/c-index-test/core_main.cpp +++ b/clang/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 |