[PATCH] D72826: [clangd] Make output order of allTargetDecls deterministic
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 16 04:30:59 PST 2020
sammccall accepted this revision.
sammccall added inline comments.
================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:224
+ using ValTy = std::pair<const NamedDecl *, RelSet>;
+ llvm::SmallVector<ValTy, 1> Result;
+ for (const auto &Elem : Decls)
----------------
no need for lookups I think
```
Result.resize(Decls.size());
for (auto& Elem : Decls)
Result[Elem.second.second] = {Elem.first, Elem.second.first};
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72826/new/
https://reviews.llvm.org/D72826
More information about the cfe-commits
mailing list