[PATCH] Integrated assembler incorrectly lexes ARM-style comments

Saleem Abdulrasool compnerd at compnerd.org
Thu Dec 5 23:12:20 PST 2013


On Thu, Dec 5, 2013 at 11:46 AM, David Peixotto <dpeixott at codeaurora.org>wrote:

> 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.
>

Am I missing something or does this actually break handling for PLT and GOT
relative symbols?  (e.g. sym at GOT).  This would prevent usage of the IAS
with PIC code for ELF targets then I suspect.


> 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
>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131205/f8310f42/attachment.html>


More information about the llvm-commits mailing list