[llvm] r256356 - Address Sanjoy's review comments to r256326

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 18:31:20 PST 2015


Author: majnemer
Date: Wed Dec 23 20:31:20 2015
New Revision: 256356

URL: http://llvm.org/viewvc/llvm-project?rev=256356&view=rev
Log:
Address Sanjoy's review comments to r256326

Modified:
    llvm/trunk/include/llvm/IR/CallSite.h

Modified: llvm/trunk/include/llvm/IR/CallSite.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/CallSite.h?rev=256356&r1=256355&r2=256356&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/CallSite.h (original)
+++ llvm/trunk/include/llvm/IR/CallSite.h Wed Dec 23 20:31:20 2015
@@ -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();
   }




More information about the llvm-commits mailing list