summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-05-19 23:34:33 +0000
committerChris Lattner <sabre@nondot.org>2010-05-19 23:34:33 +0000
commit7cbfa4462fdf4f042cbc3928f3275490fe644e0d (patch)
treea8a5912a752bcd810b95b722f60b5ac94479bcdb /llvm/lib/MC
parent1c4687e350e10ab3d586e9755324334f2a068b18 (diff)
downloadbcm5719-llvm-7cbfa4462fdf4f042cbc3928f3275490fe644e0d.tar.gz
bcm5719-llvm-7cbfa4462fdf4f042cbc3928f3275490fe644e0d.zip
fix rdar://7986634 - match instruction opcodes case insensitively.
llvm-svn: 104183
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 1f045ac1711..36075227b71 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -783,8 +783,13 @@ bool AsmParser::ParseStatement() {
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");
OpenPOWER on IntegriCloud