[llvm-commits] [llvm] r104183 - in /llvm/trunk: lib/MC/MCParser/AsmParser.cpp test/MC/AsmParser/X86/x86_instructions.s
Chris Lattner
sabre at nondot.org
Wed May 19 16:34:33 PDT 2010
Author: lattner
Date: Wed May 19 18:34:33 2010
New Revision: 104183
URL: http://llvm.org/viewvc/llvm-project?rev=104183&view=rev
Log:
fix rdar://7986634 - match instruction opcodes case insensitively.
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=104183&r1=104182&r2=104183&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Wed May 19 18:34:33 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/trunk/test/MC/AsmParser/X86/x86_instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s?rev=104183&r1=104182&r2=104183&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s (original)
+++ llvm/trunk/test/MC/AsmParser/X86/x86_instructions.s Wed May 19 18:34:33 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-commits
mailing list