Add const overload of findRegisterUseOperand
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 8 Sep 2015 20:21:29 +0000 (20:21 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 8 Sep 2015 20:21:29 +0000 (20:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247063 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h

index 8c0b567c70837a8960bd4f96f285039ed6b082ea..b6c26ce196947154a302c9074c4ac293899eae30 100644 (file)
@@ -903,6 +903,13 @@ public:
     return (Idx == -1) ? nullptr : &getOperand(Idx);
   }
 
+  const MachineOperand *findRegisterUseOperand(
+    unsigned Reg, bool isKill = false,
+    const TargetRegisterInfo *TRI = nullptr) const {
+    return const_cast<MachineInstr *>(this)->
+      findRegisterUseOperand(Reg, isKill, TRI);
+  }
+
   /// Returns the operand index that is a def of the specified register or
   /// -1 if it is not found. If isDead is true, defs that are not dead are
   /// skipped. If Overlap is true, then it also looks for defs that merely