forked from OSchip/llvm-project
Use findRegisterUseOperand to find a kill of particular register.
llvm-svn: 34512
This commit is contained in:
parent
956fdeb694
commit
9965aebd5d
|
@ -390,8 +390,9 @@ public:
|
|||
}
|
||||
|
||||
/// findRegisterUseOperand() - Returns the MachineOperand that is a use of
|
||||
/// the specific register or NULL if it is not found.
|
||||
MachineOperand *findRegisterUseOperand(unsigned Reg);
|
||||
/// the specific register or NULL if it is not found. It further tightening
|
||||
/// the search criteria to a use that kills the register if isKill is true.
|
||||
MachineOperand *findRegisterUseOperand(unsigned Reg, bool isKill = false);
|
||||
|
||||
/// findRegisterDefOperand() - Returns the MachineOperand that is a def of
|
||||
/// the specific register or NULL if it is not found.
|
||||
|
|
|
@ -170,12 +170,14 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const {
|
|||
}
|
||||
|
||||
/// findRegisterUseOperand() - Returns the MachineOperand that is a use of
|
||||
/// the specific register or NULL if it is not found.
|
||||
MachineOperand *MachineInstr::findRegisterUseOperand(unsigned Reg) {
|
||||
/// the specific register or NULL if it is not found. It further tightening
|
||||
/// the search criteria to a use that kills the register if isKill is true.
|
||||
MachineOperand *MachineInstr::findRegisterUseOperand(unsigned Reg, bool isKill){
|
||||
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
|
||||
MachineOperand &MO = getOperand(i);
|
||||
if (MO.isReg() && MO.isUse() && MO.getReg() == Reg)
|
||||
return &MO;
|
||||
if (!isKill || MO.isKill())
|
||||
return &MO;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue