LLVM 19.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
llvm::Attribute Class Reference

#include "llvm/IR/Attributes.h"

Public Types

enum  AttrKind { None , EndAttrKinds , EmptyKey , TombstoneKey }
 This enumeration lists the attributes that can be associated with parameters, function results, or the function itself. More...
 

Public Member Functions

 Attribute ()=default
 
Attribute getWithNewType (LLVMContext &Context, Type *ReplacementTy)
 For a typed attribute, return the equivalent attribute with the type changed to ReplacementTy.
 
bool isEnumAttribute () const
 Return true if the attribute is an Attribute::AttrKind type.
 
bool isIntAttribute () const
 Return true if the attribute is an integer attribute.
 
bool isStringAttribute () const
 Return true if the attribute is a string (target-dependent) attribute.
 
bool isTypeAttribute () const
 Return true if the attribute is a type attribute.
 
bool isConstantRangeAttribute () const
 Return true if the attribute is a ConstantRange attribute.
 
bool isValid () const
 Return true if the attribute is any kind of attribute.
 
bool hasAttribute (AttrKind Val) const
 Return true if the attribute is present.
 
bool hasAttribute (StringRef Val) const
 Return true if the target-dependent attribute is present.
 
Attribute::AttrKind getKindAsEnum () const
 Return the attribute's kind as an enum (Attribute::AttrKind).
 
uint64_t getValueAsInt () const
 Return the attribute's value as an integer.
 
bool getValueAsBool () const
 Return the attribute's value as a boolean.
 
StringRef getKindAsString () const
 Return the attribute's kind as a string.
 
StringRef getValueAsString () const
 Return the attribute's value as a string.
 
TypegetValueAsType () const
 Return the attribute's value as a Type.
 
ConstantRange getValueAsConstantRange () const
 Return the attribute's value as a ConstantRange.
 
MaybeAlign getAlignment () const
 Returns the alignment field of an attribute as a byte alignment value.
 
MaybeAlign getStackAlignment () const
 Returns the stack alignment field of an attribute as a byte alignment value.
 
uint64_t getDereferenceableBytes () const
 Returns the number of dereferenceable bytes from the dereferenceable attribute.
 
uint64_t getDereferenceableOrNullBytes () const
 Returns the number of dereferenceable_or_null bytes from the dereferenceable_or_null attribute.
 
std::pair< unsigned, std::optional< unsigned > > getAllocSizeArgs () const
 Returns the argument numbers for the allocsize attribute.
 
unsigned getVScaleRangeMin () const
 Returns the minimum value for the vscale_range attribute.
 
std::optional< unsignedgetVScaleRangeMax () const
 Returns the maximum value for the vscale_range attribute or std::nullopt when unknown.
 
UWTableKind getUWTableKind () const
 
AllocFnKind getAllocKind () const
 
MemoryEffects getMemoryEffects () const
 Returns memory effects.
 
FPClassTest getNoFPClass () const
 Return the FPClassTest for nofpclass.
 
ConstantRange getRange () const
 Returns the value of the range attribute.
 
std::string getAsString (bool InAttrGrp=false) const
 The Attribute is converted to a string of equivalent mnemonic.
 
bool hasParentContext (LLVMContext &C) const
 Return true if this attribute belongs to the LLVMContext.
 
bool operator== (Attribute A) const
 Equality and non-equality operators.
 
bool operator!= (Attribute A) const
 
bool operator< (Attribute A) const
 Less-than operator. Useful for sorting the attributes list.
 
void Profile (FoldingSetNodeID &ID) const
 
void * getRawPointer () const
 Return a raw pointer that uniquely identifies this attribute.
 

Static Public Member Functions

static bool isEnumAttrKind (AttrKind Kind)
 
static bool isIntAttrKind (AttrKind Kind)
 
static bool isTypeAttrKind (AttrKind Kind)
 
static bool isConstantRangeAttrKind (AttrKind Kind)
 
static bool canUseAsFnAttr (AttrKind Kind)
 
static bool canUseAsParamAttr (AttrKind Kind)
 
static bool canUseAsRetAttr (AttrKind Kind)
 
static Attribute get (LLVMContext &Context, AttrKind Kind, uint64_t Val=0)
 Return a uniquified Attribute object.
 
static Attribute get (LLVMContext &Context, StringRef Kind, StringRef Val=StringRef())
 
static Attribute get (LLVMContext &Context, AttrKind Kind, Type *Ty)
 
static Attribute get (LLVMContext &Context, AttrKind Kind, const ConstantRange &CR)
 
