[llvm-commits] [llvm] r78642 - in /llvm/trunk: lib/Target/X86/AsmParser/X86AsmParser.cpp test/MC/AsmParser/x86_instructions.s

Daniel Dunbar daniel at zuster.org
Mon Aug 10 22:00:28 PDT 2009


Author: ddunbar
Date: Tue Aug 11 00:00:25 2009
New Revision: 78642

URL: http://llvm.org/viewvc/llvm-project?rev=78642&view=rev
Log:
llvm-mc/X86: Parse '*' correctly (in the way the matcher expects).

Modified:
    llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
    llvm/trunk/test/MC/AsmParser/x86_instructions.s

Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=78642&r1=78641&r2=78642&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Tue Aug 11 00:00:25 2009
@@ -263,17 +263,6 @@
     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 @@
 
   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()))

Modified: llvm/trunk/test/MC/AsmParser/x86_instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/x86_instructions.s?rev=78642&r1=78641&r2=78642&view=diff

==============================================================================
--- llvm/trunk/test/MC/AsmParser/x86_instructions.s (original)
+++ llvm/trunk/test/MC/AsmParser/x86_instructions.s Tue Aug 11 00:00:25 2009
@@ -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





More information about the llvm-commits mailing list