[PATCH] D22204: Add getReturnedArgOperand to Call/InvokeInst, CallSite

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 10 15:53:50 PDT 2016


hfinkel added inline comments.

================
Comment at: include/llvm/IR/Attributes.h:343-344
@@ -343,1 +342,4 @@
+  /// of a parameter with the specified attribute is provided.
+  bool hasAttrSomewhere(Attribute::AttrKind Kind,
+                        unsigned *Index = nullptr) const;
 
----------------
majnemer wrote:
> hfinkel wrote:
> > majnemer wrote:
> > > Maybe this interface would be nicer if it returned an `Optional<bool>`.  I think it would have minimal impact on the callers.
> > True. I'd need to update all existing callers to call hasValue(), right? I can do that separately.
> No, `Optional` has an `explicit operator bool()`.
OIC, thanks! I think I'll do this later regardless because I should, however, also rename the function when I do this. It should become something like:

  Optional<unsigned> getAttrIndex(Attribute::AttrKind Kind) const;



http://reviews.llvm.org/D22204





More information about the llvm-commits mailing list