mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-01 00:02:16 +00:00
MC asm parser macro argument count was wrong when empty.
evaluated to '1' when the argument list was empty (should be '0'). rdar://11057257 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152967 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5aeff3171c
commit
ae151ed87d
@ -1528,6 +1528,11 @@ bool AsmParser::HandleMacroEntry(StringRef Name, SMLoc NameLoc,
|
||||
}
|
||||
Lex();
|
||||
}
|
||||
// If there weren't any arguments, erase the token vector so everything
|
||||
// else knows that. Leaving around the vestigal empty token list confuses
|
||||
// things.
|
||||
if (MacroArguments.size() == 1 && MacroArguments.back().empty())
|
||||
MacroArguments.clear();
|
||||
|
||||
// Macro instantiation is lexical, unfortunately. We construct a new buffer
|
||||
// to hold the macro body with substitutions.
|
||||
|
@ -8,3 +8,13 @@
|
||||
GET is_sse, %eax
|
||||
|
||||
// CHECK: movl is_sse@GOTOFF(%ebx), %eax
|
||||
|
||||
.macro bar
|
||||
.long $n
|
||||
.endm
|
||||
|
||||
bar 1, 2, 3
|
||||
bar
|
||||
|
||||
// CHECK: .long 3
|
||||
// CHECK: .long 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user