llvm::AttrBuilder

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

Synopsis

Declared in <llvm/IR/Attributes.h>

class AttrBuilder;

Description

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.

Member Functions

NameDescription
AttrBuilder [constructor]Constructors
addAlignmentAttr addAlignmentAttr overloads
addAllocKindAttr Encode an alloc_kind attribute from the given allocator-function kind.
addAllocSizeAttr This turns one (or two) ints into the form used internally in Attribute.
addAllocSizeAttrFromRawRepr Add an allocsize attribute, using the representation returned by Attribute.getIntValue().
addAttribute addAttribute overloads
addByRefAttr This turns a byref type into the form used internally in Attribute.
addByValAttr This turns a byval type into the form used internally in Attribute.
addCapturesAttr Add captures attribute.
addConstantRangeAttr Add a ConstantRange attribute with the given range.
addConstantRangeListAttr Add a ConstantRangeList attribute with the given ranges.
addDeadOnReturnAttr This turns the number of dead_on_return bytes into the form used internally in Attribute.
addDenormalFPEnvAttr Add denormal_fpenv attribute.
addDereferenceableAttr This turns the number of dereferenceable bytes into the form used internally in Attribute.
addDereferenceableOrNullAttr This turns the number of dereferenceable_or_null bytes into the form used internally in Attribute.
addFromEquivalentMetadata Add parameter attributes equivalent to metadata on instruction I.
addInAllocaAttr This turns an inalloca type into the form used internally in Attribute.
addInitializesAttr Add initializes attribute.
addMemoryAttr Add memory effect attribute.
addNoFPClassAttr Add a nofpclass attribute excluding classes in NoFPClassMask.
addPreallocatedAttr This turns a preallocated type into the form used internally in Attribute.
addRangeAttr Add range attribute.
addRawIntAttr Add integer attribute with raw value (packed/encoded if necessary).
addStackAlignmentAttr addStackAlignmentAttr overloads
addStructRetAttr This turns a sret type into the form used internally in Attribute.
addTypeAttr Add a type attribute with the given type.
addUWTableAttr This turns the unwind table kind into the form used internally in Attribute.
addVScaleRangeAttr This turns two ints into the form used internally in Attribute.
addVScaleRangeAttrFromRawRepr Add a vscale_range attribute, using the representation returned by Attribute.getIntValue().
attrs Return the attributes currently stored in this builder.
clear Remove all attributes from the builder.
contains contains overloads
getAlignment Retrieve the alignment attribute, if it exists.
getAllocSizeArgs Retrieve the allocsize args, or std::nullopt if the attribute does not exist.
getAttribute Return Attribute with the given Kind. The returned attribute will be invalid if the Kind is not present in the builder.
getByRefType Retrieve the byref type.
getByValType Retrieve the byval type.
getDereferenceableBytes Retrieve the number of dereferenceable bytes, if the dereferenceable attribute exists (zero is returned otherwise).
getDereferenceableOrNullBytes Retrieve the number of dereferenceable_or_null bytes, if the dereferenceable_or_null attribute exists (zero is returned otherwise).
getInAllocaType Retrieve the inalloca type.
getNoFPClass Retrieve the bitmask for nofpclass, if the nofpclass attribute exists (fcNone is returned otherwise).
getPreallocatedType Retrieve the preallocated type.
getRange Retrieve the range if the attribute exists (std::nullopt is returned otherwise).
getRawIntAttr Return raw (possibly packed/encoded) value of integer attribute or std::nullopt if not set.
getStackAlignment Retrieve the stack alignment attribute, if it exists.
getStructRetType Retrieve the sret type.
getTypeAttr Retrieve type for the given type attribute.
hasAttributes Return true if the builder has IR-level attributes.
merge Add the attributes from the builder. Attributes in the passed builder overwrite attributes in this builder if they have the same key.
overlaps Return true if the builder has any attribute that's in the specified builder.
remove Remove the attributes from the builder.
removeAttribute removeAttribute overloads
operator== Return true if this builder's attributes equal those in B.
operator!= Return true if this builder's attribute set differs from B.

Non-Member Functions

NameDescription
UpgradeAttributesUpgrade attributes that changed format or kind.
codegen::renderBoolStringAttrAdd a boolean string attribute named Name with value Val to B.