diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index 210f3b1f8a2..312e6c33dd8 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -259,7 +259,8 @@ public: /// findTiedToSrcOperand - Returns the operand that is tied to the specified /// dest operand. Returns -1 if there isn't one. - int findTiedToSrcOperand(MachineOpCode Opcode, unsigned OpNum) const; + int findTiedToSrcOperand(const TargetInstrDescriptor *TID, + unsigned OpNum) const; /// getDWARF_LABELOpcode - Return the opcode of the target's DWARF_LABEL /// instruction if it has one. This is used by codegen passes that update diff --git a/lib/Target/TargetInstrInfo.cpp b/lib/Target/TargetInstrInfo.cpp index c29b1c54b4f..0e79baac7c9 100644 --- a/lib/Target/TargetInstrInfo.cpp +++ b/lib/Target/TargetInstrInfo.cpp @@ -27,13 +27,12 @@ TargetInstrInfo::~TargetInstrInfo() { /// findTiedToSrcOperand - Returns the operand that is tied to the specified /// dest operand. Returns -1 if there isn't one. -int -TargetInstrInfo::findTiedToSrcOperand(MachineOpCode Opc, unsigned OpNum) const { - for (unsigned i = 0, e = getNumOperands(Opc); i != e; ++i) { +int TargetInstrInfo::findTiedToSrcOperand(const TargetInstrDescriptor *TID, + unsigned OpNum) const { + for (unsigned i = 0, e = TID->numOperands; i != e; ++i) { if (i == OpNum) continue; - int ti = getOperandConstraint(Opc, i, TOI::TIED_TO); - if (ti == (int)OpNum) + if (TID->getOperandConstraint(i, TOI::TIED_TO) == (int)OpNum) return i; } return -1;