[llvm-dev] How do set 'nest' addribute in an indirect call?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 24 13:48:07 PDT 2017


On 24 August 2017 at 13:43, Rodney M. Bates <rodney_bates at lcwb.coop> wrote:
> I don't find LLVMAddCallSiteAttribute or anything similar in include/llvm.
> (I am using 3.6.1)

It may have been added since then, it definitely exists in trunk.

>  /// addAttribute - adds the attribute to the list of attributes.
>   void addAttribute(unsigned i, Attribute::AttrKind attr);
>
> Is 'i' the number of the parameter that gets the attribute?  This matters
> for 'nest'. Is it zero-origin numbering, left-to-right?

I believe 0 is the return and args start at 1 (see
include/llvm/IR/Attributes.h, especially the AttrIndex enum).

> I have an out-of-tree binding already for a small set of things not in
> Core.h, and it's not hard to add things in ones & twos.

Oh good, that'll make using a slightly older version less of a
disaster and more an inconvenience.

Cheers.

Tim.


More information about the llvm-dev mailing list