LLVM 20.0.0git
|
#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 | isConstantRangeListAttribute () const |
Return true if the attribute is a ConstantRangeList 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. | |
Type * | getValueAsType () const |
Return the attribute's value as a Type. | |
const ConstantRange & | getValueAsConstantRange () const |
Return the attribute's value as a ConstantRange. | |
ArrayRef< ConstantRange > | getValueAsConstantRangeList () const |
Return the attribute's value as a ConstantRange array. | |
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< unsigned > | getVScaleRangeMax () 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. | |
const ConstantRange & | getRange () const |
Returns the value of the range attribute. | |
ArrayRef< ConstantRange > | getInitializes () const |
Returns the value of the initializes 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 Attributes | |
static const unsigned | NumIntAttrKinds = LastIntAttr - FirstIntAttr + 1 |
static const unsigned | NumTypeAttrKinds = LastTypeAttr - FirstTypeAttr + 1 |
Definition at line 67 of file Attributes.h.
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 | |
TombstoneKey |
Definition at line 86 of file Attributes.h.
|
default |
Referenced by fromRawPointer(), and get().
Definition at line 742 of file Attributes.cpp.
References hasAttributeProperty().
Referenced by forceAttributes(), and llvm::ForceFunctionAttrsPass::run().
Definition at line 746 of file Attributes.cpp.
References hasAttributeProperty().
Definition at line 750 of file Attributes.cpp.
References hasAttributeProperty().
|
inlinestatic |
Get an attribute from a raw pointer created by getRawPointer.
Definition at line 309 of file Attributes.h.
References Attribute().
Referenced by llvm::unwrap().
|
static |
Definition at line 196 of file Attributes.cpp.
References llvm::LLVMContextImpl::Alloc, llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay >::Allocate(), assert(), Attribute(), llvm::LLVMContextImpl::AttrsSet, llvm::LLVMContextImpl::ConstantRangeListAttributes, isConstantRangeListAttrKind(), llvm::LLVMContext::pImpl, llvm::ArrayRef< T >::size(), and llvm::ConstantRangeListAttributeImpl::totalSizeToAlloc().
|
static |
Definition at line 170 of file Attributes.cpp.
References assert(), Attribute(), llvm::LLVMContextImpl::AttrsSet, llvm::LLVMContextImpl::ConstantRangeAttributeAlloc, llvm::ConstantRange::getLower(), llvm::ConstantRange::getUpper(), isConstantRangeAttrKind(), llvm::ConstantRange::isFullSet(), llvm::LLVMContext::pImpl, and llvm::APInt::Profile().
|
static |
Definition at line 148 of file Attributes.cpp.
References llvm::LLVMContextImpl::Alloc, assert(), Attribute(), llvm::LLVMContextImpl::AttrsSet, isTypeAttrKind(), and llvm::LLVMContext::pImpl.
|
static |
Return a uniquified Attribute object.
Definition at line 94 of file Attributes.cpp.
References llvm::LLVMContextImpl::Alloc, assert(), Attribute(), llvm::LLVMContextImpl::AttrsSet, isEnumAttrKind(), isIntAttrKind(), and llvm::LLVMContext::pImpl.
Referenced by addAllocTypeAttribute(), llvm::AttrBuilder::addAttribute(), llvm::AttributeList::addAttributeAtIndex(), llvm::AttrBuilder::addConstantRangeAttr(), llvm::AttrBuilder::addConstantRangeListAttr(), 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(), LLVMCreateConstantRangeAttribute(), LLVMCreateEnumAttribute(), LLVMCreateStringAttribute(), LLVMCreateTypeAttribute(), processCallSite(), setAllocKind(), llvm::codegen::setFunctionAttributes(), llvm::setInlineRemark(), setParamElementType(), setParamReadNone(), setParamReadOnly(), setParamWriteOnly(), and llvm::VFABI::setVectorVariantNames().
|
static |
Definition at line 125 of file Attributes.cpp.
References llvm::LLVMContextImpl::Alloc, llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold, GrowthDelay >::Allocate(), Attribute(), llvm::LLVMContextImpl::AttrsSet, llvm::StringRef::empty(), llvm::LLVMContext::pImpl, and llvm::StringAttributeImpl::totalSizeToAlloc().
MaybeAlign Attribute::getAlignment | ( | ) | const |
Returns the alignment field of an attribute as a byte alignment value.
Definition at line 427 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
AllocFnKind Attribute::getAllocKind | ( | ) | const |
Definition at line 478 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
Referenced by getAsString().
Returns the argument numbers for the allocsize attribute.
Definition at line 454 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), hasAttribute(), and unpackAllocSizeArgs().
Referenced by getAllocationSize(), and getAsString().
std::string Attribute::getAsString | ( | bool | InAttrGrp = false | ) | const |
The Attribute is converted to a string of equivalent mnemonic.
This is, presumably, for writing out the mnemonics for the assembly writer.
Definition at line 522 of file Attributes.cpp.
References llvm::Aligned, llvm::Alloc, llvm::ArgMem, assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::Default, llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::First, llvm::raw_ostream::flush(), llvm::Free, getAllocKind(), getAllocSizeArgs(), llvm::ConstantRange::getBitWidth(), getInitializes(), getKindAsEnum(), getKindAsString(), llvm::ConstantRange::getLower(), getMemoryEffects(), llvm::MemoryEffectsBase< LocationEnum >::getModRef(), getModRefStr(), getNameFromAttrKind(), getNoFPClass(), llvm::ConstantRange::getUpper(), getUWTableKind(), getValueAsConstantRange(), getValueAsInt(), llvm::AttributeImpl::getValueAsString(), getValueAsType(), getVScaleRangeMax(), getVScaleRangeMin(), hasAttribute(), llvm::InaccessibleMem, isEnumAttribute(), isStringAttribute(), isTypeAttribute(), llvm_unreachable, llvm::MemoryEffectsBase< LocationEnum >::locations(), Name, llvm::NoModRef, llvm::None, OS, llvm::Other, llvm::Type::print(), llvm::ConstantRangeList::print(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Realloc, llvm::StringRef::str(), llvm::Uninitialized, llvm::Unknown, and llvm::Zeroed.
|
static |
Definition at line 304 of file Attributes.cpp.
References llvm::StringSwitch< T, R >::Default(), and None.
Referenced by llvm::fillMapFromAssume(), forceAttributes(), llvm::getKnowledgeFromBundle(), llvm::hasAttributeInAssume(), LLVMGetEnumAttributeKindForName(), and llvm::ForceFunctionAttrsPass::run().
uint64_t Attribute::getDereferenceableBytes | ( | ) | const |
Returns the number of dereferenceable bytes from the dereferenceable attribute.
Definition at line 439 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
Referenced by tryToMoveFreeBeforeNullTest().
uint64_t Attribute::getDereferenceableOrNullBytes | ( | ) | const |
Returns the number of dereferenceable_or_null bytes from the dereferenceable_or_null attribute.
Definition at line 446 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
ArrayRef< ConstantRange > Attribute::getInitializes | ( | ) | const |
Returns the value of the initializes attribute.
Definition at line 502 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsConstantRangeList(), and hasAttribute().
Referenced by getAsString().
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 363 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getKindAsEnum(), isConstantRangeAttribute(), isConstantRangeListAttribute(), isEnumAttribute(), isIntAttribute(), isTypeAttribute(), and None.
Referenced by llvm::AttrBuilder::addAttribute(), addIfNotExistent(), getAsString(), getWithNewType(), and AttributeComparator::operator()().
StringRef Attribute::getKindAsString | ( | ) | const |
Return the attribute's kind as a string.
This requires the attribute to be a string attribute.
Definition at line 385 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getKindAsString(), and isStringAttribute().
Referenced by llvm::AttrBuilder::addAttribute(), addIfNotExistent(), getAsString(), and AttributeComparator::operator()().
MemoryEffects Attribute::getMemoryEffects | ( | ) | const |
Returns memory effects.
Definition at line 484 of file Attributes.cpp.
References assert(), llvm::MemoryEffectsBase< LocationEnum >::createFromIntValue(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
Referenced by addIfNotExistent(), and getAsString().
|
static |
Definition at line 313 of file Attributes.cpp.
References llvm_unreachable, and None.
Referenced by getAsString(), and llvm::hasAttributeInAssume().
FPClassTest Attribute::getNoFPClass | ( | ) | const |
Return the FPClassTest for nofpclass.
Definition at line 490 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
Referenced by getAsString().
const ConstantRange & Attribute::getRange | ( | ) | const |
Returns the value of the range attribute.
Definition at line 496 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsConstantRange(), and hasAttribute().
Referenced by AddReturnAttributes(), llvm::Argument::getRange(), and llvm::CallBase::getRange().
|
inline |
Return a raw pointer that uniquely identifies this attribute.
Definition at line 304 of file Attributes.h.
Referenced by llvm::wrap().
MaybeAlign Attribute::getStackAlignment | ( | ) | const |
Returns the stack alignment field of an attribute as a byte alignment value.
Definition at line 433 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
UWTableKind Attribute::getUWTableKind | ( | ) | const |
Definition at line 472 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and hasAttribute().
Referenced by getAsString().
bool Attribute::getValueAsBool | ( | ) | const |
Return the attribute's value as a boolean.
This requires that the attribute be a string attribute.
Definition at line 378 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsBool(), and isStringAttribute().
Referenced by llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), llvm::TargetLoweringBase::areJTsAllowed(), atomicIgnoresDenormalModeOrFPModeIsFTZ(), hasUnsafeFPMath(), llvm::FastISel::lowerCall(), and switchToLookupTable().
const ConstantRange & Attribute::getValueAsConstantRange | ( | ) | const |
Return the attribute's value as a ConstantRange.
This requires the attribute to be a ConstantRange attribute.
Definition at line 406 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsConstantRange(), and isConstantRangeAttribute().
Referenced by getAsString().
ArrayRef< ConstantRange > Attribute::getValueAsConstantRangeList | ( | ) | const |
Return the attribute's value as a ConstantRange array.
This requires the attribute to be a ConstantRangeList attribute.
Definition at line 412 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsConstantRangeList(), and isConstantRangeListAttribute().
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 371 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), and isIntAttribute().
Referenced by adjustByValArgAlignment(), getAllocFnKind(), getAsString(), and isEqualOrWorse().
StringRef Attribute::getValueAsString | ( | ) | const |
Return the attribute's value as a string.
This requires the attribute to be a string attribute.
Definition at line 392 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(), llvm::CallLowering::lowerCall(), llvm::RISCVTargetLowering::LowerFormalArguments(), llvm::RISCVTargetLowering::LowerReturn(), llvm::parseStatepointDirectivesFromAttrs(), llvm::OpenMPIRBuilder::readThreadBoundsForKernel(), and llvm::AttributeFuncs::updateMinLegalVectorWidthAttr().
Type * Attribute::getValueAsType | ( | ) | const |
Return the attribute's value as a Type.
This requires the attribute to be a type attribute.
Definition at line 399 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsType(), and isTypeAttribute().
Referenced by getAsString().
std::optional< unsigned > Attribute::getVScaleRangeMax | ( | ) | const |
Returns the maximum value for the vscale_range attribute or std::nullopt when unknown.
Definition at line 466 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), hasAttribute(), and unpackVScaleRangeArgs().
Referenced by getAsString(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::getVScaleRange(), llvm::InstCombinerImpl::visitSExt(), llvm::InstCombinerImpl::visitTrunc(), and llvm::InstCombinerImpl::visitZExt().
unsigned Attribute::getVScaleRangeMin | ( | ) | const |
Returns the minimum value for the vscale_range attribute.
Definition at line 460 of file Attributes.cpp.
References assert(), llvm::AttributeImpl::getValueAsInt(), hasAttribute(), and unpackVScaleRangeArgs().
Referenced by getAsString(), llvm::RISCVTargetMachine::getSubtargetImpl(), getVScaleForTuning(), and llvm::getVScaleRange().
|
static |
Return a uniquified Attribute object that has the specific alignment set.
Definition at line 233 of file Attributes.cpp.
References A, assert(), get(), and llvm::Value::MaximumAlignment.
Referenced by llvm::MatrixBuilder::CreateColumnMajorLoad(), llvm::MatrixBuilder::CreateColumnMajorStore(), llvm::IRBuilderBase::CreateElementUnorderedAtomicMemMove(), llvm::IRBuilderBase::CreateThreadLocalAddress(), llvm::VPWidenLoadEVLRecipe::execute(), llvm::VPWidenStoreEVLRecipe::execute(), LLVMSetInstrParamAlignment(), LLVMSetParamAlignment(), lowerKernelArguments(), llvm::MemIntrinsicBase< Derived >::setDestAlignment(), llvm::MemTransferBase< BaseCL >::setSourceAlignment(), and llvm::InstCombinerImpl::visitCallInst().
|
static |
Definition at line 291 of file Attributes.cpp.
References assert(), get(), and packAllocSizeArgs().
Referenced by doPromotion(), and setAllocSize().
|
static |
Definition at line 263 of file Attributes.cpp.
References get().
|
static |
Definition at line 255 of file Attributes.cpp.
References get().
|
static |
Definition at line 243 of file Attributes.cpp.
References assert(), and get().
Referenced by annotateDereferenceableBytes(), and lowerKernelArguments().
|
static |
Definition at line 249 of file Attributes.cpp.
|
static |
Definition at line 271 of file Attributes.cpp.
References get().
|
static |
Definition at line 280 of file Attributes.cpp.
References get(), and llvm::MemoryEffectsBase< LocationEnum >::toIntValue().
Referenced by fixupFPReturnAndCall(), llvm::AMDGPULibFunc::getOrInsertFunction(), runIPSCCP(), llvm::Function::setMemoryEffects(), and llvm::CallBase::setMemoryEffects().
|
inline |
For a typed attribute, return the equivalent attribute with the type changed to ReplacementTy
.
Definition at line 166 of file Attributes.h.
References assert(), get(), getKindAsEnum(), and isTypeAttribute().
Referenced by llvm::AttributeList::replaceAttributeTypeAtIndex().
|
static |
Definition at line 285 of file Attributes.cpp.
References get().
|
static |
Definition at line 267 of file Attributes.cpp.
References get().
|
static |
Definition at line 238 of file Attributes.cpp.
|
static |
Definition at line 259 of file Attributes.cpp.
References get().
|
static |
Definition at line 275 of file Attributes.cpp.
References get().
|
static |
Definition at line 298 of file Attributes.cpp.
References get(), and packVScaleRangeArgs().
Return true if the attribute is present.
Definition at line 418 of file Attributes.cpp.
References llvm::AttributeImpl::hasAttribute(), and None.
Referenced by getAlignment(), getAllocKind(), getAllocSizeArgs(), getAsString(), getDereferenceableBytes(), getDereferenceableOrNullBytes(), getInitializes(), getMemoryEffects(), getNoFPClass(), getRange(), getStackAlignment(), getUWTableKind(), getVScaleRangeMax(), getVScaleRangeMin(), and llvm::isStatepointDirectiveAttr().
Return true if the target-dependent attribute is present.
Definition at line 422 of file Attributes.cpp.
References llvm::AttributeImpl::hasAttribute(), and isStringAttribute().
bool Attribute::hasParentContext | ( | LLVMContext & | C | ) | const |
Return true if this attribute belongs to the LLVMContext.
Definition at line 707 of file Attributes.cpp.
References assert(), llvm::CallingConv::C, isValid(), and llvm::AttributeImpl::Profile().
bool Attribute::isConstantRangeAttribute | ( | ) | const |
Return true if the attribute is a ConstantRange attribute.
Definition at line 355 of file Attributes.cpp.
References llvm::AttributeImpl::isConstantRangeAttribute().
Referenced by getKindAsEnum(), and getValueAsConstantRange().
Definition at line 108 of file Attributes.h.
Referenced by get().
bool Attribute::isConstantRangeListAttribute | ( | ) | const |
Return true if the attribute is a ConstantRangeList attribute.
Definition at line 359 of file Attributes.cpp.
References llvm::AttributeImpl::isConstantRangeListAttribute().
Referenced by getKindAsEnum(), and getValueAsConstantRangeList().
Definition at line 111 of file Attributes.h.
Referenced by get().
bool Attribute::isEnumAttribute | ( | ) | const |
Return true if the attribute is an Attribute::AttrKind type.
Definition at line 339 of file Attributes.cpp.
References llvm::AttributeImpl::isEnumAttribute().
Referenced by addIfNotExistent(), getAsString(), and getKindAsEnum().
Definition at line 99 of file Attributes.h.
Referenced by clampReturnedValueStates(), get(), llvm::IRAttribute< AK, BaseType, AAType >::hasTrivialInitializer(), and llvm::AttributeImpl::Profile().
Return true if the provided string matches the IR name of an attribute.
example: "noalias" return true but not "NoAlias"
Definition at line 327 of file Attributes.cpp.
References llvm::StringSwitch< T, R >::Default(), and Name.
Referenced by llvm::hasAttributeInAssume().
bool Attribute::isIntAttribute | ( | ) | const |
Return true if the attribute is an integer attribute.
Definition at line 343 of file Attributes.cpp.
References llvm::AttributeImpl::isIntAttribute().
Referenced by addIfNotExistent(), getKindAsEnum(), getValueAsInt(), and isEqualOrWorse().
Definition at line 102 of file Attributes.h.
Referenced by get(), llvm::AttrBuilder::getRawIntAttr(), llvm::hasAttributeInAssume(), llvm::IntAttributeImpl::IntAttributeImpl(), and llvm::AttributeImpl::Profile().
bool Attribute::isStringAttribute | ( | ) | const |
Return true if the attribute is a string (target-dependent) attribute.
Definition at line 347 of file Attributes.cpp.
References llvm::AttributeImpl::isStringAttribute().
Referenced by llvm::AttrBuilder::addAttribute(), addIfNotExistent(), llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), getAsString(), getKindAsString(), getValueAsBool(), getValueAsString(), hasAttribute(), AttributeComparator::operator()(), and llvm::parseStatepointDirectivesFromAttrs().
bool Attribute::isTypeAttribute | ( | ) | const |
Return true if the attribute is a type attribute.
Definition at line 351 of file Attributes.cpp.
References llvm::AttributeImpl::isTypeAttribute().
Referenced by getAsString(), getKindAsEnum(), getValueAsType(), and getWithNewType().
Definition at line 105 of file Attributes.h.
Referenced by addRawAttributeValue(), get(), and llvm::AttrBuilder::getTypeAttr().
|
inline |
Return true if the attribute is any kind of attribute.
Definition at line 203 of file Attributes.h.
Referenced by AddReturnAttributes(), adjustCallerStackProbeSize(), adjustMinLegalVectorWidth(), llvm::AttrBuilder::contains(), llvm::getAllocationFamily(), getAllocFnKind(), llvm::Function::getDenormalModeF32Raw(), llvm::AMDGPUTargetMachine::getFeatureString(), llvm::CallBase::getFnAttr(), llvm::AMDGPUTargetMachine::getGPUName(), getParameterABIAttributes(), llvm::Argument::getRange(), llvm::CallBase::getRange(), 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::getVScaleRange(), hasParentContext(), isThumbFunction(), tryToMoveFreeBeforeNullTest(), and llvm::AttributeFuncs::updateMinLegalVectorWidthAttr().
Definition at line 296 of file Attributes.h.
References A.
Less-than operator. Useful for sorting the attributes list.
Definition at line 715 of file Attributes.cpp.
References A.
void Attribute::Profile | ( | FoldingSetNodeID & | ID | ) | const |
Definition at line 722 of file Attributes.cpp.
Definition at line 96 of file Attributes.h.
Definition at line 97 of file Attributes.h.