This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Strip mutliple arch options
ClosedPublic

Authored by kadircet on Aug 6 2021, 3:54 AM.

Details

Summary

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.

Diff Detail

Event Timeline

kadircet created this revision.Aug 6 2021, 3:54 AM
kadircet requested review of this revision.Aug 6 2021, 3:54 AM
sammccall accepted this revision.Aug 6 2021, 5:43 AM
sammccall added inline comments.
clang-tools-extra/clangd/CompileCommands.cpp
225

nit: llvm::SmallVector<unsigned> unless you're very sure about the 1

226

nit: fat isn't an acronym here

228

s/host/default/

This revision is now accepted and ready to land.Aug 6 2021, 5:43 AM
kadircet marked 3 inline comments as done.Aug 6 2021, 5:56 AM
kadircet added inline comments.
clang-tools-extra/clangd/CompileCommands.cpp
225

I think we'll still have just the single filename in the most common case and will only have -arch or multiple filenames rarely. so keeping it.

kadircet updated this revision to Diff 364763.Aug 6 2021, 5:56 AM
kadircet marked an inline comment as done.
  • Update comments
This revision was landed with ongoing or failed builds.Aug 6 2021, 6:10 AM
This revision was automatically updated to reflect the committed changes.