mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-20 08:54:08 +00:00
llvm-mc/X86: Parse '*' correctly (in the way the matcher expects).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78642 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1e840b2c61
commit
0db68f4e3a
@ -263,17 +263,6 @@ bool X86ATTAsmParser::ParseOperand(X86Operand &Op) {
|
||||
Op = X86Operand::CreateImm(Val);
|
||||
return false;
|
||||
}
|
||||
case AsmToken::Star:
|
||||
getLexer().Lex(); // Eat the star.
|
||||
|
||||
if (getLexer().is(AsmToken::Register)) {
|
||||
if (ParseRegister(Op))
|
||||
return true;
|
||||
} else if (ParseMemOperand(Op))
|
||||
return true;
|
||||
|
||||
// FIXME: Note the '*' in the operand for use by the matcher.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -406,6 +395,13 @@ bool X86ATTAsmParser::ParseInstruction(const StringRef &Name, MCInst &Inst) {
|
||||
|
||||
SMLoc Loc = getLexer().getTok().getLoc();
|
||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||
|
||||
// Parse '*' modifier.
|
||||
if (getLexer().is(AsmToken::Star)) {
|
||||
getLexer().Lex(); // Eat the star.
|
||||
Operands.push_back(X86Operand::CreateToken("*"));
|
||||
}
|
||||
|
||||
// Read the first operand.
|
||||
Operands.push_back(X86Operand());
|
||||
if (ParseOperand(Operands.back()))
|
||||
|
@ -49,3 +49,6 @@
|
||||
// RUN: grep {MCInst(opcode=.*, operands=.reg:21, reg:0, reg:19.)} %t
|
||||
subl %eax, %ebx
|
||||
|
||||
// FIXME: Check that this matches the correct instruction.
|
||||
// RUN: grep {MCInst(opcode=.*, operands=.reg:80.)} %t
|
||||
call *%rax
|
||||
|
Loading…
x
Reference in New Issue
Block a user