summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-05-16 21:53:07 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-05-16 21:53:07 +0000
commitdcff2eb0e87ec6255ec08ce821bdc92adea8a755 (patch)
treef3e7d086ddcf693ed2f231403c1b28b830652b73 /llvm/lib/Target/ARM
parent973c3739b07433f0fe8eca8e2da1c07cc20dbc4a (diff)
downloadbcm5719-llvm-dcff2eb0e87ec6255ec08ce821bdc92adea8a755.tar.gz
bcm5719-llvm-dcff2eb0e87ec6255ec08ce821bdc92adea8a755.zip
PredicateInstruction returns true if the operation was successful.
llvm-svn: 37124
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMInstrInfo.cpp10
-rw-r--r--llvm/lib/Target/ARM/ARMInstrInfo.h2
2 files changed, 8 insertions, 4 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;
}
diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.h b/llvm/lib/Target/ARM/ARMInstrInfo.h
index cb0b812e161..33645b2d334 100644
--- a/llvm/lib/Target/ARM/ARMInstrInfo.h
+++ b/llvm/lib/Target/ARM/ARMInstrInfo.h
@@ -104,7 +104,7 @@ public:
virtual bool ReverseBranchCondition(std::vector<MachineOperand> &Cond) const;
// Predication support.
- virtual void PredicateInstruction(MachineInstr *MI,
+ virtual bool PredicateInstruction(MachineInstr *MI,
std::vector<MachineOperand> &Cond) const;
};
OpenPOWER on IntegriCloud