LLVM  13.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::AttributeSet Class Reference

#include "llvm/IR/Attributes.h"

Public Types

using iterator = const Attribute *
 

Public Member Functions

 AttributeSet ()=default
 AttributeSet is a trivially copyable value type. More...
 
 AttributeSet (const AttributeSet &)=default
 
 ~AttributeSet ()=default
 
bool operator== (const AttributeSet &O) const
 
bool operator!= (const AttributeSet &O) const
 
LLVM_NODISCARD AttributeSet addAttribute (LLVMContext &C, Attribute::AttrKind Kind) const
 Add an argument attribute. More...
 
LLVM_NODISCARD AttributeSet addAttribute (LLVMContext &C, StringRef Kind, StringRef Value=StringRef()) const
 Add a target-dependent attribute. More...
 
LLVM_NODISCARD AttributeSet addAttributes (LLVMContext &C, AttributeSet AS) const
 Add attributes to the attribute set. More...
 
LLVM_NODISCARD AttributeSet removeAttribute (LLVMContext &C, Attribute::AttrKind Kind) const
 Remove the specified attribute from this set. More...
 
LLVM_NODISCARD AttributeSet removeAttribute (LLVMContext &C, StringRef Kind) const
 Remove the specified attribute from this set. More...
 
LLVM_NODISCARD AttributeSet removeAttributes (LLVMContext &C, const AttrBuilder &AttrsToRemove) const
 Remove the specified attributes from this set. More...
 
unsigned getNumAttributes () const
 Return the number of attributes in this set. More...
 
bool hasAttributes () const
 Return true if attributes exists in this set. More...
 
bool hasAttribute (Attribute::AttrKind Kind) const
 Return true if the attribute exists in this set. More...
 
bool hasAttribute (StringRef Kind) const
 Return true if the attribute exists in this set. More...
 
Attribute getAttribute (Attribute::AttrKind Kind) const
 Return the attribute object. More...
 
Attribute getAttribute (StringRef Kind) const
 Return the target-dependent attribute object. More...
 
MaybeAlign getAlignment () const
 
MaybeAlign getStackAlignment () const
 
uint64_t getDereferenceableBytes () const
 
uint64_t getDereferenceableOrNullBytes () const
 
TypegetByValType () const
 
TypegetStructRetType () const
 
TypegetByRefType () const
 
TypegetPreallocatedType () const
 
TypegetInAllocaType () const
 
std::pair< unsigned, Optional< unsigned > > getAllocSizeArgs () const
 
std::pair< unsigned, unsigned > getVScaleRangeArgs () const
 
std::string getAsString (bool InAttrGrp=false) const
 
bool hasParentContext (LLVMContext &C) const
 Return true if this attribute set belongs to the LLVMContext. More...
 
iterator begin () const
 
iterator end () const
 
void dump () const
 

Static Public Member Functions

static AttributeSet get (LLVMContext &C, const AttrBuilder &B)
 
static AttributeSet get (LLVMContext &C, ArrayRef< Attribute > Attrs)
 

Friends

template<typename Ty >
struct DenseMapInfo
 

Detailed Description

Definition at line 254 of file Attributes.h.

Member Typedef Documentation

◆ iterator

Definition at line 344 of file Attributes.h.

Constructor & Destructor Documentation

◆ AttributeSet() [1/2]

llvm::AttributeSet::AttributeSet ( )
default

AttributeSet is a trivially copyable value type.

Referenced by get().

◆ AttributeSet() [2/2]

llvm::AttributeSet::AttributeSet ( const AttributeSet )
default

◆ ~AttributeSet()

llvm::AttributeSet::~AttributeSet ( )
default

Member Function Documentation

◆ addAttribute() [1/2]

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

Add an argument attribute.

Returns a new set because attribute sets are immutable.

Definition at line 737 of file Attributes.cpp.

References addAttributes(), B, get(), and hasAttribute().

◆ addAttribute() [2/2]

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

Add a target-dependent attribute.

Returns a new set because attribute sets are immutable.

Definition at line 745 of file Attributes.cpp.

References addAttributes(), B, and get().

◆ addAttributes()

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

Add attributes to the attribute set.

Returns a new set because attribute sets are immutable.

Definition at line 752 of file Attributes.cpp.

References B, get(), hasAttributes(), and I.

Referenced by addAttribute().

◆ begin()

AttributeSet::iterator AttributeSet::begin ( ) const

Definition at line 868 of file Attributes.cpp.

References llvm::AttributeSetNode::begin().

◆ dump()

LLVM_DUMP_METHOD void AttributeSet::dump ( ) const

