LLVM  5.0.0
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)
 
bool operator!= (const AttributeSet &O)
 
AttributeSet addAttribute (LLVMContext &C, Attribute::AttrKind Kind) const
 Add an argument attribute. More...
 
AttributeSet addAttribute (LLVMContext &C, StringRef Kind, StringRef Value=StringRef()) const
 Add a target-dependent attribute. More...
 
AttributeSet addAttributes (LLVMContext &C, AttributeSet AS) const
 Add attributes to the attribute set. More...
 
AttributeSet removeAttribute (LLVMContext &C, Attribute::AttrKind Kind) const
 Remove the specified attribute from this set. More...
 
AttributeSet removeAttribute (LLVMContext &C, StringRef Kind) const
 Remove the specified attribute from this set. More...
 
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

Definition at line 282 of file Attributes.h.

Constructor & Destructor Documentation

llvm::AttributeSet::AttributeSet ( )
default

AttributeSet is a trivially copyable value type.

Referenced by get().

llvm::AttributeSet::AttributeSet ( const AttributeSet &  )
default
llvm::AttributeSet::~AttributeSet ( )
default

Member Function Documentation

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

References llvm::AttrBuilder::addAttribute(), addAttributes(), B, get(), and hasAttribute().

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

References llvm::AttrBuilder::addAttribute(), addAttributes(), B, and get().

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

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

Referenced by addAttribute().

AttributeSet::iterator AttributeSet::begin ( ) const

Definition at line 612 of file Attributes.cpp.

References llvm::AttributeSetNode::begin().

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

LLVM_DUMP_METHOD void AttributeSet::dump ( ) const

Definition at line 621 of file Attributes.cpp.

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

AttributeSet::iterator AttributeSet::end ( ) const

Definition at line 616 of file Attributes.cpp.

References llvm::AttributeSetNode::end().

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

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

Definition at line 505 of file Attributes.cpp.

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

unsigned AttributeSet::getAlignment ( ) const
std::pair< unsigned, Optional< unsigned > > AttributeSet::getAllocSizeArgs ( ) const
std::string AttributeSet::getAsString ( bool  InAttrGrp = false) const

Definition at line 608 of file Attributes.cpp.

References llvm::AttributeSetNode::getAsString().

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

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

Return the attribute object.

Definition at line 579 of file Attributes.cpp.

References llvm::AttributeSetNode::getAttribute().

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

Attribute AttributeSet::getAttribute ( StringRef  Kind) const

Return the target-dependent attribute object.

Definition at line 583 of file Attributes.cpp.

References llvm::AttributeSetNode::getAttribute().

uint64_t AttributeSet::getDereferenceableBytes ( ) const
uint64_t AttributeSet::getDereferenceableOrNullBytes ( ) const
unsigned AttributeSet::getNumAttributes ( ) const

Return the number of attributes in this set.

Definition at line 567 of file Attributes.cpp.

References llvm::AttributeSetNode::getNumAttributes().

Referenced by LLVMGetAttributeCountAtIndex().

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

Return true if the attribute exists in this set.

Definition at line 571 of file Attributes.cpp.

References llvm::AttributeSetNode::hasAttribute().

Referenced by addAttribute(), llvm::AttributeList::hasAttribute(), llvm::GlobalVariable::hasImplicitSection(), and removeAttribute().

bool AttributeSet::hasAttribute ( StringRef  Kind) const

Return true if the attribute exists in this set.

Definition at line 575 of file Attributes.cpp.

References llvm::AttributeSetNode::hasAttribute().

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

Return true if attributes exists in this set.

Definition at line 261 of file Attributes.h.

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

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

Definition at line 229 of file Attributes.h.

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

Definition at line 228 of file Attributes.h.

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

References llvm::AttrBuilder::addAttribute(), B, hasAttribute(), and removeAttributes().

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

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

References assert(), B, C, and llvm::AttrBuilder::hasAlignmentAttr().

Referenced by removeAttribute().

Friends And Related Function Documentation

template<typename Ty >
friend struct DenseMapInfo
friend

Definition at line 214 of file Attributes.h.


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