mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
Use findRegisterUseOperand to find a kill of particular register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34512 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -390,8 +390,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// findRegisterUseOperand() - Returns the MachineOperand that is a use of
|
/// findRegisterUseOperand() - Returns the MachineOperand that is a use of
|
||||||
/// the specific register or NULL if it is not found.
|
/// the specific register or NULL if it is not found. It further tightening
|
||||||
MachineOperand *findRegisterUseOperand(unsigned Reg);
|
/// 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
|
/// findRegisterDefOperand() - Returns the MachineOperand that is a def of
|
||||||
/// the specific register or NULL if it is not found.
|
/// the specific register or NULL if it is not found.
|
||||||
|
@ -170,11 +170,13 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// findRegisterUseOperand() - Returns the MachineOperand that is a use of
|
/// findRegisterUseOperand() - Returns the MachineOperand that is a use of
|
||||||
/// the specific register or NULL if it is not found.
|
/// the specific register or NULL if it is not found. It further tightening
|
||||||
MachineOperand *MachineInstr::findRegisterUseOperand(unsigned Reg) {
|
/// 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) {
|
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
|
||||||
MachineOperand &MO = getOperand(i);
|
MachineOperand &MO = getOperand(i);
|
||||||
if (MO.isReg() && MO.isUse() && MO.getReg() == Reg)
|
if (MO.isReg() && MO.isUse() && MO.getReg() == Reg)
|
||||||
|
if (!isKill || MO.isKill())
|
||||||
return &MO;
|
return &MO;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user