Vesa Norilo
2013-Jul-05 21:50 UTC
[LLVMdev] Building function parameter AttributeSets quickly
Hi all, Is there an efficient way to construct an AttributeSet for the purpose of constructing a Function? The only (public) way I've found to designate the parameter index of attributes is via the addAttribute methods of the Function class or the AttributeSet. This is quite inefficient as a new AttributeSet is constructed every time. In fact, it takes the bulk of the time my codegen consumes when dealing with large parameter sets. "HowToUseAttributes" suggests that AttrBuilder can be used as a mutable helper for this purpose. However, it seems to me that this can build the set of attributes that describe a single parameter, rather than a full set with indices. I'm essentially looking for something like: static AttributeSet get(LLVMContext &C, ArrayRef<std::pair<unsigned, Attribute> > Attrs); But it is marked private. Am I just missing the right way to do this? Thanks! Vesa
Seemingly Similar Threads
- [LLVMdev] attributes helper functions - please review
- [LLVMdev] Using the New Attributes Classes
- [LLVMdev] Using the New Attributes Classes
- [LLVMdev] Question about changes to llvm::Argument::addAttr(AttributeSet AS) API
- [LLVMdev] Question about changes to llvm::Argument::addAttr(AttributeSet AS) API