[clangd] Avoid "expected one compiler job" by picking the first eligible job.
authorSam McCall <sam.mccall@gmail.com>
Fri, 6 Aug 2021 10:07:13 +0000 (12:07 +0200)
committerSam McCall <sam.mccall@gmail.com>
Thu, 12 Aug 2021 22:36:30 +0000 (00:36 +0200)
commit2ff7ca98a99bbfc4f44b8ba1e2e4e594f8ee253e
treeca2c9e01e86412bbb8c1235151578608d3e7c44b
parent6b28835b3754aa3b795e7684b3e7f465b516f753
[clangd] Avoid "expected one compiler job" by picking the first eligible job.

This happens in createInvocationWithCommandLine but only clangd currently passes
ShouldRecoverOnErorrs (sic).

One cause of this (with correct command) is several -arch arguments for mac
multi-arch support.

Fixes https://github.com/clangd/clangd/issues/827

Differential Revision: https://reviews.llvm.org/D107632
clang-tools-extra/clangd/unittests/ClangdTests.cpp
clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
clang/unittests/Frontend/CMakeLists.txt
clang/unittests/Frontend/UtilsTest.cpp [new file with mode: 0644]