diff options
| author | Kadir Cetinkaya <kadircet@google.com> | 2019-03-14 08:35:17 +0000 |
|---|---|---|
| committer | Kadir Cetinkaya <kadircet@google.com> | 2019-03-14 08:35:17 +0000 |
| commit | d9c174648ed8219ad86a021bcccf149e860d3ef5 (patch) | |
| tree | 3c973ab0cfaad5aa8269429fbc1d763e93f4b48d /clang-tools-extra/clangd/index/SymbolCollector.cpp | |
| parent | fec503acb667c80a0cbc8e998e2aa8bba99d8743 (diff) | |
| download | bcm5719-llvm-d9c174648ed8219ad86a021bcccf149e860d3ef5.tar.gz bcm5719-llvm-d9c174648ed8219ad86a021bcccf149e860d3ef5.zip | |
[clangd] Store explicit template specializations in index for code navigation purposes
Summary:
This introduces ~4k new symbols, and ~10k refs for LLVM. We need that
information for providing better code navigation support:
- When references for a class template is requested, we should return these specializations as well.
- When children of a specialization is requested, we should be able to query for those symbols(instead of just class template)
Number of symbols: 378574 -> 382784
Number of refs: 5098857 -> 5110689
Reviewers: hokein, gribozavr
Reviewed By: gribozavr
Subscribers: nridge, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59083
llvm-svn: 356125
Diffstat (limited to 'clang-tools-extra/clangd/index/SymbolCollector.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/index/SymbolCollector.cpp | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/clang-tools-extra/clangd/index/SymbolCollector.cpp b/clang-tools-extra/clangd/index/SymbolCollector.cpp index 7fae0795d17..eee3200421c 100644 --- a/clang-tools-extra/clangd/index/SymbolCollector.cpp +++ b/clang-tools-extra/clangd/index/SymbolCollector.cpp @@ -221,13 +221,6 @@ RefKind toRefKind(index::SymbolRoleSet Roles) { return static_cast<RefKind>(static_cast<unsigned>(RefKind::All) & Roles); } -template <class T> bool explicitTemplateSpecialization(const NamedDecl &ND) { - if (const auto *TD = dyn_cast<T>(&ND)) - if (TD->getTemplateSpecializationKind() == TSK_ExplicitSpecialization) - return true; - return false; -} - } // namespace SymbolCollector::SymbolCollector(Options Opts) : Opts(std::move(Opts)) {} @@ -279,10 +272,6 @@ bool SymbolCollector::shouldCollectSymbol(const NamedDecl &ND, if (!isa<RecordDecl>(DeclCtx)) return false; } - if (explicitTemplateSpecialization<FunctionDecl>(ND) || - explicitTemplateSpecialization<CXXRecordDecl>(ND) || - explicitTemplateSpecialization<VarDecl>(ND)) - return false; // Avoid indexing internal symbols in protobuf generated headers. if (isPrivateProtoDecl(ND)) |

