[PATCH] D117549: [clangd] Sort targets before printing for tests
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 18 12:07:12 PST 2022
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.
Thanks!
================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:1174
bool First = true;
+ if (!R.Targets.empty()) {
+ const auto &SM = R.Targets.front()->getASTContext().getSourceManager();
----------------
No real objection to this form, but mutating the (copied) argument is a bit of a WTF.
An altervative would be to render `Targets` into an array, sort them (as strings), and then llvm::join them.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117549/new/
https://reviews.llvm.org/D117549
More information about the cfe-commits
mailing list