Definition at line 877 of file Attributes.cpp.

References llvm::dbgs(), and getAsString().

◆ end()

AttributeSet::iterator AttributeSet::end ( ) const

Definition at line 872 of file Attributes.cpp.

References llvm::AttributeSetNode::end().

◆ get() [1/2]

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

Definition at line 733 of file Attributes.cpp.

References AttributeSet(), Attrs, and llvm::AttributeSetNode::get().

◆ get() [2/2]

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

◆ getAlignment()

MaybeAlign AttributeSet::getAlignment ( ) const

◆ getAllocSizeArgs()

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

◆ getAsString()

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

Definition at line 856 of file Attributes.cpp.

References llvm::AttributeSetNode::getAsString().

Referenced by dump(), and llvm::AttributeList::getAsString().

◆ getAttribute() [1/2]

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

Return the attribute object.

Definition at line 802 of file Attributes.cpp.

References llvm::AttributeSetNode::getAttribute().

Referenced by llvm::AttributeList::getAttribute().

◆ getAttribute() [2/2]

Attribute AttributeSet::getAttribute ( StringRef  Kind) const

Return the target-dependent attribute object.

Definition at line 806 of file Attributes.cpp.

References llvm::AttributeSetNode::getAttribute().

◆ getByRefType()

Type * AttributeSet::getByRefType ( ) const

◆ getByValType()

Type * AttributeSet::getByValType ( ) const

◆ getDereferenceableBytes()

uint64_t AttributeSet::getDereferenceableBytes ( ) const

◆ getDereferenceableOrNullBytes()

uint64_t AttributeSet::getDereferenceableOrNullBytes ( ) const

◆ getInAllocaType()

Type * AttributeSet::getInAllocaType ( ) const

◆ getNumAttributes()

unsigned AttributeSet::getNumAttributes ( ) const

Return the number of attributes in this set.

Definition at line 790 of file Attributes.cpp.

References llvm::AttributeSetNode::getNumAttributes().

◆ getPreallocatedType()

Type * AttributeSet::getPreallocatedType ( ) const

◆ getStackAlignment()

MaybeAlign AttributeSet::getStackAlignment ( ) const

◆ getStructRetType()

Type * AttributeSet::getStructRetType ( ) const

◆ getVScaleRangeArgs()

std::pair< unsigned, unsigned > AttributeSet::getVScaleRangeArgs ( ) const

◆ hasAttribute() [1/2]

bool AttributeSet::hasAttribute ( Attribute::AttrKind  Kind) const

◆ hasAttribute() [2/2]

bool AttributeSet::hasAttribute ( StringRef  Kind) const

Return true if the attribute exists in this set.

Definition at line 798 of file Attributes.cpp.

References llvm::AttributeSetNode::hasAttribute().

◆ hasAttributes()

bool llvm::AttributeSet::hasAttributes ( ) const
inline

Return true if attributes exists in this set.

Definition at line 314 of file Attributes.h.

Referenced by addAttributes(), llvm::AttributeList::get(), llvm::AttributeList::hasAttributes(), and hasParentContext().

◆ hasParentContext()

bool AttributeSet::hasParentContext ( LLVMContext C) const

Return true if this attribute set belongs to the LLVMContext.

Definition at line 860 of file Attributes.cpp.

References assert(), hasAttributes(), and llvm::AttributeSetNode::Profile().

◆ operator!=()

bool llvm::AttributeSet::operator!= ( const AttributeSet O) const
inline

Definition at line 278 of file Attributes.h.

References llvm::RISCVFenceField::O.

◆ operator==()

bool llvm::AttributeSet::operator== ( const AttributeSet O) const
inline

Definition at line 277 of file Attributes.h.

References llvm::RISCVFenceField::O.

◆ removeAttribute() [1/2]

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

Remove the specified attribute from this set.

Returns a new set because attribute sets are immutable.

Definition at line 767 of file Attributes.cpp.

References B, get(), and hasAttribute().

◆ removeAttribute() [2/2]

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

Remove the specified attribute from this set.

Returns a new set because attribute sets are immutable.

Definition at line 775 of file Attributes.cpp.

References B, get(), and hasAttribute().

◆ removeAttributes()

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

Remove the specified attributes from this set.

Returns a new set because attribute sets are immutable.

Definition at line 783 of file Attributes.cpp.

References Attrs, B, and get().

Friends And Related Function Documentation

◆ DenseMapInfo

template<typename Ty >
friend struct DenseMapInfo
friend

Definition at line 256 of file Attributes.h.


The documentation for this class was generated from the following files: