mirror of
https://github.com/RPCSX/llvm.git
synced 2025-03-05 19:38:13 +00:00
Change findRegisterUseOperand() to return operand index instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35363 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c6b9ef80a8
commit
32eb1f1ca4
@ -390,10 +390,10 @@ public:
|
||||
delete removeFromParent();
|
||||
}
|
||||
|
||||
/// findRegisterUseOperand() - Returns the MachineOperand that is a use of
|
||||
/// the specific register or NULL if it is not found. It further tightening
|
||||
/// findRegisterUseOperand() - Returns the operand index that is a use of
|
||||
/// the specific register or -1 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);
|
||||
int 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,16 +170,16 @@ 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. It further tightening
|
||||
/// the specific register or -1 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){
|
||||
int 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)
|
||||
if (!isKill || MO.isKill())
|
||||
return &MO;
|
||||
return i;
|
||||
}
|
||||
return NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// findRegisterDefOperand() - Returns the MachineOperand that is a def of
|
||||
|
Loading…
x
Reference in New Issue
Block a user