class AttributeSet

Declaration

class AttributeSet { /* full declaration omitted */ };

Description

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.

Declared at: llvm/include/llvm/IR/Attributes.h:214

Method Overview

  • public AttributeSet(const llvm::AttributeSet &)
  • public AttributeSet()
  • public llvm::AttributeSet addAttribute(llvm::LLVMContext & C, Attribute::AttrKind Kind) const
  • public llvm::AttributeSet addAttribute(llvm::LLVMContext & C, llvm::StringRef Kind, llvm::StringRef Value = llvm::StringRef()) const
  • public llvm::AttributeSet addAttributes(llvm::LLVMContext & C, llvm::AttributeSet AS) const
  • public llvm::AttributeSet::iterator begin() const
  • public void dump() const
  • public llvm::AttributeSet::iterator end() const
  • public static llvm::AttributeSet get(llvm::LLVMContext & C, ArrayRef<llvm::Attribute> Attrs)
  • public static llvm::AttributeSet get(llvm::LLVMContext & C, const llvm::AttrBuilder & B)
  • public llvm::MaybeAlign getAlignment() const
  • public std::pair<unsigned int, Optional<unsigned int>> getAllocSizeArgs() const
  • public std::string getAsString(bool InAttrGrp = false) const
  • public llvm::Attribute getAttribute(Attribute::AttrKind Kind) const
  • public llvm::Attribute getAttribute(llvm::StringRef Kind) const
  • public llvm::Type * getByValType() const
  • public uint64_t getDereferenceableBytes() const
  • public uint64_t getDereferenceableOrNullBytes() const
  • public unsigned int getNumAttributes() const
  • public llvm::MaybeAlign getStackAlignment() const
  • public bool hasAttribute(Attribute::AttrKind Kind) const
  • public bool hasAttribute(llvm::StringRef Kind) const
  • public bool hasAttributes() const
  • public llvm::AttributeSet removeAttribute(llvm::LLVMContext & C, Attribute::AttrKind Kind) const
  • public llvm::AttributeSet removeAttribute(llvm::LLVMContext & C, llvm::StringRef Kind) const
  • public llvm::AttributeSet removeAttributes(llvm::LLVMContext & C, const llvm::AttrBuilder & AttrsToRemove) const
  • public ~AttributeSet()

Methods

AttributeSet(const llvm::AttributeSet&)

Declared at: llvm/include/llvm/IR/Attributes.h:231

Parameters

const llvm::AttributeSet&

AttributeSet()

Description

AttributeSet is a trivially copyable value type.

Declared at: llvm/include/llvm/IR/Attributes.h:230

llvm::AttributeSet addAttribute(
    llvm::LLVMContext& C,
    Attribute::AttrKind Kind) const

Description

Add an argument attribute. Returns a new set because attribute sets are immutable.

Declared at: llvm/include/llvm/IR/Attributes.h:242

Parameters

llvm::LLVMContext& C
Attribute::AttrKind Kind

llvm::AttributeSet addAttribute(
    llvm::LLVMContext& C,
    llvm::StringRef Kind,
    llvm::StringRef Value =
        llvm::StringRef()) const

Description

Add a target-dependent attribute. Returns a new set because attribute sets are immutable.

Declared at: llvm/include/llvm/IR/Attributes.h:247

Parameters

llvm::LLVMContext& C
llvm::StringRef Kind
llvm::StringRef Value = llvm::StringRef()

llvm::AttributeSet addAttributes(
    llvm::LLVMContext& C,
    llvm::AttributeSet AS) const

Description

Add attributes to the attribute set. Returns a new set because attribute sets are immutable.

Declared at: llvm/include/llvm/IR/Attributes.h:252

Parameters

llvm::LLVMContext& C
llvm::AttributeSet AS

llvm::AttributeSet::iterator begin() const

Declared at: llvm/include/llvm/IR/Attributes.h:298

void dump() const

Declared at: llvm/include/llvm/IR/Attributes.h:301

