diff options
Diffstat (limited to 'clang/lib/Index')
| -rw-r--r-- | clang/lib/Index/IndexSymbol.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Index/IndexingContext.cpp | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Index/IndexSymbol.cpp b/clang/lib/Index/IndexSymbol.cpp index 39812c4fe4f..62e2facde19 100644 --- a/clang/lib/Index/IndexSymbol.cpp +++ b/clang/lib/Index/IndexSymbol.cpp @@ -53,6 +53,9 @@ SymbolInfo index::getSymbolInfo(const Decl *D) { } else { switch (D->getKind()) { + case Decl::Import: + Info.Kind = SymbolKind::Module; + break; case Decl::Typedef: Info.Kind = SymbolKind::Typedef; break; case Decl::Function: 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; |