static Attribute getWithAlignment (LLVMContext &Context, Align Alignment)
 Return a uniquified Attribute object that has the specific alignment set.
 
static Attribute getWithStackAlignment (LLVMContext &Context, Align Alignment)
 
static Attribute getWithDereferenceableBytes (LLVMContext &Context, uint64_t Bytes)
 
static Attribute getWithDereferenceableOrNullBytes (LLVMContext &Context, uint64_t Bytes)
 
static Attribute getWithAllocSizeArgs (LLVMContext &Context, unsigned ElemSizeArg, const std::optional< unsigned > &NumElemsArg)
 
static Attribute getWithVScaleRangeArgs (LLVMContext &Context, unsigned MinValue, unsigned MaxValue)
 
static Attribute getWithByValType (LLVMContext &Context, Type *Ty)
 
static Attribute getWithStructRetType (LLVMContext &Context, Type *Ty)
 
static Attribute getWithByRefType (LLVMContext &Context, Type *Ty)
 
static Attribute getWithPreallocatedType (LLVMContext &Context, Type *Ty)
 
static Attribute getWithInAllocaType (LLVMContext &Context, Type *Ty)
 
static Attribute getWithUWTableKind (LLVMContext &Context, UWTableKind Kind)
 
static Attribute getWithMemoryEffects (LLVMContext &Context, MemoryEffects ME)
 
static Attribute getWithNoFPClass (LLVMContext &Context, FPClassTest Mask)
 
static Attribute::AttrKind getAttrKindFromName (StringRef AttrName)
 
static StringRef getNameFromAttrKind (Attribute::AttrKind AttrKind)
 
static bool isExistingAttribute (StringRef Name)
 Return true if the provided string matches the IR name of an attribute.
 
static Attribute fromRawPointer (void *RawPtr)
 Get an attribute from a raw pointer created by getRawPointer.
 

Static Public Attributes

static const unsigned NumIntAttrKinds = LastIntAttr - FirstIntAttr + 1
 
static const unsigned NumTypeAttrKinds = LastTypeAttr - FirstTypeAttr + 1
 

Detailed Description

Definition at line 66 of file Attributes.h.

Member Enumeration Documentation

◆ AttrKind

This enumeration lists the attributes that can be associated with parameters, function results, or the function itself.

Note: The ‘uwtable’ attribute is about the ABI or the user mandating an entry in the unwind table. The ‘nounwind’ attribute is about an exception passing by the function.

In a theoretical system that uses tables for profiling and SjLj for exceptions, they would be fully independent. In a normal system that uses tables for both, the semantics are:

nil = Needs an entry because an exception might pass by. nounwind = No need for an entry uwtable = Needs an entry because the ABI says so and because an exception might pass by. uwtable + nounwind = Needs an entry because the ABI says so.

Enumerator
None 

No attributes have been set.

EndAttrKinds 

Sentinel value useful for loops.

EmptyKey 

Use as Empty key for DenseMap of AttrKind.

TombstoneKey 

Use as Tombstone key for DenseMap of AttrKind.

Definition at line 85 of file Attributes.h.

Constructor & Destructor Documentation

◆ Attribute()

llvm::Attribute::Attribute ( )
default

Referenced by fromRawPointer(), and get().

Member Function Documentation

◆ canUseAsFnAttr()

bool Attribute::canUseAsFnAttr ( AttrKind  Kind)
static

Definition at line 681 of file Attributes.cpp.

References hasAttributeProperty().

Referenced by forceAttributes(), and llvm::ForceFunctionAttrsPass::run().

◆ canUseAsParamAttr()

bool Attribute::canUseAsParamAttr ( AttrKind  Kind)
static

Definition at line 685 of file Attributes.cpp.

References hasAttributeProperty().

◆ canUseAsRetAttr()

bool Attribute::canUseAsRetAttr ( AttrKind  Kind)
static

Definition at line 689 of file Attributes.cpp.

References hasAttributeProperty().

◆ fromRawPointer()

static Attribute llvm::Attribute::fromRawPointer ( void *  RawPtr)
inlinestatic

Get an attribute from a raw pointer created by getRawPointer.

Definition at line 292 of file Attributes.h.

References Attribute().

Referenced by llvm::unwrap().

◆ get() [1/4]

Attribute Attribute::get ( LLVMContext Context,
Attribute::AttrKind  Kind,
const ConstantRange CR 
)
static

◆ get() [2/4]

