[ARM] For assembler files recognize -Xassembler or -Wa, -mthumb
authorPeter Smith <peter.smith@linaro.org>
Mon, 20 Nov 2017 13:43:55 +0000 (13:43 +0000)
committerPeter Smith <peter.smith@linaro.org>
Mon, 20 Nov 2017 13:43:55 +0000 (13:43 +0000)
commit3947cb3cf0518045deb79ab8c830f56e952cd90d
tree32e813773f708ebd34af5679435362a95defd4cd
parent86bff788eba12543de84540df70f34724e677ffa
[ARM] For assembler files recognize -Xassembler or -Wa, -mthumb

The Unified Arm Assembler Language is designed so that the majority of
assembler files can be assembled for both Arm and Thumb with the choice
made as a compilation option.

The way this is done in gcc is to pass -mthumb to the assembler with either
-Wa,-mthumb or -Xassembler -mthumb. This change adds support for these
options to clang. There is no assembler equivalent of -mno-thumb, -marm or
-mno-arm so we don't need to recognize these.

Ideally we would do all of the processing in
CollectArgsForIntegratedAssembler(). Unfortunately we need to change the
triple and at that point it is too late. Instead we look for the option
earlier in ComputeLLVMTriple().

Fixes PR34519

Differential Revision: https://reviews.llvm.org/D40127

llvm-svn: 318647
clang/lib/Driver/ToolChain.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/arm-target-as-mthumb.s [new file with mode: 0644]