[PATCH] D99286: [AsmParser][SystemZ][z/OS] Add in support to only use CommentString as a possible comment syntax

Anirudh Prasad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 5 07:41:47 PDT 2021


anirudhp added a comment.

> This does not necessarily mean a conflict. As an concrete example, ld.lld treats `#` as an additional comment marker for linker scripts. GNU ld don't do this.
> The ld.lld way can be seen as an extension. Since there is no meaningful syntax starting with `#` in GNU ld linker scripts, reserving `#` for an additional comment marker is totally fine. 
> My question here is similar. If there is no meaningful syntax starting with `/*` or `//`, we don't necessarily detect such cases.

Ahh I see. I think I understand what you're saying. With respect to the extent of the support we are providing for HLASM (only for 1st param of inline asm block only concerned with Z machine instructions), I don't believe there would be any meaningful syntax starting with // or /* .. */, or # (there shouldn't be a reason for a user to use it). However, we also want to ensure that for the z/OS target, for the HLASM syntax support we are providing, we don't leak any accepted gnu syntax.

i.e. Let's say as a usecase, a user for z/OS using the HLASM syntax, does use the // .... , /* ... */ , # ..... in an inline asm statement (even though it might be not anything meaningful).

Under the current behaviour, llvm's assembler/asm lexer will lex it as a line comment. And since we want to reject any accepted gnu syntax, we want to ensure that those "additional comment" syntaxes are not accepted, i.e. they are lexed as regular tokens (non line comments in this case).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99286/new/

https://reviews.llvm.org/D99286



More information about the llvm-commits mailing list