llvm::AttributeSet::iterator end() const

Declared at: llvm/include/llvm/IR/Attributes.h:299

static llvm::AttributeSet get(
    llvm::LLVMContext& C,
    ArrayRef<llvm::Attribute> Attrs)

Declared at: llvm/include/llvm/IR/Attributes.h:235

Parameters

llvm::LLVMContext& C
ArrayRef<llvm::Attribute> Attrs

static llvm::AttributeSet get(
    llvm::LLVMContext& C,
    const llvm::AttrBuilder& B)

Declared at: llvm/include/llvm/IR/Attributes.h:234

Parameters

llvm::LLVMContext& C
const llvm::AttrBuilder& B

llvm::MaybeAlign getAlignment() const

Declared at: llvm/include/llvm/IR/Attributes.h:288

std::pair<unsigned int, Optional<unsigned int>>
getAllocSizeArgs() const

Declared at: llvm/include/llvm/IR/Attributes.h:293

std::string getAsString(
    bool InAttrGrp = false) const

Declared at: llvm/include/llvm/IR/Attributes.h:294

Parameters

bool InAttrGrp = false

llvm::Attribute getAttribute(
    Attribute::AttrKind Kind) const

Description

Return the attribute object.

Declared at: llvm/include/llvm/IR/Attributes.h:283

Parameters

Attribute::AttrKind Kind

llvm::Attribute getAttribute(
    llvm::StringRef Kind) const

Description

Return the target-dependent attribute object.

Declared at: llvm/include/llvm/IR/Attributes.h:286

Parameters

llvm::StringRef Kind

llvm::Type* getByValType() const

Declared at: llvm/include/llvm/IR/Attributes.h:292

uint64_t getDereferenceableBytes() const

Declared at: llvm/include/llvm/IR/Attributes.h:290

uint64_t getDereferenceableOrNullBytes() const

Declared at: llvm/include/llvm/IR/Attributes.h:291

unsigned int getNumAttributes() const

Description

Return the number of attributes in this set.

Declared at: llvm/include/llvm/IR/Attributes.h:271

llvm::MaybeAlign getStackAlignment() const

Declared at: llvm/include/llvm/IR/Attributes.h:289

bool hasAttribute(Attribute::AttrKind Kind) const

Description

Return true if the attribute exists in this set.

Declared at: llvm/include/llvm/IR/Attributes.h:277

Parameters

Attribute::AttrKind Kind

bool hasAttribute(llvm::StringRef Kind) const

Description

Return true if the attribute exists in this set.

Declared at: llvm/include/llvm/IR/Attributes.h:280

Parameters

llvm::StringRef Kind

bool hasAttributes() const

Description

Return true if attributes exists in this set.

Declared at: llvm/include/llvm/IR/Attributes.h:274

llvm::AttributeSet removeAttribute(
    llvm::LLVMContext& C,
    Attribute::AttrKind Kind) const

Description

Remove the specified attribute from this set. Returns a new set because attribute sets are immutable.

Declared at: llvm/include/llvm/IR/Attributes.h:257

Parameters

llvm::LLVMContext& C
Attribute::AttrKind Kind

llvm::AttributeSet removeAttribute(
    llvm::LLVMContext& C,
    llvm::StringRef Kind) const

Description

Remove the specified attribute from this set. Returns a new set because attribute sets are immutable.

Declared at: llvm/include/llvm/IR/Attributes.h:262

Parameters

llvm::LLVMContext& C
llvm::StringRef Kind

llvm::AttributeSet removeAttributes(
    llvm::LLVMContext& C,
    const llvm::AttrBuilder& AttrsToRemove) const

Description

Remove the specified attributes from this set. Returns a new set because attribute sets are immutable.

Declared at: llvm/include/llvm/IR/Attributes.h:268

Parameters

llvm::LLVMContext& C
const llvm::AttrBuilder& AttrsToRemove

~AttributeSet()

Declared at: llvm/include/llvm/IR/Attributes.h:232