llvm::AttributeList::addAllocSizeParamAttr

Add the allocsize attribute to the attribute set at the given arg index. Returns a new list because attribute lists are immutable.

Synopsis

Declared in <llvm/IR/Attributes.h>

[[nodiscard]]
AttributeList
addAllocSizeParamAttr(
    LLVMContext& C,
    unsigned int ArgNo,
    unsigned int ElemSizeArg,
    std::optional<unsigned int> const& NumElemsArg) const;

Return Value

A new attribute list with the attributes added.

NOTE

The return value should not be discarded.

Parameters

NameDescription
CContext used to uniquify the result.
ArgNoZero-based argument index receiving the attribute.
ElemSizeArgArgument index holding the element size.
NumElemsArgOptional argument index holding the element count.