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

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 13:35:31 PDT 2016


mstorsjo created this revision.
mstorsjo added a subscriber: llvm-commits.
Herald added subscribers: samparker, rengolin, aemerson.

Currently, for ARMCOFFMCAsmInfoMicrosoft, no comment character is set, thus the default, '#', 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 for ARM assembly in GNU environments. (The microsoft armasm.exe uses a different directive syntax than what LLVM currently supports, similar to ARM's armasm; these assemblers use ';' as comment character.)

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


https://reviews.llvm.org/D22775

Files:
  lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp

Index: lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
===================================================================
--- lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
+++ lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
@@ -90,6 +90,7 @@
 
   PrivateGlobalPrefix = "$M";
   PrivateLabelPrefix = "$M";
+  CommentString = "@";
 }
 
 void ARMCOFFMCAsmInfoGNU::anchor() { }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22775.65410.patch
Type: text/x-patch
Size: 368 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160725/7e652572/attachment.bin>


More information about the llvm-commits mailing list