From 5797a2934c92120d968cdde213ea50076a3e0c0a Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 24 Dec 2015 02:31:20 +0000 Subject: [PATCH] Address Sanjoy's review comments to r256326 llvm-svn: 256356 --- llvm/include/llvm/IR/CallSite.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/IR/CallSite.h b/llvm/include/llvm/IR/CallSite.h index 40145af67e84..f4b8a8a5a1c9 100644 --- a/llvm/include/llvm/IR/CallSite.h +++ b/llvm/include/llvm/IR/CallSite.h @@ -126,6 +126,7 @@ public: /// \brief Determine whether the passed use points to an argument operand. bool isArgOperand(const Use *U) const { + assert(getInstruction() == U->getUser()); return arg_begin() <= U && U < arg_end(); } @@ -136,9 +137,10 @@ public: /// \brief Determine whether the passed use points to a bundle operand. bool isBundleOperand(const Use *U) const { + assert(getInstruction() == U->getUser()); if (!hasOperandBundles()) return false; - unsigned OperandNo = U->getOperandNo(); + unsigned OperandNo = U - (*this)->op_begin(); return getBundleOperandsStartIndex() <= OperandNo && OperandNo < getBundleOperandsEndIndex(); }