[llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp
Evan Cheng
evan.cheng at apple.com
Sat Feb 17 03:10:37 PST 2007
Changes in directory llvm/lib/CodeGen:
MachineInstr.cpp updated: 1.141 -> 1.142
---
Log message:
Added findRegisterDefOperand().
---
Diffs of the changes: (+11 -0)
MachineInstr.cpp | 11 +++++++++++
1 files changed, 11 insertions(+)
Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.141 llvm/lib/CodeGen/MachineInstr.cpp:1.142
--- llvm/lib/CodeGen/MachineInstr.cpp:1.141 Fri Feb 16 03:49:18 2007
+++ llvm/lib/CodeGen/MachineInstr.cpp Sat Feb 17 05:10:18 2007
@@ -180,6 +180,17 @@
return NULL;
}
+/// findRegisterDefOperand() - Returns the MachineOperand that is a def of
+/// the specific register or NULL if it is not found.
+MachineOperand *MachineInstr::findRegisterDefOperand(unsigned Reg) {
+ for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
+ MachineOperand &MO = getOperand(i);
+ if (MO.isReg() && MO.isDef() && MO.getReg() == Reg)
+ return &MO;
+ }
+ return NULL;
+}
+
/// copyKillDeadInfo - Copies kill / dead operand properties from MI.
///
void MachineInstr::copyKillDeadInfo(const MachineInstr *MI) {
More information about the llvm-commits
mailing list