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

Rodney M. Bates via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 24 13:43:53 PDT 2017



On 08/24/2017 09:40 AM, Tim Northover wrote:
> On 17 August 2017 at 15:15, Rodney M. Bates via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
>> For an indirect call, i.e., on a function whose address is runtime variable,
>> I can't find any place/way to attach this attribute.  LLVMAddAttribute
>> won't take a type.
>
> In the C++ API you'd add the attribute to the CallInst. I've not used
> any of the wrappers, but I think you might get what you want via
> LLVMAddCallSiteAttribute.

I don't find LLVMAddCallSiteAttribute or anything similar in include/llvm. (I am using 3.6.1)

I do see llvm::CallInst::addAttribute

  /// 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 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.


>
> Cheers.
>
> Tim.
>

-- 
Rodney Bates
rodney.m.bates at acm.org


More information about the llvm-dev mailing list