Attribute Attribute::get ( LLVMContext Context,
Attribute::AttrKind  Kind,
Type Ty 
)
static

◆ get() [3/4]

Attribute Attribute::get ( LLVMContext Context,
Attribute::AttrKind  Kind,
uint64_t  Val = 0 
)
static

Return a uniquified Attribute object.

Definition at line 93 of file Attributes.cpp.

References llvm::LLVMContextImpl::Alloc, assert(), Attribute(), llvm::LLVMContextImpl::AttrsSet, Context, isEnumAttrKind(), isIntAttrKind(), and llvm::LLVMContext::pImpl.

Referenced by addAllocTypeAttribute(), llvm::AttrBuilder::addAttribute(), llvm::AttributeList::addAttributeAtIndex(), llvm::AttrBuilder::addConstantRangeAttr(), llvm::AttrBuilder::addRawIntAttr(), llvm::AttrBuilder::addTypeAttr(), adjustByValArgAlignment(), CreateGCStatepointCallCommon(), CreateGCStatepointInvokeCommon(), llvm::OpenMPIRBuilder::createOffloadEntry(), llvm::IRBuilderBase::CreatePreserveArrayAccessIndex(), llvm::IRBuilderBase::CreatePreserveStructAccessIndex(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), llvm::AttributeList::get(), llvm::Attributor::getAttrsFromAssumes(), llvm::IRAttribute< AK, BaseType, AAType >::getDeducedAttributes(), getWithAlignment(), getWithAllocSizeArgs(), getWithByRefType(), getWithByValType(), getWithDereferenceableBytes(), getWithDereferenceableOrNullBytes(), getWithInAllocaType(), getWithMemoryEffects(), getWithNewType(), getWithNoFPClass(), getWithPreallocatedType(), getWithStackAlignment(), getWithStructRetType(), getWithUWTableKind(), getWithVScaleRangeArgs(), llvm::Attributor::hasAttr(), llvm::AANoSync::isImpliedByIR(), llvm::AAWillReturn::isImpliedByIR(), llvm::AANoCapture::isImpliedByIR(), llvm::AANoUndef::isImpliedByIR(), LLVMAddTargetDependentFunctionAttr(), LLVMCreateEnumAttribute(), LLVMCreateStringAttribute(), LLVMCreateTypeAttribute(), processCallSite(), setAllocKind(), llvm::codegen::setFunctionAttributes(), llvm::setInlineRemark(), setParamElementType(), setParamReadNone(), setParamReadOnly(), setParamWriteOnly(), and llvm::VFABI::setVectorVariantNames().

◆ get() [4/4]

Attribute Attribute::get ( LLVMContext Context,
StringRef  Kind,
StringRef  Val = StringRef() 
)
static

◆ getAlignment()

MaybeAlign Attribute::getAlignment ( ) const

Returns the alignment field of an attribute as a byte alignment value.

Definition at line 378 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().

◆ getAllocKind()

AllocFnKind Attribute::getAllocKind ( ) const

Definition at line 429 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().

Referenced by getAsString().

◆ getAllocSizeArgs()

std::pair< unsigned, std::optional< unsigned > > Attribute::getAllocSizeArgs ( ) const

Returns the argument numbers for the allocsize attribute.

Definition at line 405 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsInt(), hasAttribute(), and unpackAllocSizeArgs().

Referenced by getAllocationSize(), and getAsString().

◆ getAsString()

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

◆ getAttrKindFromName()

Attribute::AttrKind Attribute::getAttrKindFromName ( StringRef  AttrName)
static

◆ getDereferenceableBytes()

uint64_t Attribute::getDereferenceableBytes ( ) const

Returns the number of dereferenceable bytes from the dereferenceable attribute.

Definition at line 390 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().

Referenced by tryToMoveFreeBeforeNullTest().

◆ getDereferenceableOrNullBytes()

uint64_t Attribute::getDereferenceableOrNullBytes ( ) const

Returns the number of dereferenceable_or_null bytes from the dereferenceable_or_null attribute.

Definition at line 397 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().

◆ getKindAsEnum()

Attribute::AttrKind Attribute::getKindAsEnum ( ) const

Return the attribute's kind as an enum (Attribute::AttrKind).

This requires the attribute to be an enum, integer, or type attribute.

Definition at line 320 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getKindAsEnum(), isConstantRangeAttribute(), isEnumAttribute(), isIntAttribute(), isTypeAttribute(), and None.

Referenced by llvm::AttrBuilder::addAttribute(), addIfNotExistent(), getAsString(), getWithNewType(), LLVMGetEnumAttributeKind(), and AttributeComparator::operator()().

