[MC] Allowing the use of $-prefixed integer as asm identifiers
authorLucas Prates <lucas.prates@arm.com>
Mon, 10 Feb 2020 16:48:25 +0000 (16:48 +0000)
committerLucas Prates <lucas.prates@arm.com>
Fri, 6 Mar 2020 16:27:51 +0000 (16:27 +0000)
commit0ba553d153e65b283c7934c3f061ad0487f03ba6
tree91f835b95d2d09c8819865c3314dd117c8e85c9c
parentaf1c2e561e5fbd584093b1200cf364fe1b7ec7c4
[MC] Allowing the use of $-prefixed integer as asm identifiers

Summary:
Dollar signed prefixed integers were not allowed by the AsmParser to be
used as Identifiers, differing from the GNU assembler behavior.

This patch updates the parsing of Identifiers to consider such cases as
valid, where the identifier string includes the $ prefix itself. As the
Lexer currently splits these occurrences into separate tokens, those
need to be combined by the AsmParser itself.

Reviewers: efriedma, chill

Reviewed By: efriedma

Subscribers: sdardis, hiraditya, jrtc27, atanasyan, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75111
llvm/lib/MC/MCParser/AsmParser.cpp
llvm/test/MC/ARM/arm-branches.s
llvm/test/MC/MachO/bad-dollar.s [deleted file]
llvm/test/MC/MachO/dollar-identifier.s [new file with mode: 0644]
llvm/test/MC/Mips/cpsetup-bad.s
llvm/test/MC/Mips/invalid-instructions-spellcheck.s