[llvm-commits] [llvm] r163729 - /llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp

Chad Rosier mcrosier at apple.com
Wed Sep 12 11:24:26 PDT 2012


Author: mcrosier
Date: Wed Sep 12 13:24:26 2012
New Revision: 163729

URL: http://llvm.org/viewvc/llvm-project?rev=163729&view=rev
Log:
[ms-inline asm] Make the operand size directives case insensitive.

Modified:
    llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp

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=163729&r1=163728&r2=163729&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Wed Sep 12 13:24:26 2012
@@ -634,13 +634,13 @@
 /// getIntelMemOperandSize - Return intel memory operand size.
 static unsigned getIntelMemOperandSize(StringRef OpStr) {
   unsigned Size = StringSwitch<unsigned>(OpStr)
-    .Case("BYTE", 8)
-    .Case("WORD", 16)
-    .Case("DWORD", 32)
-    .Case("QWORD", 64)
-    .Case("XWORD", 80)
-    .Case("XMMWORD", 128)
-    .Case("YMMWORD", 256)
+    .Cases("BYTE", "byte", 8)
+    .Cases("WORD", "word", 16)
+    .Cases("DWORD", "dword", 32)
+    .Cases("QWORD", "qword", 64)
+    .Cases("XWORD", "xword", 80)
+    .Cases("XMMWORD", "xmmword", 128)
+    .Cases("YMMWORD", "ymmword", 256)
     .Default(0);
   return Size;
 }
@@ -744,7 +744,8 @@
   unsigned Size = getIntelMemOperandSize(Tok.getString());
   if (Size) {
     Parser.Lex();
-    assert (Tok.getString() == "PTR" && "Unexpected token!");
+    assert ((Tok.getString() == "PTR" || Tok.getString() == "ptr") &&
+            "Unexpected token!");
     Parser.Lex();
   }
 





More information about the llvm-commits mailing list