Use MI's TargetInstrDescriptor.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 8 Dec 2006 07:57:56 +0000 (07:57 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 8 Dec 2006 07:57:56 +0000 (07:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32352 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetInstrInfo.h
lib/Target/TargetInstrInfo.cpp

index 210f3b1f8a2e425f64dccc70349238ac3c3ccf06..312e6c33dd8c3183784b884fb0b2392fe4af1aff 100644 (file)
@@ -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
index c29b1c54b4f0f954d957bd2a243eaab563590974..0e79baac7c919891b44a5305ad61fe2636f5d940 100644 (file)
@@ -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;