[Driver] Add -Xclang= as an alias for -Xclang
authorFangrui Song <i@maskray.me>
Tue, 9 Aug 2022 02:05:24 +0000 (19:05 -0700)
committerFangrui Song <i@maskray.me>
Tue, 9 Aug 2022 02:05:24 +0000 (19:05 -0700)
commit8d9d27db475943954fce00db47f8c9daf4dae600
tree3ebb9b3050f09138a5a2cd47cbd0952343f133ef
parent3f561996bf7193091bc6670a2e7804b0cb0bb936
[Driver] Add -Xclang= as an alias for -Xclang

Driver options taking a value typically use `=` as the separator, instead of a
space. Unfortunately many older driver options do not stick with the rule, but I
find -Xclang used a lot and will be convenient if -Xclang= exists.

For build systems using a string array instead of a string to indicate compiler options,
`["-Xclang=-foo"]` is more convenient than `["-Xclang", "-foo"]`.
If a tool wants to filter out -Xclang=-foo, it is trivial for the `=` form, but
complex for the space separated form.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D131455
clang/include/clang/Driver/Options.td
clang/test/Driver/disable-llvm.c