Some options are only claimed in AddARMTargetArgs/AddAArch64TargetArgs/etc (called by
Clang::RenderTargetOptions).
For assembler input, Add*TargetArgs is not called. If an option is
unclaimed, it either leads to a -Wunused-command-line-argument warning
or an error (if TargetSpecific is set)
// clang '-###' --target=aarch64 -mbranch-protection=bti -c a.s clang: error: unsupported option '-mbranch-protection=' for target 'aarch64'
It seems that ignoring the diagnostics is most useful as it matches GCC
and users can do
clang --target=aarch64 -mbranch-protection=bti -S a.c clang --target=aarch64 -mbranch-protection=bti -c a.s
without changing the options.
Planned for main and release/17.x