From 113387e08e55e28d0614373e168b5202bc83339a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Mon, 29 Feb 2016 07:56:07 +0000 Subject: [index] Print and test module import references. llvm-svn: 262208 --- clang/lib/Index/IndexingContext.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'clang/lib/Index/IndexingContext.cpp') diff --git a/clang/lib/Index/IndexingContext.cpp b/clang/lib/Index/IndexingContext.cpp index 9ac22f85e1d..1645a9ab0bd 100644 --- a/clang/lib/Index/IndexingContext.cpp +++ b/clang/lib/Index/IndexingContext.cpp @@ -58,7 +58,12 @@ bool IndexingContext::handleReference(const NamedDecl *D, SourceLocation Loc, } bool IndexingContext::importedModule(const ImportDecl *ImportD) { - SourceLocation Loc = ImportD->getLocation(); + SourceLocation Loc; + auto IdLocs = ImportD->getIdentifierLocs(); + if (!IdLocs.empty()) + Loc = IdLocs.front(); + else + Loc = ImportD->getLocation(); SourceManager &SM = Ctx->getSourceManager(); Loc = SM.getFileLoc(Loc); if (Loc.isInvalid()) @@ -85,7 +90,7 @@ bool IndexingContext::importedModule(const ImportDecl *ImportD) { } } - SymbolRoleSet Roles{}; + SymbolRoleSet Roles = (unsigned)SymbolRole::Reference; if (ImportD->isImplicit()) Roles |= (unsigned)SymbolRole::Implicit; -- cgit v1.2.3