[llvm-branch-commits] [llvm-branch] r104340 - in /llvm/branches/Apple/whitney: lib/MC/MCParser/AsmParser.cpp test/MC/AsmParser/X86/x86_instructions.s

Daniel Dunbar daniel at zuster.org
Fri May 21 12:05:56 PDT 2010


Author: ddunbar
Date: Fri May 21 14:05:56 2010
New Revision: 104340

URL: http://llvm.org/viewvc/llvm-project?rev=104340&view=rev
Log:
fix rdar://7986634 - match instruction opcodes case insensitively.

Modified:
    llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp
    llvm/branches/Apple/whitney/test/MC/AsmParser/X86/x86_instructions.s

Modified: llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp?rev=104340&r1=104339&r2=104340&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/branches/Apple/whitney/lib/MC/MCParser/AsmParser.cpp Fri May 21 14:05:56 2010
@@ -783,8 +783,13 @@
     return false;
   }
 
+  // Canonicalize the opcode to lower case.
+  SmallString<128> Opcode;
+  for (unsigned i = 0, e = IDVal.size(); i != e; ++i)
+    Opcode.push_back(tolower(IDVal[i]));
+  
   SmallVector<MCParsedAsmOperand*, 8> ParsedOperands;
-  bool HadError = getTargetParser().ParseInstruction(IDVal, IDLoc,
+  bool HadError = getTargetParser().ParseInstruction(Opcode.str(), IDLoc,
                                                      ParsedOperands);
   if (!HadError && Lexer.isNot(AsmToken::EndOfStatement))
     HadError = TokError("unexpected token in argument list");

Modified: llvm/branches/Apple/whitney/test/MC/AsmParser/X86/x86_instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/test/MC/AsmParser/X86/x86_instructions.s?rev=104340&r1=104339&r2=104340&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/test/MC/AsmParser/X86/x86_instructions.s (original)
+++ llvm/branches/Apple/whitney/test/MC/AsmParser/X86/x86_instructions.s Fri May 21 14:05:56 2010
@@ -146,3 +146,8 @@
 
 // CHECK: leal 0, %eax
         leal 0, %eax
+
+// rdar://7986634 - Insensitivity on opcodes.
+// CHECK: int3
+INT3
+





More information about the llvm-branch-commits mailing list