[PATCH] D36405: [AsmParser] Hash is not a comment on some targets

Nirav Dave via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 7 11:00:52 PDT 2017


niravd requested changes to this revision.
niravd added a comment.
This revision now requires changes to proceed.

LexLineComment will only be called when we # is a asm string line comment or we're at the start of a statement. This change would miss the case of a hash-based (preprocessor) EOL comment trailing a non-empty line which we do need to catch. I believe (but am not 100% certain) that I did find a live assembly case where the # as line comment interpreation for AArch64 was used.

The current variation between preprocessor assembly and preprocessed assembly is definitely non-ideal in that some typos will be interpreted as valid parses but  AFAIK there's no context in the in-tree targets at least where its ambiguous whether the hash signals a comment or not. All things being equal I think our "preprocessor" behavior should be consistent across targets.

If we want to soften this I suggest we make AsmLexer Target dependent as well and parse Hash token as EndOfStatement.


Repository:
  rL LLVM

https://reviews.llvm.org/D36405





More information about the llvm-commits mailing list