From fd6e39c40b0f78274bc00f785f2e30cd497dd1c2 Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Wed, 16 Aug 2017 23:12:21 +0000 Subject: [index] Add indexing for unresolved-using declarations In dependent contexts we end up referencing these, so make sure they have USRs, and have their declarations indexed. For the most part they behave like typedefs, but we also need to worry about having multiple using declarations with the same "name". rdar://problem/33883650 llvm-svn: 311053 --- clang/lib/Index/IndexSymbol.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'clang/lib/Index/IndexSymbol.cpp') diff --git a/clang/lib/Index/IndexSymbol.cpp b/clang/lib/Index/IndexSymbol.cpp index 95b3ac19666..03db0cd53f7 100644 --- a/clang/lib/Index/IndexSymbol.cpp +++ b/clang/lib/Index/IndexSymbol.cpp @@ -300,6 +300,18 @@ SymbolInfo index::getSymbolInfo(const Decl *D) { Info.Kind = SymbolKind::TypeAlias; Info.Lang = SymbolLanguage::CXX; break; + case Decl::UnresolvedUsingTypename: + Info.Kind = SymbolKind::Using; + Info.SubKind = SymbolSubKind::UsingTypename; + Info.Lang = SymbolLanguage::CXX; + Info.Properties |= (unsigned)SymbolProperty::Generic; + break; + case Decl::UnresolvedUsingValue: + Info.Kind = SymbolKind::Using; + Info.SubKind = SymbolSubKind::UsingValue; + Info.Lang = SymbolLanguage::CXX; + Info.Properties |= (unsigned)SymbolProperty::Generic; + break; case Decl::Binding: Info.Kind = SymbolKind::Variable; Info.Lang = SymbolLanguage::CXX; @@ -448,6 +460,7 @@ StringRef index::getSymbolKindString(SymbolKind K) { case SymbolKind::Destructor: return "destructor"; case SymbolKind::ConversionFunction: return "coversion-func"; case SymbolKind::Parameter: return "param"; + case SymbolKind::Using: return "using"; } llvm_unreachable("invalid symbol kind"); } @@ -459,6 +472,8 @@ StringRef index::getSymbolSubKindString(SymbolSubKind K) { case SymbolSubKind::CXXMoveConstructor: return "cxx-move-ctor"; case SymbolSubKind::AccessorGetter: return "acc-get"; case SymbolSubKind::AccessorSetter: return "acc-set"; + case SymbolSubKind::UsingTypename: return "using-typename"; + case SymbolSubKind::UsingValue: return "using-value"; } llvm_unreachable("invalid symbol subkind"); } -- cgit v1.2.3