LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | List of all members
llvm::AttributeImpl Class Reference

#include "IR/AttributeImpl.h"

Inheritance diagram for llvm::AttributeImpl:
Inheritance graph
[legend]

Public Member Functions

 AttributeImpl (const AttributeImpl &)=delete
 
AttributeImploperator= (const AttributeImpl &)=delete
 
bool isEnumAttribute () const
 
bool isIntAttribute () const
 
bool isStringAttribute () const
 
bool isTypeAttribute () const
 
bool isConstantRangeAttribute () const
 
bool isConstantRangeListAttribute () const
 
bool hasAttribute (Attribute::AttrKind A) const
 
bool hasAttribute (StringRef Kind) const
 
Attribute::AttrKind getKindAsEnum () const
 
uint64_t getValueAsInt () const
 
bool getValueAsBool () const
 
StringRef getKindAsString () const
 
StringRef getValueAsString () const
 
TypegetValueAsType () const
 
const ConstantRangegetValueAsConstantRange () const
 
ArrayRef< ConstantRangegetValueAsConstantRangeList () const
 
int cmp (const AttributeImpl &AI, bool KindOnly) const
 Used to sort attributes.
 
bool operator< (const AttributeImpl &AI) const
 Used when sorting the attributes.
 
void Profile (FoldingSetNodeID &ID) const
 
- Public Member Functions inherited from llvm::FoldingSetBase::Node
 Node ()=default
 
void * getNextInBucket () const
 
void SetNextInBucket (void *N)
 

Static Public Member Functions

static void Profile (FoldingSetNodeID &ID, Attribute::AttrKind Kind)
 
static void Profile (FoldingSetNodeID &ID, Attribute::AttrKind Kind, uint64_t Val)
 
static void Profile (FoldingSetNodeID &ID, StringRef Kind, StringRef Values)
 
static void Profile (FoldingSetNodeID &ID, Attribute::AttrKind Kind, Type *Ty)
 
static void Profile (FoldingSetNodeID &ID, Attribute::AttrKind Kind, const ConstantRange &CR)
 
static void Profile (FoldingSetNodeID &ID, Attribute::AttrKind Kind, ArrayRef< ConstantRange > Val)
 

Protected Types

enum  AttrEntryKind {
  EnumAttrEntry , IntAttrEntry , StringAttrEntry , TypeAttrEntry ,
  ConstantRangeAttrEntry , ConstantRangeListAttrEntry
}
 

Protected Member Functions

 AttributeImpl (AttrEntryKind KindID)
 

Detailed Description

Definition at line 42 of file AttributeImpl.h.

Member Enumeration Documentation

◆ AttrEntryKind

Enumerator
EnumAttrEntry 
IntAttrEntry 
StringAttrEntry 
TypeAttrEntry 
ConstantRangeAttrEntry 
ConstantRangeListAttrEntry 

Definition at line 46 of file AttributeImpl.h.

Constructor & Destructor Documentation

◆ AttributeImpl() [1/2]

llvm::AttributeImpl::AttributeImpl ( AttrEntryKind  KindID)
inlineprotected

Definition at line 55 of file AttributeImpl.h.

◆ AttributeImpl() [2/2]

llvm::AttributeImpl::AttributeImpl ( const AttributeImpl )
delete

Member Function Documentation

◆ cmp()

int AttributeImpl::cmp ( const AttributeImpl AI,
bool  KindOnly 
) const

Used to sort attributes.

KindOnly controls if the sort includes the attributes' values or just the kind.

Definition at line 854 of file Attributes.cpp.

References assert(), llvm::StringRef::compare(), getKindAsEnum(), getKindAsString(), getValueAsInt(), getValueAsString(), isConstantRangeAttribute(), isConstantRangeListAttribute(), isEnumAttribute(), isIntAttribute(), isStringAttribute(), and isTypeAttribute().

Referenced by llvm::Attribute::cmpKind(), and operator<().

◆ getKindAsEnum()

Attribute::AttrKind AttributeImpl::getKindAsEnum ( ) const

◆ getKindAsString()

StringRef AttributeImpl::getKindAsString ( ) const

Definition at line 827 of file Attributes.cpp.

References assert(), and isStringAttribute().

Referenced by cmp(), llvm::Attribute::getKindAsString(), hasAttribute(), and Profile().

◆ getValueAsBool()

bool AttributeImpl::getValueAsBool ( ) const

Definition at line 822 of file Attributes.cpp.

