mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-14 17:28:53 +00:00
Added findRegisterDefOperand().
llvm-svn: 34380
This commit is contained in:
parent
897d82c747
commit
35f59a6dd2
@ -393,6 +393,10 @@ public:
|
||||
/// the specific register or NULL if it is not found.
|
||||
MachineOperand *findRegisterUseOperand(unsigned Reg);
|
||||
|
||||
/// findRegisterDefOperand() - Returns the MachineOperand that is a def of
|
||||
/// the specific register or NULL if it is not found.
|
||||
MachineOperand *findRegisterDefOperand(unsigned Reg);
|
||||
|
||||
/// copyKillDeadInfo - Copies kill / dead operand properties from MI.
|
||||
///
|
||||
void copyKillDeadInfo(const MachineInstr *MI);
|
||||
|
@ -180,6 +180,17 @@ MachineOperand *MachineInstr::findRegisterUseOperand(unsigned Reg) {
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user