[llvm] r247063 - Add const overload of findRegisterUseOperand

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 13:21:29 PDT 2015


Author: arsenm
Date: Tue Sep  8 15:21:29 2015
New Revision: 247063

URL: http://llvm.org/viewvc/llvm-project?rev=247063&view=rev
Log:
Add const overload of findRegisterUseOperand

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineInstr.h

Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=247063&r1=247062&r2=247063&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Tue Sep  8 15:21:29 2015
@@ -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




More information about the llvm-commits mailing list