[PATCH] D42796: [clangd] Skip inline namespace when collecting scopes for index symbols.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 1 08:39:38 PST 2018
hokein added inline comments.
================
Comment at: clangd/index/SymbolCollector.cpp:69
+// qualifier. Inline namespaces and unscoped enums are skipped.
+llvm::Expected<std::string> getScope(const NamedDecl *ND) {
+ llvm::SmallVector<llvm::StringRef, 4> Contexts;
----------------
There is a `SuppressUnwrittenScope` option in `PrintingPolicy`, I think we can probably use `printQualifiedName` with our customized policy (setting `SuppressUnwrittenScope` to true) here.
================
Comment at: clangd/index/SymbolCollector.cpp:195
llvm::SmallString<128> USR;
+ if (ND->getIdentifier() == nullptr)
+ return true;
----------------
Consider moving to `shouldFilterDecl`? We also have a check `if (ND->getDeclName().isEmpty())` there, which I assume does similar thing.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D42796
More information about the cfe-commits
mailing list