[PATCH] D14305: [IR] Add a `data_ops` abstraction
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 3 19:53:22 PST 2015
sanjoy marked an inline comment as done.
================
Comment at: include/llvm/IR/CallSite.h:173
@@ +172,3 @@
+ IterTy data_op_begin() const {
+ assert(getInstruction() && "Not a call or invoke instruction!");
+ return (*this)->op_begin();
----------------
reames wrote:
> Why have this assert here and no where else?
These iterators are basically just copied over from the `arg_xx` iterators. :)
I'll add the assert to each of the iterator accessors.
================
Comment at: include/llvm/IR/CallSite.h:268
@@ +267,3 @@
+ /// \brief Return true if the data operand (i.e. call / invoke argument or
+ /// bundle operand) at index \p i has the attribute \p A.
+ bool dataOperandHasImpliedAttr(unsigned i, Attribute::AttrKind A) const {
----------------
reames wrote:
> Stale comment?
Why stale?
================
Comment at: lib/IR/Instructions.cpp:350
@@ +349,3 @@
+
+ if (i < (getNumArgOperands() + 1))
+ return paramHasAttr(i, A);
----------------
reames wrote:
> This would also catch FunctionIndex. Intentional?
It won't since the index is unsigned.
http://reviews.llvm.org/D14305
More information about the llvm-commits
mailing list