[PATCH] D92012: [clangd][query-driver] Extract target

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 12:21:17 PST 2020


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/QueryDriverDatabase.cpp:212
+  if (!Target.empty()) {
+    Cmd.CommandLine.push_back("-target");
+    Cmd.CommandLine.push_back(Target);
----------------
sammccall wrote:
> `clang -target foo test.cc` seems to be a hard error in the driver if the target is unknown.
> (vs likely *some* functionality if we just didn't set the driver)
> 
> so this could regress some scenarios. Can we mitigate that?
> (It's possible that we're running the driver in a mode where we proceed anyway, but I can't remember :-()
what if target already exists in `Cmd`?

also it would be nice to use `--target=X` format to be consistent with target inference from invocation name as in https://github.com/llvm/llvm-project/blob/master/clang/lib/Tooling/Tooling.cpp#L278.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92012/new/

https://reviews.llvm.org/D92012



More information about the cfe-commits mailing list