[clangd] Strip mutliple arch options
authorKadir Cetinkaya <kadircet@google.com>
Fri, 6 Aug 2021 10:52:41 +0000 (12:52 +0200)
committerKadir Cetinkaya <kadircet@google.com>
Fri, 6 Aug 2021 13:04:04 +0000 (15:04 +0200)
commit3bf77980d934c4aa383e4ea9a9a5de86598bea9b
tree286039258981d6f900b27ea0ee2f4f59d656340f
parent02b1c3f0529e525a4ffa671478050f4704b3f472
[clangd] Strip mutliple arch options

This patch strips all the arch options in case of multiple ones. As it
results in multiple compiler jobs, which clangd cannot handle.

It doesn't pick any over the others as it is unclear which one the user wants
and defaulting to host architecture seems less surprising. Users also have the
ability to explicitly specify the architecture they want via clangd config
files.

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

Differential Revision: https://reviews.llvm.org/D107634
clang-tools-extra/clangd/CompileCommands.cpp
clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp