Add a helper method.
authorChris Lattner <sabre@nondot.org>
Fri, 5 May 2006 00:51:42 +0000 (00:51 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 5 May 2006 00:51:42 +0000 (00:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28114 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Use.h

index eeff52fcb6a4e1797fe3a846340db95b7440dcfc..e817601f80cdda62bf433fe9fe30a65dff769bce 100644 (file)
@@ -140,6 +140,12 @@ public:
   UserTy *operator->() const { return operator*(); }
 
   Use &getUse() const { return *U; }
+  
+  /// getOperandNo - Return the operand # of this use in its User.
+  ///
+  unsigned getOperandNo() const {
+    return U - U->getUser()->op_begin();
+  }
 };