This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Canonicalize inputs provided with `--`
ClosedPublic

Authored by kadircet on Aug 6 2021, 4:26 AM.

Details

Summary

We already strip all the inputs provided without --, this patch also
handles the cases with --.

Diff Detail

Event Timeline

kadircet created this revision.Aug 6 2021, 4:26 AM
kadircet requested review of this revision.Aug 6 2021, 4:26 AM
sammccall accepted this revision.Aug 6 2021, 5:45 AM
sammccall added inline comments.
clang-tools-extra/clangd/CompileCommands.cpp
250

iterate from dashdash->getIndex() + 1 to Cmd.size() instead?

Or just Cmd.resize(dashdash->getIndex() + 2)?

This revision is now accepted and ready to land.Aug 6 2021, 5:45 AM
kadircet updated this revision to Diff 364764.Aug 6 2021, 6:02 AM
kadircet marked an inline comment as done.
  • Cmd.resize instead of dropping arguments trailing -- one by one.
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.
kadircet added inline comments.Aug 6 2021, 6:14 AM
clang-tools-extra/clangd/CompileCommands.cpp
250

ah yes, resize looks a lot better. but we deliberately drop -- too. so that we can always append it without checking again.