◆ getKindAsString()

StringRef Attribute::getKindAsString ( ) const

Return the attribute's kind as a string.

This requires the attribute to be a string attribute.

Definition at line 342 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getKindAsString(), and isStringAttribute().

Referenced by llvm::AttrBuilder::addAttribute(), addIfNotExistent(), getAsString(), LLVMGetStringAttributeKind(), and AttributeComparator::operator()().

◆ getMemoryEffects()

MemoryEffects Attribute::getMemoryEffects ( ) const

◆ getNameFromAttrKind()

StringRef Attribute::getNameFromAttrKind ( Attribute::AttrKind  AttrKind)
static

Definition at line 274 of file Attributes.cpp.

References llvm_unreachable, and None.

Referenced by getAsString(), and llvm::hasAttributeInAssume().

◆ getNoFPClass()

FPClassTest Attribute::getNoFPClass ( ) const

Return the FPClassTest for nofpclass.

Definition at line 441 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().

Referenced by getAsString().

◆ getRange()

ConstantRange Attribute::getRange ( ) const

Returns the value of the range attribute.

Definition at line 447 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsConstantRange(), and hasAttribute().

◆ getRawPointer()

void * llvm::Attribute::getRawPointer ( ) const
inline

Return a raw pointer that uniquely identifies this attribute.

Definition at line 287 of file Attributes.h.

Referenced by llvm::wrap().

◆ getStackAlignment()

MaybeAlign Attribute::getStackAlignment ( ) const

Returns the stack alignment field of an attribute as a byte alignment value.

Definition at line 384 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().

◆ getUWTableKind()

UWTableKind Attribute::getUWTableKind ( ) const

Definition at line 423 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().

Referenced by getAsString().

◆ getValueAsBool()

bool Attribute::getValueAsBool ( ) const

Return the attribute's value as a boolean.

This requires that the attribute be a string attribute.

Definition at line 335 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsBool(), and isStringAttribute().

Referenced by llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), llvm::TargetLoweringBase::areJTsAllowed(), hasUnsafeFPMath(), llvm::FastISel::lowerCall(), and SwitchToLookupTable().

◆ getValueAsConstantRange()

ConstantRange Attribute::getValueAsConstantRange ( ) const

Return the attribute's value as a ConstantRange.

This requires the attribute to be a ConstantRange attribute.

Definition at line 363 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsConstantRange(), and isConstantRangeAttribute().

Referenced by getAsString().

◆ getValueAsInt()

uint64_t Attribute::getValueAsInt ( ) const

Return the attribute's value as an integer.

This requires that the attribute be an integer attribute.

Definition at line 328 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsInt(), and isIntAttribute().

Referenced by adjustByValArgAlignment(), getAllocFnKind(), getAsString(), and isEqualOrWorse().

◆ getValueAsString()

StringRef Attribute::getValueAsString ( ) const

Return the attribute's value as a string.

This requires the attribute to be a string attribute.

Definition at line 349 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsString(), and isStringAttribute().

