From 8aba79723798add31648c688d7ff894385768973 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 24 Dec 2015 02:31:20 +0000 Subject: [PATCH 1/1] Address Sanjoy's review comments to r256326 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256356 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/CallSite.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/llvm/IR/CallSite.h b/include/llvm/IR/CallSite.h index 40145af67e8..f4b8a8a5a1c 100644 --- a/include/llvm/IR/CallSite.h +++ b/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(); } -- 2.34.1