Also use it in other places that performed it on their own.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Driver/Driver.h | ||
---|---|---|
643 | List the "good" values, and explicitly mention that it need not be one? | |
clang/lib/Driver/Driver.cpp | ||
1016–1019 | can we do this only if we have a value to set to, and remove the "" special case? | |
clang/lib/Tooling/InterpolatingCompilationDatabase.cpp | ||
149 | could consider adding isClangCL(StringRef)... up to you |
Somehow this seems to have broken the --driver-mode= flag when passed to clang-cl. The flag is supposed to override the mode inferred from the filename, but it's not working anymore. For example:
Before:
$ bin/clang-cl --driver-mode=gcc -target x86_64 -c /tmp/a.c -### clang version 13.0.0 (https://github.com/llvm/llvm-project 7dc9d7373186827a92d6ca08ad7192208dfea389) [...]
After:
$ bin/clang-cl --driver-mode=gcc -target x86_64 -c /tmp/a.c -### clang-13: warning: unknown argument ignored in clang-cl: '-target' [-Wunknown-argument] clang version 13.0.0 (https://github.com/llvm/llvm-project ce90b60bd09da41c52006374a4715425122572ab) Target: x86_64-pc-windows-msvc Thread model: posix InstalledDir: /work/llvm.monorepo/build.release/bin clang-13: error: no such file or directory: 'x86_64' [...]
Can you take a look?
Argh, sorry for the mess, sent out D109361.
FYI, before this patch clang preferred the last --driver-mode in case of multiple ones and started preferring the first one with this patch. In https://github.com/llvm/llvm-project/blob/main/clang/tools/driver/driver.cpp#L474 it always inserts a --driver-mode matching the program name at the beginning of the command line, hence it was always preferring CL mode even though you explicitly mentioned GCC afterwards.
List the "good" values, and explicitly mention that it need not be one?