[PATCH] D69608: [clangd] Helper for getting nested namespace qualification
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 21 04:42:15 PST 2019
kadircet marked 14 inline comments as done.
kadircet added inline comments.
================
Comment at: clang-tools-extra/clangd/AST.cpp:330
+ [&](NestedNameSpecifier *NNS) {
+ return llvm::any_of(
+ VisibleNamespaceDecls,
----------------
ilya-biryukov wrote:
> ilya-biryukov wrote:
> > Maybe exit early if `NNS` is not a namespace here? No need to search for it in that case.
> `llvm::any_of` is `O(n)`, maybe search in `DenseSet` instead?
i didn't bother optimizing since it is really rare to have more than 10 `using namespace directives` for any given file.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69608/new/
https://reviews.llvm.org/D69608
More information about the cfe-commits
mailing list