Some options are only claimed in AddX86TargetArgs/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=x86_64 -mfpmath=sse -c a.s clang: error: unsupported option '-mfpmath=sse' for target 'x86_64'
For -mfpmath=, it's actually claimed by RenderFloatingPointOptions,
which should be moved to AddARMTargetArgs/AddX86TargetArgs later
(non-AArch32-non-x86 targets give a frontend error).
This change is localized and similar to D153691, for release/17.x
backporting.
Note: ClangAs::ConstructJob doesn't call Clang::RenderTargetOptions (and can't as the function is in Clang::). bool ForAS is a workaround used by ARM and will also be used by AArch64. I plan to clean this up at some point, but for release/17.x I intentionally make it simple.