[llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp

Evan Cheng evan.cheng at apple.com
Mon Mar 26 15:38:05 PDT 2007



Changes in directory llvm/lib/CodeGen:

MachineInstr.cpp updated: 1.145 -> 1.146
---
Log message:

Change findRegisterUseOperand() to return operand index instead.

---
Diffs of the changes:  (+4 -4)

 MachineInstr.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.145 llvm/lib/CodeGen/MachineInstr.cpp:1.146
--- llvm/lib/CodeGen/MachineInstr.cpp:1.145	Thu Feb 22 19:04:26 2007
+++ llvm/lib/CodeGen/MachineInstr.cpp	Mon Mar 26 17:37:45 2007
@@ -170,16 +170,16 @@
 }
 
 /// 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






More information about the llvm-commits mailing list