From: David Majnemer Date: Thu, 24 Dec 2015 02:31:20 +0000 (+0000) Subject: Address Sanjoy's review comments to r256326 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=8aba79723798add31648c688d7ff894385768973;hp=c2a378514142a08dead206a95a967095a4e0d7eb Address Sanjoy's review comments to r256326 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256356 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(); }