diff options
Diffstat (limited to 'llvm/lib/Target/ARM/ARMInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMInstrInfo.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.cpp b/llvm/lib/Target/ARM/ARMInstrInfo.cpp index b631124b6eb..891ae558f3d 100644 --- a/llvm/lib/Target/ARM/ARMInstrInfo.cpp +++ b/llvm/lib/Target/ARM/ARMInstrInfo.cpp @@ -423,17 +423,21 @@ ReverseBranchCondition(std::vector<MachineOperand> &Cond) const { return false; } -void ARMInstrInfo::PredicateInstruction(MachineInstr *MI, +bool ARMInstrInfo::PredicateInstruction(MachineInstr *MI, std::vector<MachineOperand> &Cond) const { unsigned Opc = MI->getOpcode(); if (Opc == ARM::B || Opc == ARM::tB) { MI->setInstrDescriptor(get(Opc == ARM::B ? ARM::Bcc : ARM::tBcc)); MI->addImmOperand(Cond[0].getImmedValue()); - return; + return true; } MachineOperand *PMO = MI->findFirstPredOperand(); - PMO->setImm(Cond[0].getImmedValue()); + if (PMO) { + PMO->setImm(Cond[0].getImmedValue()); + return true; + } + return false; } |