This class holds the attributes for a function, its return value, and its parameters. 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'.

Synopsis

Declared in <llvm/IR/Attributes.h>

class AttributeList;

Types

Type Aliases

Name

iterator

Enums

Name

AttrIndex

Member Functions

Name

Description

AttributeList [constructor]

Default constructor

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 attribute set at the given index. 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

dump

end

getAllocKind

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

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 the specified attribute is set for at least one parameter or for the return value. If Index is not nullptr, the index of a parameter with the specified attribute is provided.

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

removeAttribute

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==

operator==/!= ‐ Provide equality predicates.

operator!=

Inequality operator

Static Member Functions

Name

Description

get

get overloads

Friends

Name

Description

llvm::DenseMapInfo

An information struct used to provide DenseMap with the various necessary components for a given value type T. Enable is an optional additional parameter that is used to support SFINAE (generally using std::enable_if_t) in derived DenseMapInfo specializations; in non‐SFINAE use cases this should just be void.

llvm::AttributeSetNode

llvm::AttributeSet

This class holds the attributes for a particular argument, parameter, function, or return value. It is an immutable value type that is cheap to copy. Adding and removing enum attributes is intended to be fast, but adding and removing string or integer attributes involves a FoldingSet lookup.

llvm::AttributeListImpl

llvm::AttrBuilder

This class is used in conjunction with the Attribute::get method to create an Attribute object. The object itself is uniquified. The Builder's value, however, is not. So this can be used as a quick way to test for equality, presence of attributes, etc.

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