[cfe-dev] Aarch64 ASM quirk

Joel Winarske via cfe-dev cfe-dev at lists.llvm.org
Fri Nov 8 12:31:02 PST 2019


Ah yes, a comment...

Is there a seperator character that works?

On Fri, Nov 8, 2019, 5:43 AM Martin Storsjö <martin at martin.st> wrote:

> On Fri, 8 Nov 2019, Peter Smith via cfe-dev wrote:
>
> > Hello Joel,
> >
> > The root cause is that the AArch64 target is using ';' as a comment
> > character, whereas in GNU as (and many other llvm MC backends),  the
> > ';' is used as a statement separator. In your example only the text up
> > to ';' is being parsed.
> >
> > Looking at AArch64MCAsmInfo.cpp
> >  SeparatorString = "%%";
> >  CommentString = ";";
> >
> > I think that this is likely to have been derived from Darwin as I
> > can't get the "%%" to work as a statement separator for
> > aarch64-linux-gnu targets.
>
> I don't know about the separator string, but if you look in
> AArch64MCAsmInfoELF (and AArch64MCAsmInfoGNUCOFF), the comment string is
> set to "//" instead.
>
> I suggested changing this for the GNUCOFF (aka MinGW) target, as mingw-w64
> contains a number of assembler files that uses this pattern of piling up a
> few directives on one line.
>
> As there's very little predecent for GNU style .s assembler for
> aarch64-windows-msvc targets (as the official tool from microsoft,
> armasm64, uses a totally different syntax), I'm guess it would be fine to
> change the comment string to "//" there as well, as there apparently is a
> demand for it?
>
> With a target that doesn't treat ";" as a comment char, your assembler
> example errors out due to issues with the section and type directives
> though, now that they actually are interpreted and not stripped out as
> comments.
>
> // Martin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191108/9ccc43ba/attachment.html>


More information about the cfe-dev mailing list