mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 22:30:33 +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. llvm-svn: 201474
This commit is contained in:
parent
f0e7fa2121
commit
1ab302ffd6
@ -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