[FunctionAttrs] Add comment and clarify assertion message; NFC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Sat, 7 Nov 2015 01:56:07 +0000 (01:56 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Sat, 7 Nov 2015 01:56:07 +0000 (01:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252389 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/FunctionAttrs.cpp

index b63ffb4a72cab791f9f13246eaa0931c8cfebea9..907cede8e5c0a789e186f1a435e130b4159b868f 100644 (file)
@@ -457,7 +457,12 @@ determinePointerReadAttrs(Argument *A,
 
       unsigned UseIndex = std::distance(CS.arg_begin(), U);
 
-      assert(UseIndex < CS.data_operands_size() && "Non-argument use?");
+      // U cannot be the callee operand use: since we're exploring the
+      // transitive uses of an Argument, having such a use be a callee would
+      // imply the CallSite is an indirect call or invoke; and we'd take the
+      // early exit above.
+      assert(UseIndex < CS.data_operands_size() &&
+             "Data operand use expected!");
 
       bool IsOperandBundleUse = UseIndex >= CS.getNumArgOperands();