summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/IndexingContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Index/IndexingContext.cpp')
-rw-r--r--clang/lib/Index/IndexingContext.cpp9
1 files changed, 7 insertions, 2 deletions
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;
OpenPOWER on IntegriCloud