Referenced by addIfNotExistent(), adjustCallerStackProbeSize(), adjustMinLegalVectorWidth(), llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), llvm::getAllocationFamily(), llvm::Function::getDenormalModeF32Raw(), llvm::Function::getDenormalModeRaw(), getDeoptLowering(), llvm::AMDGPUTargetMachine::getFeatureString(), llvm::AMDGPUTargetMachine::getGPUName(), getGridValue(), llvm::X86TargetLowering::getStackProbeSymbolName(), llvm::getStringFnAttrAsInt(), llvm::SystemZTargetMachine::getSubtargetImpl(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::CSKYTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::LoongArchTargetMachine::getSubtargetImpl(), llvm::M68kTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::XtensaTargetMachine::getSubtargetImpl(), llvm::VFABI::getVectorVariantNames(), llvm::PPCTargetLowering::hasInlineStackProbe(), llvm::SystemZTargetLowering::hasInlineStackProbe(), llvm::X86TargetLowering::hasInlineStackProbe(), isThumbFunction(), LLVMGetStringAttributeValue(), llvm::CallLowering::lowerCall(), llvm::RISCVTargetLowering::LowerFormalArguments(), llvm::RISCVTargetLowering::LowerReturn(), llvm::parseStatepointDirectivesFromAttrs(), llvm::OpenMPIRBuilder::readThreadBoundsForKernel(), llvm::SITargetLowering::shouldExpandAtomicRMWInIR(), and llvm::AttributeFuncs::updateMinLegalVectorWidthAttr().

◆ getValueAsType()

Type * Attribute::getValueAsType ( ) const

Return the attribute's value as a Type.

This requires the attribute to be a type attribute.

Definition at line 356 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsType(), and isTypeAttribute().

Referenced by getAsString().

◆ getVScaleRangeMax()

std::optional< unsigned > Attribute::getVScaleRangeMax ( ) const

◆ getVScaleRangeMin()

unsigned Attribute::getVScaleRangeMin ( ) const

Returns the minimum value for the vscale_range attribute.

Definition at line 411 of file Attributes.cpp.

References assert(), llvm::AttributeImpl::getValueAsInt(), hasAttribute(), and unpackVScaleRangeArgs().

Referenced by getAsString(), llvm::RISCVTargetMachine::getSubtargetImpl(), getVScaleForTuning(), and llvm::getVScaleRange().

◆ getWithAlignment()

Attribute Attribute::getWithAlignment ( LLVMContext Context,
Align  Alignment 
)
static

◆ getWithAllocSizeArgs()

Attribute Attribute::getWithAllocSizeArgs ( LLVMContext Context,
unsigned  ElemSizeArg,
const std::optional< unsigned > &  NumElemsArg 
)
static

Definition at line 252 of file Attributes.cpp.

References assert(), Context, get(), and packAllocSizeArgs().

Referenced by doPromotion(), and setAllocSize().

◆ getWithByRefType()

Attribute Attribute::getWithByRefType ( LLVMContext Context,
Type Ty 
)
static

Definition at line 224 of file Attributes.cpp.

References Context, and get().

◆ getWithByValType()

Attribute Attribute::getWithByValType ( LLVMContext Context,
Type Ty 
)
static

Definition at line 216 of file Attributes.cpp.

References Context, and get().

◆ getWithDereferenceableBytes()

Attribute Attribute::getWithDereferenceableBytes ( LLVMContext Context,
uint64_t  Bytes 
)
static

Definition at line 204 of file Attributes.cpp.

References assert(), Context, and get().

Referenced by annotateDereferenceableBytes(), and lowerKernelArguments().

◆ getWithDereferenceableOrNullBytes()

Attribute Attribute::getWithDereferenceableOrNullBytes ( LLVMContext Context,
uint64_t  Bytes 
)
static

Definition at line 210 of file Attributes.cpp.

References assert(), Context, and get().

◆ getWithInAllocaType()

Attribute Attribute::getWithInAllocaType ( LLVMContext Context,
Type Ty 
)
static

Definition at line 232 of file Attributes.cpp.

References Context, and get().

◆ getWithMemoryEffects()

Attribute Attribute::getWithMemoryEffects ( LLVMContext Context,
MemoryEffects  ME 
)
static

◆ getWithNewType()

Attribute llvm::Attribute::getWithNewType ( LLVMContext Context,
Type ReplacementTy 
)
inline

For a typed attribute, return the equivalent attribute with the type changed to ReplacementTy.

Definition at line 159 of file Attributes.h.

References assert(), Context, get(), getKindAsEnum(), and isTypeAttribute().

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

◆ getWithNoFPClass()

Attribute Attribute::getWithNoFPClass ( LLVMContext Context,
FPClassTest  Mask 
)
static

Definition at line 246 of file Attributes.cpp.

References Context, and get().

◆ getWithPreallocatedType()

Attribute Attribute::getWithPreallocatedType ( LLVMContext Context,
Type Ty 
)
static

Definition at line 228 of file Attributes.cpp.

References Context, and get().

◆ getWithStackAlignment()

Attribute Attribute::getWithStackAlignment ( LLVMContext Context,
Align  Alignment 
)
static

Definition at line 199 of file Attributes.cpp.

References A, assert(), Context, and get().

◆ getWithStructRetType()

Attribute Attribute::getWithStructRetType ( LLVMContext Context,
Type Ty 
)
static

Definition at line 220 of file Attributes.cpp.

References Context, and get().

◆ getWithUWTableKind()

Attribute Attribute::getWithUWTableKind ( LLVMContext Context,
UWTableKind  Kind 
)
static

Definition at line 236 of file Attributes.cpp.

References Context, and get().

◆ getWithVScaleRangeArgs()

Attribute Attribute::getWithVScaleRangeArgs ( LLVMContext Context,
unsigned  MinValue,
unsigned  MaxValue 
)
static

Definition at line 259 of file Attributes.cpp.

References Context, get(), and packVScaleRangeArgs().

◆ hasAttribute() [1/2]

bool Attribute::hasAttribute ( AttrKind  Val) const

◆ hasAttribute() [2/2]

bool Attribute::hasAttribute ( StringRef  Val) const

Return true if the target-dependent attribute is present.

Definition at line 373 of file Attributes.cpp.

References llvm::AttributeImpl::hasAttribute(), and isStringAttribute().

◆ hasParentContext()

bool Attribute::hasParentContext ( LLVMContext C) const

Return true if this attribute belongs to the LLVMContext.

Definition at line 646 of file Attributes.cpp.

References assert(), llvm::CallingConv::C, isValid(), and llvm::AttributeImpl::Profile().

◆ isConstantRangeAttribute()

bool Attribute::isConstantRangeAttribute ( ) const

Return true if the attribute is a ConstantRange attribute.

Definition at line 316 of file Attributes.cpp.

References llvm::AttributeImpl::isConstantRangeAttribute().

Referenced by getKindAsEnum(), and getValueAsConstantRange().

◆ isConstantRangeAttrKind()

static bool llvm::Attribute::isConstantRangeAttrKind ( AttrKind  Kind)
inlinestatic

Definition at line 107 of file Attributes.h.

Referenced by get().

◆ isEnumAttribute()

bool Attribute::isEnumAttribute ( ) const

Return true if the attribute is an Attribute::AttrKind type.

Definition at line 300 of file Attributes.cpp.

References llvm::AttributeImpl::isEnumAttribute().

Referenced by addIfNotExistent(), getAsString(), and getKindAsEnum().

◆ isEnumAttrKind()

static bool llvm::Attribute::isEnumAttrKind ( AttrKind  Kind)
inlinestatic

◆ isExistingAttribute()

bool Attribute::isExistingAttribute ( StringRef  Name)
static

Return true if the provided string matches the IR name of an attribute.

example: "noalias" return true but not "NoAlias"

Definition at line 288 of file Attributes.cpp.

References llvm::StringSwitch< T, R >::Default(), and Name.

Referenced by llvm::hasAttributeInAssume().

◆ isIntAttribute()

bool Attribute::isIntAttribute ( ) const

Return true if the attribute is an integer attribute.

Definition at line 304 of file Attributes.cpp.

References llvm::AttributeImpl::isIntAttribute().

Referenced by addIfNotExistent(), getKindAsEnum(), getValueAsInt(), and isEqualOrWorse().

◆ isIntAttrKind()

static bool llvm::Attribute::isIntAttrKind ( AttrKind  Kind)
inlinestatic

◆ isStringAttribute()

bool Attribute::isStringAttribute ( ) const

◆ isTypeAttribute()

bool Attribute::isTypeAttribute ( ) const

Return true if the attribute is a type attribute.

Definition at line 312 of file Attributes.cpp.

References llvm::AttributeImpl::isTypeAttribute().

Referenced by getAsString(), getKindAsEnum(), getValueAsType(), getWithNewType(), and LLVMIsTypeAttribute().

◆ isTypeAttrKind()

static bool llvm::Attribute::isTypeAttrKind ( AttrKind  Kind)
inlinestatic

Definition at line 104 of file Attributes.h.

Referenced by addRawAttributeValue(), get(), and llvm::AttrBuilder::getTypeAttr().

◆ isValid()

bool llvm::Attribute::isValid ( ) const
inline

◆ operator!=()

bool llvm::Attribute::operator!= ( Attribute  A) const
inline

Definition at line 279 of file Attributes.h.

References A.

◆ operator<()

bool Attribute::operator< ( Attribute  A) const

Less-than operator. Useful for sorting the attributes list.

Definition at line 654 of file Attributes.cpp.

References A.

◆ operator==()

bool llvm::Attribute::operator== ( Attribute  A) const
inline

Equality and non-equality operators.

Definition at line 278 of file Attributes.h.

References A.

◆ Profile()

void Attribute::Profile ( FoldingSetNodeID ID) const

Definition at line 661 of file Attributes.cpp.

Member Data Documentation

◆ NumIntAttrKinds

const unsigned llvm::Attribute::NumIntAttrKinds = LastIntAttr - FirstIntAttr + 1
static

Definition at line 95 of file Attributes.h.

◆ NumTypeAttrKinds

const unsigned llvm::Attribute::NumTypeAttrKinds = LastTypeAttr - FirstTypeAttr + 1
static

Definition at line 96 of file Attributes.h.


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