summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Use.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Use.cpp')
-rw-r--r--llvm/lib/IR/Use.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/IR/Use.cpp b/llvm/lib/IR/Use.cpp
index 5f01e238e04..60a0c566889 100644
--- a/llvm/lib/IR/Use.cpp
+++ b/llvm/lib/IR/Use.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/IR/Use.h"
+#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include <new>
@@ -44,6 +45,10 @@ User *Use::getUser() const {
: reinterpret_cast<User *>(const_cast<Use *>(End));
}
+unsigned Use::getOperandNo() const {
+ return this - getUser()->op_begin();
+}
+
// Sets up the waymarking algoritm's tags for a series of Uses. See the
// algorithm details here:
//
OpenPOWER on IntegriCloud