aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-07-19 19:45:44 +0000
committerJim Grosbach <grosbach@apple.com>2011-07-19 19:45:44 +0000
commit731f2097944bfdf5b58ff1f19560a25ed15c9b2b (patch)
tree6d12658981b4faa7ed52f5e109857f7ae4e7263c
parent23336b449eee301f4c4dcabbd75dedf3c75c30fc (diff)
Tighten conditional for 'mov' cc_out.
Make sure we only clobber the cc_out operand if it is indeed a default non-setting operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135506 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/AsmParser/ARMAsmParser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 9f6bd270bd..1013ecf3ad 100644
--- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -2188,7 +2188,8 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
// to check the type of the parsed immediate operand.
if (Mnemonic == "mov" && Operands.size() > 4 &&
!static_cast<ARMOperand*>(Operands[4])->isARMSOImm() &&
- static_cast<ARMOperand*>(Operands[4])->isImm0_65535Expr()) {
+ static_cast<ARMOperand*>(Operands[4])->isImm0_65535Expr() &&
+ static_cast<ARMOperand*>(Operands[1])->getReg() == 0) {
ARMOperand *Op = static_cast<ARMOperand*>(Operands[1]);
Operands.erase(Operands.begin() + 1);
delete Op;