sammccall marked 2 inline comments as done.
sammccall added inline comments.


================
Comment at: clang/lib/Frontend/CreateInvocationFromCommandLine.cpp:92
-  const driver::Command &Cmd = cast<driver::Command>(*Jobs.begin());
-  if (StringRef(Cmd.getCreator().getName()) != "clang") {
     Diags->Report(diag::err_fe_expected_clang_command);
----------------
kadircet wrote:
> hmm, this looks like a subtle behaviour change. I definitely like the 
> behaviour you proposed better, but maybe do it in a separate patch for making 
> the revert easier if need be?
Which behavior change are do you mean?

When RecoverFromErrors is false and OffloadCompilation is false, behavior is 
same as before: if there isn't exactly one job we diagnose that and exit, if 
it's not suitable we diagnose that and exit.

When RecoverFromErrors is true we search for the first suitable job, instead of 
complaining that the number is wrong or the one at the front isn't suitable, 
this is the intended change (and basically only affects clangd).

When OffloadCompilation is true, there is a behavior change: previously we'd 
use the first job and fail if it's not clang, now we'll use the first clang 
job. The old behavior seems brittle and the change only affects (previously) 
error cases, and I'd have to add more complexity to preserve it - is this 
worthwhile?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107632

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to