[PATCH] D43005: [ARM] Error out on .arm assembler directives on windows
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 04:22:15 PST 2018
mstorsjo added a comment.
In https://reviews.llvm.org/D43005#1000330, @fhahn wrote:
> > Clearing it from there doesn't seem to be enough when assembling .s files from clang though.
>
> Looks like the ARMSubtarget is not initialized for the assembler from clang. But it would be great if we could handle that in ARMSubtarget, rather than duplicating the Windows implies NoARM logic here.
Yes, that'd clearly be the best. It's the same also if assembling with llvm-mc fwiw, the ARMSubtarget isn't instantiated in that case.
For the practical usecase, I don't have much difference between this (clearly erroring out on `.arm` directives) and just allowing them through; currently we hit an `llvm_unreachable` in ARMWinCOFFStreamer::EmitAssemblerFlag if we encounter such a directive. Emitting arm instructions does work technically, but the linker isn't ready to handle all of it (and interworking isn't handled right in all cases). But erroring out obviously is clearer, than having to hunt down cases where things build correctly but fail much more subtly.
Repository:
rL LLVM
https://reviews.llvm.org/D43005
More information about the llvm-commits
mailing list