[llvm-commits] [llvm] r73876 - /llvm/trunk/tools/llvm-mc/AsmParser.cpp
Chris Lattner
sabre at nondot.org
Sun Jun 21 23:02:13 PDT 2009
Author: lattner
Date: Mon Jun 22 01:02:13 2009
New Revision: 73876
URL: http://llvm.org/viewvc/llvm-project?rev=73876&view=rev
Log:
implement parser support for '*' operands, as in "call *%eax".
Modified:
llvm/trunk/tools/llvm-mc/AsmParser.cpp
Modified: llvm/trunk/tools/llvm-mc/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.cpp?rev=73876&r1=73875&r2=73876&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmParser.cpp (original)
+++ llvm/trunk/tools/llvm-mc/AsmParser.cpp Mon Jun 22 01:02:13 2009
@@ -108,7 +108,7 @@
// FIXME: Decode reg #.
// FIXME: if a segment register, this could either be just the seg reg, or
// the start of a memory operand.
- Op = X86Operand::CreateReg(0);
+ Op = X86Operand::CreateReg(123);
Lexer.Lex(); // Eat register.
return false;
case asmtok::Dollar: {
@@ -119,12 +119,19 @@
return TokError("expected integer constant");
Op = X86Operand::CreateReg(Val);
return false;
+ case asmtok::Star:
+ Lexer.Lex(); // Eat the star.
+
+ if (Lexer.is(asmtok::Register)) {
+ Op = X86Operand::CreateReg(123);
+ Lexer.Lex(); // Eat register.
+ } else if (ParseX86MemOperand(Op))
+ return true;
+
+ // FIXME: Note that these are 'dereferenced' so that clients know the '*' is
+ // there.
+ return false;
}
-
- //case asmtok::Star:
- // * %eax
- // * <memaddress>
- // Note that these are both "dereferenced".
}
}
More information about the llvm-commits
mailing list