llvm::AttributeList::addFnAttribute

Add a function attribute to the list. Returns a new list because attribute lists are immutable.

Synopses

Declared in <llvm/IR/Attributes.h>

Add a function attribute to the list. Returns a new list because attribute lists are immutable.

[[nodiscard]]
AttributeList
addFnAttribute(
    LLVMContext& C,
    Attribute::AttrKind Kind) const;
» more...

Add a function attribute to the list. Returns a new list because attribute lists are immutable.

[[nodiscard]]
AttributeList
addFnAttribute(
    LLVMContext& C,
    Attribute Attr) const;
» more...

Add a function attribute to the list. Returns a new list because attribute lists are immutable.

[[nodiscard]]
AttributeList
addFnAttribute(
    LLVMContext& C,
    StringRef Kind,
    StringRef Value = StringRef()) const;
» more...

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.
KindEnum attribute kind to add.
AttrAttribute to add at the function index.
ValueAttribute value string.