summaryrefslogtreecommitdiff
path: root/lib/MC/MCParser/AsmParser.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-02-16 04:56:31 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-02-16 04:56:31 +0000
commit5a39da0a6fbef90d697054c6075bf5e3ef708c9d (patch)
treead0f5b1c5b494b60f0f211342c0ec2d18e9f3376 /lib/MC/MCParser/AsmParser.cpp
parent1edea19210df055ad24dfd18c23973c3668ac738 (diff)
downloadllvm-5a39da0a6fbef90d697054c6075bf5e3ef708c9d.tar.gz
llvm-5a39da0a6fbef90d697054c6075bf5e3ef708c9d.tar.bz2
llvm-5a39da0a6fbef90d697054c6075bf5e3ef708c9d.tar.xz
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
Diffstat (limited to 'lib/MC/MCParser/AsmParser.cpp')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index 5f92795b49..03b004ecfa 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -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;