1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

[ARM] Set a non-conflicting comment character for assembly in MSVC mode

Currently, for ARMCOFFMCAsmInfoMicrosoft, no comment character is set, thus the
idefault, '#', is used.

The hash character doesn't work as comment character in ARM assembly, since '#'
is used for immediate values.

The comment character is set to ';', which is the comment character used by MS
armasm.exe. (The microsoft armasm.exe uses a different directive syntax than
what LLVM currently supports though, similar to ARM's armasm.)

This allows inline assembly with immediate constants to be built (and brings the
assembly output from clang -S closer to being possible to assemble).

A test is added that verifies that ';' is correctly interpreted as comments in
this mode, and verifies that assembling code that includes literal constants
with a '#' works.

Patch by Martin Storsjö.

llvm-svn: 276859
This commit is contained in:
Renato Golin 2016-07-27 12:31:58 +00:00
parent c2c3be974e
commit c15ac98803
2 changed files with 14 additions and 0 deletions

View File

@ -90,6 +90,7 @@ ARMCOFFMCAsmInfoMicrosoft::ARMCOFFMCAsmInfoMicrosoft() {
PrivateGlobalPrefix = "$M";
PrivateLabelPrefix = "$M";
CommentString = ";";
}
void ARMCOFFMCAsmInfoGNU::anchor() { }

View File

@ -0,0 +1,13 @@
; RUN: llvm-mc -triple armv7-windows-msvc -filetype obj -o - %s
.syntax unified
.thumb
.text
.global function
.thumb_func
function:
; this is a comment
mov r0, #42 ; this # was not
bx lr