diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-22 06:02:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-22 06:02:13 +0000 |
commit | 8082c0901623a75e2eb78854f49de33a0bedf9c4 (patch) | |
tree | 29b738ccee85fcbdb29b5d80454539b9ffb9ba34 /tools | |
parent | 7bd4cc1d47651cc9efe8f3fcf4a63c24c0596cb3 (diff) | |
download | external_llvm-8082c0901623a75e2eb78854f49de33a0bedf9c4.zip external_llvm-8082c0901623a75e2eb78854f49de33a0bedf9c4.tar.gz external_llvm-8082c0901623a75e2eb78854f49de33a0bedf9c4.tar.bz2 |
implement parser support for '*' operands, as in "call *%eax".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-mc/AsmParser.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tools/llvm-mc/AsmParser.cpp b/tools/llvm-mc/AsmParser.cpp index fc226a5..c958354 100644 --- a/tools/llvm-mc/AsmParser.cpp +++ b/tools/llvm-mc/AsmParser.cpp @@ -108,7 +108,7 @@ bool AsmParser::ParseX86Operand(X86Operand &Op) { // 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 @@ bool AsmParser::ParseX86Operand(X86Operand &Op) { 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". } } |