This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Get rid of arg adjusters in CommandMangler
ClosedPublic

Authored by kadircet on Jul 22 2021, 8:25 AM.

Diff Detail

Event Timeline

kadircet created this revision.Jul 22 2021, 8:25 AM
kadircet requested review of this revision.Jul 22 2021, 8:25 AM
kadircet updated this revision to Diff 361132.Jul 23 2021, 2:24 AM
  • Also get rid of the insertion adjuster
sammccall accepted this revision.Jul 23 2021, 6:14 AM

This raises the question "is it safe to move functionality from CommandMangler to buildCompilerInvocation for convenience, are they always called on the same codepaths?"

I think from our brief investigation the answer is yes, but:

  • this expectation should probably be documented on CommandMangler and/or buildCompilerInvocation
  • *neither* of them are called when background indexing, which should probably be a fixme on the static indexer
clang-tools-extra/clangd/CompileCommands.cpp
225

oops, might have left this comment on the wrong patch

use range insert to save shuffling the tail over and over and std::make_move_iterator() to avoid copies?

This revision is now accepted and ready to land.Jul 23 2021, 6:14 AM
kadircet updated this revision to Diff 361182.Jul 23 2021, 6:58 AM
kadircet marked an inline comment as done.

Use move_iterator instead of inserting in a loop.

clang-tools-extra/clangd/CompileCommands.cpp
225

yeah the main reason this is a loop is because I didn't know about make_move_iterator, switching to a range insert instead, thanks!

kadircet updated this revision to Diff 361195.Jul 23 2021, 7:21 AM
  • Add FIXME for using CommandMangler and buildCompilerInvocation in clangd-indexer.
This revision was landed with ongoing or failed builds.Jul 23 2021, 8:15 AM
This revision was automatically updated to reflect the committed changes.