LLVM  8.0.1
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...
 
unsigned getAlignment () const
 
unsigned getStackAlignment () const
 
uint64_t getDereferenceableBytes () const
 
uint64_t getDereferenceableOrNullBytes () const
 
std::pair< unsigned, Optional< unsigned > > getAllocSizeArgs () const
 
std::string getAsString (bool InAttrGrp=false) const
 
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 205 of file Attributes.h.

Member Typedef Documentation

◆ iterator

Definition at line 286 of file Attributes.h.

Constructor & Destructor Documentation

◆ AttributeSet() [1/2]

llvm::AttributeSet::AttributeSet ( )
default

AttributeSet is a trivially copyable value type.

◆ 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 521 of file Attributes.cpp.

References llvm::AttrBuilder::addAttribute(), B, get(), and llvm::Attribute::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 529 of file Attributes.cpp.

References llvm::AttrBuilder::addAttribute(), 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 536 of file Attributes.cpp.

References llvm::AttrBuilder::addAttribute(), B, C, hasAttributes(), and I.

◆ begin()

AttributeSet::iterator AttributeSet::begin ( ) const

Definition at line 619 of file Attributes.cpp.

Referenced by llvm::AttributeList::begin(), and llvm::FunctionComparator::cmpMem().

◆ dump()

LLVM_DUMP_METHOD void AttributeSet::dump ( ) const

◆ end()

AttributeSet::iterator AttributeSet::end ( ) const

Definition at line 623 of file Attributes.cpp.

Referenced by llvm::FunctionComparator::cmpMem(), and llvm::AttributeList::end().

◆ get() [1/2]

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

◆ get() [2/2]

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

Definition at line 517 of file Attributes.cpp.

References llvm::AttributeSetNode::get().

◆ getAlignment()

unsigned AttributeSet::getAlignment ( ) const

Definition at line 594 of file Attributes.cpp.

◆ getAllocSizeArgs()

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

Definition at line 610 of file Attributes.cpp.

◆ getAsString()

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

Definition at line 615 of file Attributes.cpp.

Referenced by isFuncOrArgAttr(), and maybePrintComdat().

◆ getAttribute() [1/2]

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

Return the attribute object.

Definition at line 586 of file Attributes.cpp.

References llvm::Attribute::Attribute().

◆ getAttribute() [2/2]

Attribute AttributeSet::getAttribute ( StringRef  Kind) const

Return the target-dependent attribute object.

Definition at line 590 of file Attributes.cpp.

References llvm::Attribute::Attribute().

◆ getDereferenceableBytes()

uint64_t AttributeSet::getDereferenceableBytes ( ) const

Definition at line 602 of file Attributes.cpp.

◆ getDereferenceableOrNullBytes()

uint64_t AttributeSet::getDereferenceableOrNullBytes ( ) const

Definition at line 606 of file Attributes.cpp.

◆ getNumAttributes()

unsigned AttributeSet::getNumAttributes ( ) const

Return the number of attributes in this set.

Definition at line 574 of file Attributes.cpp.

Referenced by LLVMGetAttributeCountAtIndex().

◆ getStackAlignment()

unsigned AttributeSet::getStackAlignment ( ) const

Definition at line 598 of file Attributes.cpp.

◆ 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 582 of file Attributes.cpp.

◆ hasAttributes()

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

◆ operator!=()

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

Definition at line 229 of file Attributes.h.

References Kind, LLVM_NODISCARD, and llvm::RISCVFenceField::O.

◆ operator==()

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

Definition at line 228 of file Attributes.h.

◆ 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 551 of file Attributes.cpp.

References B, C, llvm::Attribute::hasAttribute(), and llvm::AttrBuilder::removeAttribute().

Referenced by getRetComponentType().

◆ 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 559 of file Attributes.cpp.

References B, C, llvm::Attribute::hasAttribute(), and llvm::AttrBuilder::removeAttribute().

◆ 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 567 of file Attributes.cpp.

References B, C, and llvm::AttrBuilder::remove().

Friends And Related Function Documentation

◆ DenseMapInfo

template<typename Ty >
friend struct DenseMapInfo
friend

Definition at line 207 of file Attributes.h.


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