Thumb2 tweak for ccout handling in RSB parsing.
authorJim Grosbach <grosbach@apple.com>
Tue, 13 Dec 2011 21:06:41 +0000 (21:06 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 13 Dec 2011 21:06:41 +0000 (21:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146516 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp

index f6827809cd711364b30bfdec9dabf59bb5b22554..643ba71ac5cbcd61cc764a33a82457577e84fdf1 100644 (file)
@@ -4737,8 +4737,11 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
     const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Op->getImm());
     if (CE && CE->getValue() == 0 &&
         (isThumbOne() ||
+         // The cc_out operand matches the IT block.
+         ((inITBlock() != CarrySetting) &&
+         // Neither register operand is a high register.
          (isARMLowRegister(static_cast<ARMOperand*>(Operands[3])->getReg()) &&
-          isARMLowRegister(static_cast<ARMOperand*>(Operands[4])->getReg())))) {
+          isARMLowRegister(static_cast<ARMOperand*>(Operands[4])->getReg()))))){
       Operands.erase(Operands.begin() + 5);
       Operands.push_back(ARMOperand::CreateToken("#0", Op->getStartLoc()));
       delete Op;