mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
MCAsmParser: relax declaration parsing
The Linux kernel defines empty macros for compatibility with ARM UAL syntax. The comma after the name is optional, and if present can be safely lexed. This improves compatibility with the GNU assembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201474 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1edea19210
commit
5a39da0a6f
@ -3152,12 +3152,15 @@ bool AsmParser::parseDirectiveMacrosOnOff(StringRef Directive) {
|
||||
}
|
||||
|
||||
/// parseDirectiveMacro
|
||||
/// ::= .macro name [parameters]
|
||||
/// ::= .macro name[,] [parameters]
|
||||
bool AsmParser::parseDirectiveMacro(SMLoc DirectiveLoc) {
|
||||
StringRef Name;
|
||||
if (parseIdentifier(Name))
|
||||
return TokError("expected identifier in '.macro' directive");
|
||||
|
||||
if (getLexer().is(AsmToken::Comma))
|
||||
Lex();
|
||||
|
||||
MCAsmMacroParameters Parameters;
|
||||
while (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
MCAsmMacroParameter Parameter;
|
||||
|
10
test/MC/AsmParser/macros-argument-parsing.s
Normal file
10
test/MC/AsmParser/macros-argument-parsing.s
Normal file
@ -0,0 +1,10 @@
|
||||
# RUN: llvm-mc -triple i386 -filetype asm -o - %s | FileCheck %s
|
||||
|
||||
.macro it, cond
|
||||
.endm
|
||||
|
||||
it ne
|
||||
.long 1
|
||||
|
||||
# CHECK: .long 1
|
||||
|
Loading…
Reference in New Issue
Block a user