[index] Print and test module import references.

llvm-svn: 262208
This commit is contained in:
Argyrios Kyrtzidis
2016-02-29 07:56:07 +00:00
parent a8b51c1e20
commit 113387e08e
6 changed files with 45 additions and 2 deletions

View File

@@ -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