[PATCH] D116167: [clangd] Adjust compile flags so they work when applied to other file(type)s.
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 4 01:26:29 PST 2022
kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.
thanks, lgtm!
================
Comment at: clang-tools-extra/clangd/CompileCommands.cpp:287
+ if (TransferFrom) {
+ tooling::CompileCommand TransferCmd;
----------------
maybe perform this before inserting `-- Filename` and do it once afterwards?
================
Comment at: clang-tools-extra/clangd/CompileCommands.cpp:295
+ // Restore the canonical "driver --opts -- filename" form we expect.
+ // FIXME: This is ugly and coupled. Make transferCompileCommand ensure it?
+ assert(!Cmd.empty() && Cmd.back() == File);
----------------
agreed it already inserts `--` in some cases today, i think i was trying to be conservative at the time. i don't see any reason for not doing that all the time (possibly apart from test failures and tons of new places that don't expect `--` in the flags).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116167/new/
https://reviews.llvm.org/D116167
More information about the cfe-commits
mailing list