[PATCH] Integrated assembler incorrectly lexes ARM-style comments

David Peixotto dpeixott at codeaurora.org
Thu Dec 5 11:46:08 PST 2013


Please help to review this patch.

The integrated assembler fails to properly lex arm comments when
they are adjacent to an identifier in the input stream. The reason
is that the arm comment symbol '@' is also used as symbol variant in
other assembly languages so when lexing an identifier it allows the
'@' symbol as part of the identifier.

Example:
  $ cat comment.s
  foo:
    add r0, r0 at got to parse this as a comment

  $ llvm-mc -triple armv7 comment.s
  comment.s:4:18: error: unexpected token in argument list
    add r0, r0 at got to parse this as a comment
                   ^
This should be parsed as correctly as `add r0, r0`.

This commit modifies the assembly lexer to not include the '@' symbol
in identifiers when lexing for targets that use '@' for comments.

-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
by The Linux Foundation



-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Integrated-assembler-incorrectly-lexes-ARM-style-com.patch
Type: application/octet-stream
Size: 3214 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131205/95c8aee8/attachment.obj>


More information about the llvm-commits mailing list