Holds attributes for a function, its return value, and its parameters.

Synopsis

Declared in <llvm/IR/Attributes.h>

class AttributeList;

Description

You access the attributes for each of them via an index into the AttributeList object. The function attributes are at index `AttributeList::FunctionIndex', the return value is at index `AttributeList::ReturnIndex', and the attributes for the parameters start at index `AttributeList::FirstArgIndex'.

Types

Name

Description

index_iterator

Iterator over valid attribute indexes, including FunctionIndex and argument slots.

Type Aliases

Name

Description

iterator

Iterator over attribute sets in this list.

Enums

Name

Description

AttrIndex

Indices used to address attribute sets within an AttributeList.

Member Functions

Name

Description

AttributeList [constructor]

Construct an empty attribute list.

addAllocSizeParamAttr

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

addAttributeAtIndex

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

addAttributesAtIndex

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

addDereferenceableOrNullParamAttr

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

addDereferenceableParamAttr

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

addDereferenceableRetAttr

Add the dereferenceable attribute to the return‐value attribute set. Returns a new list because attribute lists are immutable.

addFnAttribute

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

addFnAttributes

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

addParamAttribute

addParamAttribute overloads

addParamAttributes

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

addRangeRetAttr

Add the range attribute to the attribute set at the return value index. Returns a new list because attribute lists are immutable.

addRetAttribute

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

addRetAttributes

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

begin

Return an iterator to the first attribute set in this list.

dump

Dump this attribute list to stderr (for debugging).

end

Return an iterator past the last attribute set in this list.

getAllocKind

Return the allockind bits for the function, if present.

getAsString

Return the attributes at the index as a string.

getAttributeAtIndex

Return the attribute object that exists at the given index.

getAttributes

The attributes for the specified index are returned.

getDeadOnReturnInfo

Get the number of dead_on_return bytes (or zero if unknown) of an arg.

getFnAttr

Return the attribute object that exists for the function.

getFnAttrs

The function attributes are returned.

getFnStackAlignment

Get the stack alignment of the function.

getMemoryEffects

Returns memory effects of the function.

getNumAttrSets

Return the number of attribute sets stored in this list.

getParamAlignment

Return the alignment for the specified function parameter.

getParamAttr

getParamAttr overloads

getParamAttrs

The attributes for the argument or parameter at the given index are returned.

getParamByRefType

Return the byref type for the specified function parameter.

getParamByValType

Return the byval type for the specified function parameter.

getParamDereferenceableBytes

Get the number of dereferenceable bytes (or zero if unknown) of an arg.

getParamDereferenceableOrNullBytes

Get the number of dereferenceable_or_null bytes (or zero if unknown) of an arg.

getParamElementType

Return the elementtype type for the specified function parameter.

getParamInAllocaType

Return the inalloca type for the specified function parameter.

getParamNoFPClass

Get the disallowed floating‐point classes of the argument value.

getParamPreallocatedType

Return the preallocated type for the specified function parameter.

getParamRange

Get range (or std::nullopt if unknown) of an arg.

getParamStackAlignment

Return the stack alignment for the specified function parameter.

getParamStructRetType

Return the sret type for the specified function parameter.

getRawPointer

Return a raw pointer that uniquely identifies this attribute list.

getRetAlignment

Return the alignment of the return value.

getRetAttr

Return the attribute for the given attribute kind for the return value.

getRetAttrs

The attributes for the ret value are returned.

getRetDereferenceableBytes

Get the number of dereferenceable bytes (or zero if unknown) of the return value.

getRetDereferenceableOrNullBytes

Get the number of dereferenceable_or_null bytes (or zero if unknown) of the return value.

getRetNoFPClass

Get the disallowed floating‐point classes of the return value.

getRetStackAlignment

Get the stack alignment of the return value.

getUWTableKind

Get the unwind table kind requested for the function.

hasAttrSomewhere

Return true if Kind is set on any parameter or the return value.

hasAttributeAtIndex

Return true if the attribute exists at the given index.

hasAttributesAtIndex

Return true if attribute exists at the given index.

hasFnAttr

Return true if the attribute exists for the function.

hasFnAttrs

Return true the attributes exist for the function.

hasParamAttr

Return true if the attribute exists for the given argument

hasParamAttrs

Return true if attributes exists for the given argument

hasParentContext

Return true if this attribute list belongs to the LLVMContext.

hasRetAttr

Return true if the attribute exists for the return value.

hasRetAttrs

Return true if attributes exist for the return value.

indexes

Use this to iterate over the valid attribute indexes.

intersectWith

Try to intersect this AttributeList with Other. Returns std::nullopt if the two lists are inherently incompatible (imply different behavior, not just analysis).

isEmpty

Return true if there are no attributes.

print

Print this attribute list to stream O.

removeAttribute

Remove the specified attribute at the specified index from this attribute list. Returns a new list because attribute lists are immutable.

removeAttributeAtIndex

Remove the specified attribute at the specified index from this attribute list. Returns a new list because attribute lists are immutable.

removeAttributesAtIndex

removeAttributesAtIndex overloads

removeFnAttribute

Remove the specified attribute at the function index from this attribute list. Returns a new list because attribute lists are immutable.

removeFnAttributes

removeFnAttributes overloads

removeParamAttribute

Remove the specified attribute at the specified arg index from this attribute list. Returns a new list because attribute lists are immutable.

removeParamAttributes

removeParamAttributes overloads

removeRetAttribute

Remove the specified attribute at the return value index from this attribute list. Returns a new list because attribute lists are immutable.

removeRetAttributes

Remove the specified attribute at the return value index from this attribute list. Returns a new list because attribute lists are immutable.

replaceAttributeTypeAtIndex

Replace the type contained by attribute AttrKind at index ArgNo wih ReplacementTy, preserving all other attributes.

setAttributesAtIndex

Set the attribute set at the given index. Returns a new list because attribute lists are immutable.

operator==

Return true if both lists refer to the same uniquified value.

operator!=

Return true if the lists refer to different uniquified values.

Static Member Functions

Name

Description

get

get overloads

Friends

Name

Description

llvm::DenseMapInfo

Traits type that supplies DenseMap hashing and equality for value type T.

llvm::AttributeSetNode

Internal uniquified storage for an AttributeSet.

llvm::AttributeSet

Immutable set of attributes for one argument, parameter, function, or return.

llvm::AttributeListImpl

Internal uniquified storage for an AttributeList.

llvm::AttrBuilder

Mutable builder used with Attribute::get to assemble attributes.

Non-Member Functions

Name

Description

parseStatepointDirectivesFromAttrs

Parse out statepoint directives from the function attributes present in AS.

Intrinsic::getAttributes

Return the attributes for an intrinsic.

Created with MrDocs