diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-03-26 22:37:45 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-03-26 22:37:45 +0000 |
| commit | 32eb1f1ca4220d2f24916e587ad7e8574d7d82a1 (patch) | |
| tree | f481c5ae7219cd9c5432bc325e8d2577c9f705d7 /lib/CodeGen/MachineInstr.cpp | |
| parent | c6b9ef80a890fcf75f18cabc3fe2d5f9ef2faaf5 (diff) | |
Change findRegisterUseOperand() to return operand index instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35363 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
| -rw-r--r-- | lib/CodeGen/MachineInstr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp index 8c5da0272f..a1e76916f1 100644 --- a/lib/CodeGen/MachineInstr.cpp +++ b/lib/CodeGen/MachineInstr.cpp @@ -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 |
