Address Sanjoy's review comments to r256326
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 24 Dec 2015 02:31:20 +0000 (02:31 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 24 Dec 2015 02:31:20 +0000 (02:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256356 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/CallSite.h

index 40145af67e849914f51d6bbcaeb93215e984120e..f4b8a8a5a1c93b33edf22359c8de96ed577c5ea4 100644 (file)
@@ -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();
   }