[PATCH] D43005: [ARM] Error out on .arm assembler directives on windows
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 27 11:31:13 PST 2018
mstorsjo added a comment.
In https://reviews.llvm.org/D43005#1020771, @peter.smith wrote:
> > To clarify further - if I invoke the assembler as in the testcase I'm adding here, `llvm-mc -triple=thumbv7-win32 < %s ` (or `clang -target armv7-win32 -c file.S`, which internally remaps it to `thumbv7-win32` before it hits llvm), without manually setting the flag, what class/file should set it?
> Thanks for the response, that makes things a bit clearer. Off the top of my head the place I'd start would be arm::getARMTargetFeatures() in Driver/Toolchains/Arch.cpp As I understand it this builds up the target feature string based on the clang command line arguments, this does have access to the triple so it should be possible to add "+noarm" to the feature string if the OS is windows after the CPU defaults have been added. It looks like that should be called prior to the integrated assembler being launched. I've not looked into llvm-mc, although I suspect it will have a similar place where the feature string is built up.
> I've not tested any of the above, it is just where I'd start. I may be able to get some more time later in the week to look at this more thoroughly.
Ok, that sounds doable. But ideally there'd be a central place in llvm for setting it, in some place where the arm target is initialized for both normal compilation and for assembling, to avoid scattering the same windows => noarm logic in all users of the target (clang, llvm-mc, possibly others).
More information about the llvm-commits