[llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp
Evan Cheng
evan.cheng at apple.com
Tue May 29 11:33:34 PDT 2007
Changes in directory llvm/lib/CodeGen:
MachineInstr.cpp updated: 1.150 -> 1.151
---
Log message:
Add missing const qualifiers.
---
Diffs of the changes: (+8 -7)
MachineInstr.cpp | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
Index: llvm/lib/CodeGen/MachineInstr.cpp
diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.150 llvm/lib/CodeGen/MachineInstr.cpp:1.151
--- llvm/lib/CodeGen/MachineInstr.cpp:1.150 Wed May 16 15:55:34 2007
+++ llvm/lib/CodeGen/MachineInstr.cpp Tue May 29 13:33:12 2007
@@ -191,9 +191,9 @@
/// findRegisterUseOperandIdx() - Returns the MachineOperand 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.
-int MachineInstr::findRegisterUseOperandIdx(unsigned Reg, bool isKill) {
+int MachineInstr::findRegisterUseOperandIdx(unsigned Reg, bool isKill) const {
for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
- MachineOperand &MO = getOperand(i);
+ const MachineOperand &MO = getOperand(i);
if (MO.isReg() && MO.isUse() && MO.getReg() == Reg)
if (!isKill || MO.isKill())
return i;
@@ -212,17 +212,18 @@
return NULL;
}
-/// findFirstPredOperand() - Find the first operand in the operand list that
-// is used to represent the predicate.
-MachineOperand *MachineInstr::findFirstPredOperand() {
+/// findFirstPredOperandIdx() - Find the index of the first operand in the
+/// operand list that is used to represent the predicate. It returns -1 if
+/// none is found.
+int MachineInstr::findFirstPredOperandIdx() const {
const TargetInstrDescriptor *TID = getInstrDescriptor();
if (TID->Flags & M_PREDICABLE) {
for (unsigned i = 0, e = getNumOperands(); i != e; ++i)
if ((TID->OpInfo[i].Flags & M_PREDICATE_OPERAND))
- return &getOperand(i);
+ return i;
}
- return NULL;
+ return -1;
}
/// copyKillDeadInfo - Copies kill / dead operand properties from MI.
More information about the llvm-commits
mailing list