diff options
author | Ben Langmuir <blangmuir@apple.com> | 2017-08-16 23:12:21 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2017-08-16 23:12:21 +0000 |
commit | fd6e39c40b0f78274bc00f785f2e30cd497dd1c2 (patch) | |
tree | 8d0147cac4b5885454667b99a53694a3988b48ab /clang/lib/Index/IndexSymbol.cpp | |
parent | 4abc3f6036017f0996ccc860a174773a989316b1 (diff) | |
download | bcm5719-llvm-fd6e39c40b0f78274bc00f785f2e30cd497dd1c2.tar.gz bcm5719-llvm-fd6e39c40b0f78274bc00f785f2e30cd497dd1c2.zip |
[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
Diffstat (limited to 'clang/lib/Index/IndexSymbol.cpp')
-rw-r--r-- | clang/lib/Index/IndexSymbol.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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"); } |