References assert(), and getValueAsString().

Referenced by llvm::Attribute::getValueAsBool().

◆ getValueAsConstantRange()

const ConstantRange & AttributeImpl::getValueAsConstantRange ( ) const

◆ getValueAsConstantRangeList()

ArrayRef< ConstantRange > AttributeImpl::getValueAsConstantRangeList ( ) const

◆ getValueAsInt()

uint64_t AttributeImpl::getValueAsInt ( ) const

◆ getValueAsString()

StringRef AttributeImpl::getValueAsString ( ) const

◆ getValueAsType()

Type * AttributeImpl::getValueAsType ( ) const

Definition at line 837 of file Attributes.cpp.

References assert(), and isTypeAttribute().

Referenced by llvm::Attribute::getValueAsType(), and Profile().

◆ hasAttribute() [1/2]

bool AttributeImpl::hasAttribute ( Attribute::AttrKind  A) const

Definition at line 801 of file Attributes.cpp.

References A, getKindAsEnum(), and isStringAttribute().

Referenced by llvm::Attribute::hasAttribute().

◆ hasAttribute() [2/2]

bool AttributeImpl::hasAttribute ( StringRef  Kind) const

Definition at line 806 of file Attributes.cpp.

References getKindAsString(), and isStringAttribute().

◆ isConstantRangeAttribute()

bool llvm::AttributeImpl::isConstantRangeAttribute ( ) const
inline

◆ isConstantRangeListAttribute()

bool llvm::AttributeImpl::isConstantRangeListAttribute ( ) const
inline

◆ isEnumAttribute()

bool llvm::AttributeImpl::isEnumAttribute ( ) const
inline

Definition at line 62 of file AttributeImpl.h.

References EnumAttrEntry.

Referenced by cmp(), getKindAsEnum(), llvm::Attribute::isEnumAttribute(), and Profile().

◆ isIntAttribute()

bool llvm::AttributeImpl::isIntAttribute ( ) const
inline

Definition at line 63 of file AttributeImpl.h.

References IntAttrEntry.

Referenced by cmp(), getKindAsEnum(), getValueAsInt(), llvm::Attribute::isIntAttribute(), and Profile().

◆ isStringAttribute()

bool llvm::AttributeImpl::isStringAttribute ( ) const
inline

◆ isTypeAttribute()

bool llvm::AttributeImpl::isTypeAttribute ( ) const
inline

◆ operator<()

bool AttributeImpl::operator< ( const AttributeImpl AI) const

Used when sorting the attributes.

Definition at line 889 of file Attributes.cpp.

References cmp().

◆ operator=()

AttributeImpl & llvm::AttributeImpl::operator= ( const AttributeImpl )
delete

◆ Profile() [1/7]

void llvm::AttributeImpl::Profile ( FoldingSetNodeID ID) const
inline

◆ Profile() [2/7]

static void llvm::AttributeImpl::Profile ( FoldingSetNodeID ID,
Attribute::AttrKind  Kind 
)
inlinestatic

Definition at line 110 of file AttributeImpl.h.

References assert(), and llvm::Attribute::isEnumAttrKind().

◆ Profile() [3/7]

static void llvm::AttributeImpl::Profile ( FoldingSetNodeID ID,
Attribute::AttrKind  Kind,
ArrayRef< ConstantRange Val 
)
inlinestatic

Definition at line 140 of file AttributeImpl.h.

References llvm::ArrayRef< T >::size().

◆ Profile() [4/7]

static void llvm::AttributeImpl::Profile ( FoldingSetNodeID ID,
Attribute::AttrKind  Kind,
const ConstantRange CR 
)
inlinestatic

◆ Profile() [5/7]

static void llvm::AttributeImpl::Profile ( FoldingSetNodeID ID,
Attribute::AttrKind  Kind,
Type Ty 
)
inlinestatic

Definition at line 127 of file AttributeImpl.h.

◆ Profile() [6/7]

static void llvm::AttributeImpl::Profile ( FoldingSetNodeID ID,
Attribute::AttrKind  Kind,
uint64_t  Val 
)
inlinestatic

Definition at line 115 of file AttributeImpl.h.

References assert(), and llvm::Attribute::isIntAttrKind().

◆ Profile() [7/7]

static void llvm::AttributeImpl::Profile ( FoldingSetNodeID ID,
StringRef  Kind,
StringRef  Values 
)
inlinestatic

Definition at line 122 of file AttributeImpl.h.

References llvm::StringRef::empty().


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