LLVM 20.0.0git
|
#include "llvm/IR/Attributes.h"
Classes | |
struct | index_iterator |
Public Types | |
enum | AttrIndex : unsigned { ReturnIndex = 0U , FunctionIndex = ~0U , FirstArgIndex = 1 } |
using | iterator = const AttributeSet * |
Public Member Functions | |
AttributeList ()=default | |
AttributeList | addAttributeAtIndex (LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const |
Add an attribute to the attribute set at the given index. | |
AttributeList | addAttributeAtIndex (LLVMContext &C, unsigned Index, StringRef Kind, StringRef Value=StringRef()) const |
Add an attribute to the attribute set at the given index. | |
AttributeList | addAttributeAtIndex (LLVMContext &C, unsigned Index, Attribute A) const |
Add an attribute to the attribute set at the given index. | |
AttributeList | addAttributesAtIndex (LLVMContext &C, unsigned Index, const AttrBuilder &B) const |
Add attributes to the attribute set at the given index. | |
AttributeList | addFnAttribute (LLVMContext &C, Attribute::AttrKind Kind) const |
Add a function attribute to the list. | |
AttributeList | addFnAttribute (LLVMContext &C, Attribute Attr) const |
Add a function attribute to the list. | |
AttributeList | addFnAttribute (LLVMContext &C, StringRef Kind, StringRef Value=StringRef()) const |
Add a function attribute to the list. | |
AttributeList | addFnAttributes (LLVMContext &C, const AttrBuilder &B) const |
Add function attribute to the list. | |
AttributeList | addRetAttribute (LLVMContext &C, Attribute::AttrKind Kind) const |
Add a return value attribute to the list. | |
AttributeList | addRetAttribute (LLVMContext &C, Attribute Attr) const |
Add a return value attribute to the list. | |
AttributeList | addRetAttributes (LLVMContext &C, const AttrBuilder &B) const |
Add a return value attribute to the list. | |
AttributeList | addParamAttribute (LLVMContext &C, unsigned ArgNo, Attribute::AttrKind Kind) const |
Add an argument attribute to the list. | |
AttributeList | addParamAttribute (LLVMContext &C, unsigned ArgNo, StringRef Kind, StringRef Value=StringRef()) const |
Add an argument attribute to the list. | |
AttributeList | addParamAttribute (LLVMContext &C, ArrayRef< unsigned > ArgNos, Attribute A) const |
Add an attribute to the attribute list at the given arg indices. | |
AttributeList | addParamAttributes (LLVMContext &C, unsigned ArgNo, const AttrBuilder &B) const |
Add an argument attribute to the list. | |
AttributeList | removeAttributeAtIndex (LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const |
Remove the specified attribute at the specified index from this attribute list. | |
AttributeList | removeAttributeAtIndex (LLVMContext &C, unsigned Index, StringRef Kind) const |
Remove the specified attribute at the specified index from this attribute list. | |
AttributeList | removeAttribute (LLVMContext &C, unsigned Index, StringRef Kind) const |
AttributeList | removeAttributesAtIndex (LLVMContext &C, unsigned Index, const AttributeMask &AttrsToRemove) const |
Remove the specified attributes at the specified index from this attribute list. | |
AttributeList | removeAttributesAtIndex (LLVMContext &C, unsigned Index) const |
Remove all attributes at the specified index from this attribute list. | |
AttributeList | removeFnAttribute (LLVMContext &C, Attribute::AttrKind Kind) const |
Remove the specified attribute at the function index from this attribute list. | |
AttributeList | removeFnAttribute (LLVMContext &C, StringRef Kind) const |
Remove the specified attribute at the function index from this attribute list. | |
AttributeList | removeFnAttributes (LLVMContext &C, const AttributeMask &AttrsToRemove) const |
Remove the specified attribute at the function index from this attribute list. | |
AttributeList | removeFnAttributes (LLVMContext &C) const |
Remove the attributes at the function index from this attribute list. | |
AttributeList | removeRetAttribute (LLVMContext &C, Attribute::AttrKind Kind) const |
Remove the specified attribute at the return value index from this attribute list. | |
AttributeList | removeRetAttribute (LLVMContext &C, StringRef Kind) const |
Remove the specified attribute at the return value index from this attribute list. | |
AttributeList | removeRetAttributes (LLVMContext &C, const AttributeMask &AttrsToRemove) const |
Remove the specified attribute at the return value index from this attribute list. | |
AttributeList | removeParamAttribute (LLVMContext &C, unsigned ArgNo, Attribute::AttrKind Kind) const |
Remove the specified attribute at the specified arg index from this attribute list. | |
AttributeList | removeParamAttribute (LLVMContext &C, unsigned ArgNo, StringRef Kind) const |
Remove the specified attribute at the specified arg index from this attribute list. | |
AttributeList | removeParamAttributes (LLVMContext &C, unsigned ArgNo, const AttributeMask &AttrsToRemove) const |
Remove the specified attribute at the specified arg index from this attribute list. | |
AttributeList | removeParamAttributes (LLVMContext &C, unsigned ArgNo) const |
Remove all attributes at the specified arg index from this attribute list. | |
AttributeList | replaceAttributeTypeAtIndex (LLVMContext &C, unsigned ArgNo, Attribute::AttrKind Kind, Type *ReplacementTy) const |
Replace the type contained by attribute AttrKind at index ArgNo wih ReplacementTy , preserving all other attributes. | |
AttributeList | addDereferenceableRetAttr (LLVMContext &C, uint64_t Bytes) const |
Add the dereferenceable attribute to the attribute set at the given index. | |
AttributeList | addDereferenceableParamAttr (LLVMContext &C, unsigned ArgNo, uint64_t Bytes) const |
Add the dereferenceable attribute to the attribute set at the given arg index. | |
AttributeList | addDereferenceableOrNullParamAttr (LLVMContext &C, unsigned ArgNo, uint64_t Bytes) const |
Add the dereferenceable_or_null attribute to the attribute set at the given arg index. | |
AttributeList | addRangeRetAttr (LLVMContext &C, const ConstantRange &CR) const |
Add the range attribute to the attribute set at the return value index. | |
AttributeList | addAllocSizeParamAttr (LLVMContext &C, unsigned ArgNo, unsigned ElemSizeArg, const std::optional< unsigned > &NumElemsArg) |
Add the allocsize attribute to the attribute set at the given arg index. | |
AttributeSet | getAttributes (unsigned Index) const |
The attributes for the specified index are returned. | |
AttributeSet | getParamAttrs (unsigned ArgNo) const |
The attributes for the argument or parameter at the given index are returned. | |
AttributeSet | getRetAttrs () const |
The attributes for the ret value are returned. | |
AttributeSet | getFnAttrs () const |
The function attributes are returned. | |
bool | hasAttributeAtIndex (unsigned Index, Attribute::AttrKind Kind) const |
Return true if the attribute exists at the given index. | |
bool | hasAttributeAtIndex (unsigned Index, StringRef Kind) const |
Return true if the attribute exists at the given index. | |
bool | hasAttributesAtIndex (unsigned Index) const |
Return true if attribute exists at the given index. | |
bool | hasParamAttr (unsigned ArgNo, Attribute::AttrKind Kind) const |
Return true if the attribute exists for the given argument. | |
bool | hasParamAttr (unsigned ArgNo, StringRef Kind) const |
Return true if the attribute exists for the given argument. | |
bool | hasParamAttrs (unsigned ArgNo) const |
Return true if attributes exists for the given argument. | |
bool | hasRetAttr (Attribute::AttrKind Kind) const |
Return true if the attribute exists for the return value. | |
bool | hasRetAttr (StringRef Kind) const |
Return true if the attribute exists for the return value. | |
bool | hasRetAttrs () const |
Return true if attributes exist for the return value. | |
bool | hasFnAttr (Attribute::AttrKind Kind) const |
Return true if the attribute exists for the function. | |
bool | hasFnAttr (StringRef Kind) const |
Return true if the attribute exists for the function. | |
bool | hasFnAttrs () const |
Return true the attributes exist for the function. | |
bool | hasAttrSomewhere (Attribute::AttrKind Kind, unsigned *Index=nullptr) const |
Return true if the specified attribute is set for at least one parameter or for the return value. | |
Attribute | getAttributeAtIndex (unsigned Index, Attribute::AttrKind Kind) const |
Return the attribute object that exists at the given index. | |
Attribute | getAttributeAtIndex (unsigned Index, StringRef Kind) const |
Return the attribute object that exists at the given index. | |
Attribute | getParamAttr (unsigned ArgNo, Attribute::AttrKind Kind) const |
Return the attribute object that exists at the arg index. | |
Attribute | getParamAttr (unsigned ArgNo, StringRef Kind) const |
Return the attribute object that exists at the given index. | |
Attribute | getFnAttr (Attribute::AttrKind Kind) const |
Return the attribute object that exists for the function. | |
Attribute | getFnAttr (StringRef Kind) const |
Return the attribute object that exists for the function. | |
Attribute | getRetAttr (Attribute::AttrKind Kind) const |
Return the attribute for the given attribute kind for the return value. | |
MaybeAlign | getRetAlignment () const |
Return the alignment of the return value. | |
MaybeAlign | getParamAlignment (unsigned ArgNo) const |
Return the alignment for the specified function parameter. | |
MaybeAlign | getParamStackAlignment (unsigned ArgNo) const |
Return the stack alignment for the specified function parameter. | |
Type * | getParamByValType (unsigned ArgNo) const |
Return the byval type for the specified function parameter. | |
Type * | getParamStructRetType (unsigned ArgNo) const |
Return the sret type for the specified function parameter. | |
Type * | getParamByRefType (unsigned ArgNo) const |
Return the byref type for the specified function parameter. | |
Type * | getParamPreallocatedType (unsigned ArgNo) const |
Return the preallocated type for the specified function parameter. | |
Type * | getParamInAllocaType (unsigned ArgNo) const |
Return the inalloca type for the specified function parameter. | |
Type * | getParamElementType (unsigned ArgNo) const |
Return the elementtype type for the specified function parameter. | |
MaybeAlign | getFnStackAlignment () const |
Get the stack alignment of the function. | |
MaybeAlign | getRetStackAlignment () const |
Get the stack alignment of the return value. | |
uint64_t | getRetDereferenceableBytes () const |
Get the number of dereferenceable bytes (or zero if unknown) of the return value. | |
uint64_t | getParamDereferenceableBytes (unsigned Index) const |
Get the number of dereferenceable bytes (or zero if unknown) of an arg. | |
uint64_t | getRetDereferenceableOrNullBytes () const |
Get the number of dereferenceable_or_null bytes (or zero if unknown) of the return value. | |
uint64_t | getParamDereferenceableOrNullBytes (unsigned ArgNo) const |
Get the number of dereferenceable_or_null bytes (or zero if unknown) of an arg. | |
FPClassTest | getRetNoFPClass () const |
Get the disallowed floating-point classes of the return value. | |
FPClassTest | getParamNoFPClass (unsigned ArgNo) const |
Get the disallowed floating-point classes of the argument value. | |
UWTableKind | getUWTableKind () const |
Get the unwind table kind requested for the function. | |
AllocFnKind | getAllocKind () const |
MemoryEffects | getMemoryEffects () const |
Returns memory effects of the function. | |
std::string | getAsString (unsigned Index, bool InAttrGrp=false) const |
Return the attributes at the index as a string. | |
bool | hasParentContext (LLVMContext &C) const |
Return true if this attribute list belongs to the LLVMContext. | |
iterator | begin () const |
iterator | end () const |
unsigned | getNumAttrSets () const |
index_iterator | indexes () const |
Use this to iterate over the valid attribute indexes. | |
bool | operator== (const AttributeList &RHS) const |
operator==/!= - Provide equality predicates. | |
bool | operator!= (const AttributeList &RHS) const |
void * | getRawPointer () const |
Return a raw pointer that uniquely identifies this attribute list. | |
bool | isEmpty () const |
Return true if there are no attributes. | |
void | print (raw_ostream &O) const |
void | dump () const |
Friends | |
class | AttrBuilder |
class | AttributeListImpl |
class | AttributeSet |
class | AttributeSetNode |
template<typename Ty , typename Enable > | |
struct | DenseMapInfo |
Definition at line 468 of file Attributes.h.
using llvm::AttributeList::iterator = const AttributeSet * |
Definition at line 950 of file Attributes.h.
Enumerator | |
---|---|
ReturnIndex | |
FunctionIndex | |
FirstArgIndex |
Definition at line 470 of file Attributes.h.
|
default |
AttributeList AttributeList::addAllocSizeParamAttr | ( | LLVMContext & | C, |
unsigned | ArgNo, | ||
unsigned | ElemSizeArg, | ||
const std::optional< unsigned > & | NumElemsArg | ||
) |
Add the allocsize attribute to the attribute set at the given arg index.
Returns a new list because attribute lists are immutable.
Definition at line 1609 of file Attributes.cpp.
References addParamAttributes(), B, and llvm::CallingConv::C.
AttributeList AttributeList::addAttributeAtIndex | ( | LLVMContext & | C, |
unsigned | Index, | ||
Attribute | A | ||
) | const |
Add an attribute to the attribute set at the given index.
Returns a new list because attribute lists are immutable.
Definition at line 1481 of file Attributes.cpp.
References A, addAttributesAtIndex(), B, and llvm::CallingConv::C.
AttributeList AttributeList::addAttributeAtIndex | ( | LLVMContext & | C, |
unsigned | Index, | ||
Attribute::AttrKind | Kind | ||
) | const |
Add an attribute to the attribute set at the given index.
Returns a new list because attribute lists are immutable.
Definition at line 1462 of file Attributes.cpp.
References llvm::CallingConv::C, llvm::AttributeSet::get(), llvm::Attribute::get(), getAttributes(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::Function::addAttributeAtIndex(), llvm::CallBase::addAttributeAtIndex(), addFnAttribute(), addParamAttribute(), and addRetAttribute().
AttributeList AttributeList::addAttributeAtIndex | ( | LLVMContext & | C, |
unsigned | Index, | ||
StringRef | Kind, | ||
StringRef | Value = StringRef() |
||
) | const |
Add an attribute to the attribute set at the given index.
Returns a new list because attribute lists are immutable.
Definition at line 1473 of file Attributes.cpp.
References addAttributesAtIndex(), B, and llvm::CallingConv::C.
AttributeList AttributeList::addAttributesAtIndex | ( | LLVMContext & | C, |
unsigned | Index, | ||
const AttrBuilder & | B | ||
) | const |
Add attributes to the attribute set at the given index.
Returns a new list because attribute lists are immutable.
Definition at line 1505 of file Attributes.cpp.
References B, llvm::CallingConv::C, get(), llvm::AttributeSet::get(), and getAttributes().
Referenced by addAttributeAtIndex(), addFnAttributes(), addParamAttributes(), and addRetAttributes().
AttributeList AttributeList::addDereferenceableOrNullParamAttr | ( | LLVMContext & | C, |
unsigned | ArgNo, | ||
uint64_t | Bytes | ||
) | const |
Add the dereferenceable_or_null attribute to the attribute set at the given arg index.
Returns a new list because attribute lists are immutable.
Definition at line 1595 of file Attributes.cpp.
References addParamAttributes(), B, and llvm::CallingConv::C.
Referenced by llvm::Function::addDereferenceableOrNullParamAttr().
AttributeList AttributeList::addDereferenceableParamAttr | ( | LLVMContext & | C, |
unsigned | ArgNo, | ||
uint64_t | Bytes | ||
) | const |
Add the dereferenceable attribute to the attribute set at the given arg index.
Returns a new list because attribute lists are immutable.
Definition at line 1586 of file Attributes.cpp.
References addParamAttributes(), B, and llvm::CallingConv::C.
Referenced by llvm::Function::addDereferenceableParamAttr(), and llvm::CallBase::addDereferenceableParamAttr().
AttributeList AttributeList::addDereferenceableRetAttr | ( | LLVMContext & | C, |
uint64_t | Bytes | ||
) | const |
Add the dereferenceable attribute to the attribute set at the given index.
Returns a new list because attribute lists are immutable.
Definition at line 1579 of file Attributes.cpp.
References addRetAttributes(), B, and llvm::CallingConv::C.
Referenced by llvm::CallBase::addDereferenceableRetAttr().
|
inline |
Add a function attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 562 of file Attributes.h.
References addAttributeAtIndex(), llvm::CallingConv::C, and FunctionIndex.
|
inline |
Add a function attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 555 of file Attributes.h.
References addAttributeAtIndex(), llvm::CallingConv::C, and FunctionIndex.
Referenced by llvm::Function::addFnAttr(), llvm::CallBase::addFnAttr(), emitTPIDR2Save(), and llvm::AMDGPULibFunc::getOrInsertFunction().
|
inline |
Add a function attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 570 of file Attributes.h.
References addAttributeAtIndex(), llvm::CallingConv::C, and FunctionIndex.
|
inline |
Add function attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 577 of file Attributes.h.
References addAttributesAtIndex(), B, llvm::CallingConv::C, and FunctionIndex.
Referenced by llvm::Function::addFnAttrs(), llvm::OpenMPIRBuilder::createReductionsGPU(), and legalizeCallAttributes().
AttributeList AttributeList::addParamAttribute | ( | LLVMContext & | C, |
ArrayRef< unsigned > | ArgNos, | ||
Attribute | A | ||
) | const |
Add an attribute to the attribute list at the given arg indices.
Returns a new list because attribute lists are immutable.
Definition at line 1519 of file Attributes.cpp.
References A, assert(), attrIdxToArrayIdx(), B, llvm::ArrayRef< T >::back(), begin(), llvm::CallingConv::C, end(), FirstArgIndex, llvm::AttributeSet::get(), llvm::is_sorted(), llvm::SmallVectorImpl< T >::resize(), and llvm::SmallVectorBase< Size_T >::size().
|
inline |
Add an argument attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 606 of file Attributes.h.
References addAttributeAtIndex(), llvm::CallingConv::C, and FirstArgIndex.
Referenced by llvm::Function::addParamAttr(), llvm::CallBase::addParamAttr(), and processCallSite().
|
inline |
Add an argument attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 614 of file Attributes.h.
References addAttributeAtIndex(), llvm::CallingConv::C, and FirstArgIndex.
|
inline |
Add an argument attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 627 of file Attributes.h.
References addAttributesAtIndex(), B, llvm::CallingConv::C, and FirstArgIndex.
Referenced by addAllocSizeParamAttr(), addDereferenceableOrNullParamAttr(), addDereferenceableParamAttr(), llvm::Function::addParamAttrs(), and legalizeCallAttributes().
AttributeList AttributeList::addRangeRetAttr | ( | LLVMContext & | C, |
const ConstantRange & | CR | ||
) | const |
Add the range attribute to the attribute set at the return value index.
Returns a new list because attribute lists are immutable.
Definition at line 1602 of file Attributes.cpp.
References addRetAttributes(), B, and llvm::CallingConv::C.
Referenced by llvm::Function::addRangeRetAttr(), and llvm::CallBase::addRangeRetAttr().
|
inline |
Add a return value attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 591 of file Attributes.h.
References addAttributeAtIndex(), llvm::CallingConv::C, and ReturnIndex.
|
inline |
Add a return value attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 584 of file Attributes.h.
References addAttributeAtIndex(), llvm::CallingConv::C, and ReturnIndex.
Referenced by llvm::Function::addRetAttr(), and llvm::CallBase::addRetAttr().
|
inline |
Add a return value attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 598 of file Attributes.h.
References addAttributesAtIndex(), B, llvm::CallingConv::C, and ReturnIndex.
Referenced by addDereferenceableRetAttr(), addRangeRetAttr(), llvm::Function::addRetAttrs(), and AddReturnAttributes().
AttributeList::iterator AttributeList::begin | ( | ) | const |
Definition at line 1769 of file Attributes.cpp.
Referenced by addParamAttribute().
LLVM_DUMP_METHOD void AttributeList::dump | ( | ) | const |
Definition at line 1809 of file Attributes.cpp.
References llvm::dbgs(), and print().
AttributeList::iterator AttributeList::end | ( | ) | const |
Definition at line 1773 of file Attributes.cpp.
Referenced by addParamAttribute().
|
static |
Return an AttributeList with the specified parameters in it.
Definition at line 1435 of file Attributes.cpp.
References AttrBuilder, llvm::CallingConv::C, llvm::AttributeSet::get(), I, llvm::List, and llvm::AttrBuilder::merge().
|
static |
Create an AttributeList with the specified parameters in it.
Definition at line 1292 of file Attributes.cpp.
References llvm::all_of(), assert(), llvm::CallingConv::C, llvm::SmallVectorImpl< T >::emplace_back(), get(), llvm::AttributeSet::get(), I, llvm::is_sorted(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by addAttributesAtIndex(), callBufferedPrintfStart(), llvm::CloneFunctionInto(), doPromotion(), llvm::emitMemCpyChk(), get(), llvm::GlobalVariable::getAttributesAsList(), getReturnAttrs(), llvm::InlineFunction(), makeStatepointExplicitImpl(), mergeAttributesAndFlags(), moveFunctionAdaptingType(), llvm::promoteCall(), and llvm::UpgradeIntrinsicCall().
|
static |
Definition at line 1325 of file Attributes.cpp.
References assert(), attrIdxToArrayIdx(), llvm::CallingConv::C, FunctionIndex, llvm::is_sorted(), and llvm::none_of().
|
static |
Create an AttributeList from attribute sets for a function, its return value, and all of its arguments.
Definition at line 1352 of file Attributes.cpp.
References llvm::append_range(), llvm::CallingConv::C, llvm::AttributeSet::hasAttributes(), I, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::take_front().
|
static |
Definition at line 1408 of file Attributes.cpp.
References llvm::CallingConv::C, get(), and llvm::Attribute::get().
|
static |
Definition at line 1416 of file Attributes.cpp.
References assert(), llvm::ArrayRef< T >::begin(), llvm::CallingConv::C, get(), llvm::Attribute::get(), and llvm::ArrayRef< T >::size().
|
static |
Definition at line 1427 of file Attributes.cpp.
References llvm::CallingConv::C, get(), and llvm::Attribute::get().
|
static |
Definition at line 1393 of file Attributes.cpp.
References attrIdxToArrayIdx(), and llvm::CallingConv::C.
|
static |
Definition at line 1403 of file Attributes.cpp.
References B, llvm::CallingConv::C, get(), and llvm::AttributeSet::get().
AllocFnKind AttributeList::getAllocKind | ( | ) | const |
Definition at line 1742 of file Attributes.cpp.
References llvm::AttributeSet::getAllocKind(), and getFnAttrs().
Return the attributes at the index as a string.
Definition at line 1750 of file Attributes.cpp.
References llvm::AttributeSet::getAsString(), and getAttributes().
Referenced by print().
Attribute AttributeList::getAttributeAtIndex | ( | unsigned | Index, |
Attribute::AttrKind | Kind | ||
) | const |
Return the attribute object that exists at the given index.
Definition at line 1659 of file Attributes.cpp.
References llvm::AttributeSet::getAttribute(), and getAttributes().
Referenced by llvm::Function::getAttributeAtIndex(), llvm::CallBase::getAttributeAtIndex(), getFnAttr(), getParamAttr(), getRetAttr(), and replaceAttributeTypeAtIndex().
Return the attribute object that exists at the given index.
Definition at line 1664 of file Attributes.cpp.
References llvm::AttributeSet::getAttribute(), and getAttributes().
AttributeSet AttributeList::getAttributes | ( | unsigned | Index | ) | const |
The attributes for the specified index are returned.
Definition at line 1754 of file Attributes.cpp.
References attrIdxToArrayIdx(), and getNumAttrSets().
Referenced by addAttributeAtIndex(), addAttributesAtIndex(), getAsString(), getAttributeAtIndex(), llvm::IRPosition::getAttrList(), getFnAttrs(), getParamAlignment(), getParamAttrs(), getParamByRefType(), getParamByValType(), getParamElementType(), getParamInAllocaType(), getParamPreallocatedType(), getParamStackAlignment(), getParamStructRetType(), getRetAlignment(), getRetAttrs(), hasAttributeAtIndex(), hasAttributesAtIndex(), llvm::CombinerHelper::matchSDivByConst(), llvm::CombinerHelper::matchUDivByConst(), print(), removeAttributeAtIndex(), and removeAttributesAtIndex().
|
inline |
Return the attribute object that exists for the function.
Definition at line 864 of file Attributes.h.
References FunctionIndex, and getAttributeAtIndex().
Referenced by getDeoptLowering(), llvm::CallBase::getFnAttr(), llvm::Function::getFnAttribute(), llvm::HexagonTargetMachine::getSubtargetImpl(), and llvm::parseStatepointDirectivesFromAttrs().
Return the attribute object that exists for the function.
Definition at line 869 of file Attributes.h.
References FunctionIndex, and getAttributeAtIndex().
AttributeSet AttributeList::getFnAttrs | ( | ) | const |
The function attributes are returned.
Definition at line 1629 of file Attributes.cpp.
References FunctionIndex, and getAttributes().
Referenced by llvm::CloneFunctionInto(), llvm::OpenMPIRBuilder::createReductionsGPU(), doPromotion(), fillOverallFunction(), getAllocKind(), getFnStackAlignment(), getMemoryEffects(), getUWTableKind(), legalizeCallAttributes(), moveFunctionAdaptingType(), llvm::promoteCall(), and llvm::UpgradeIntrinsicCall().
MaybeAlign AttributeList::getFnStackAlignment | ( | ) | const |
Get the stack alignment of the function.
Definition at line 1705 of file Attributes.cpp.
References getFnAttrs(), and llvm::AttributeSet::getStackAlignment().
Referenced by llvm::Function::getFnStackAlign().
MemoryEffects AttributeList::getMemoryEffects | ( | ) | const |
Returns memory effects of the function.
Definition at line 1746 of file Attributes.cpp.
References getFnAttrs(), and llvm::AttributeSet::getMemoryEffects().
Referenced by llvm::Function::getMemoryEffects(), llvm::CallBase::getMemoryEffects(), and llvm::SITargetLowering::getTgtMemIntrinsic().
unsigned AttributeList::getNumAttrSets | ( | ) | const |
Definition at line 1781 of file Attributes.cpp.
Referenced by getAttributes(), indexes(), and removeAttributesAtIndex().
MaybeAlign AttributeList::getParamAlignment | ( | unsigned | ArgNo | ) | const |
Return the alignment for the specified function parameter.
Definition at line 1673 of file Attributes.cpp.
References FirstArgIndex, llvm::AttributeSet::getAlignment(), and getAttributes().
Referenced by llvm::Function::getParamAlign(), and llvm::CallBase::getParamAlign().
|
inline |
Return the attribute object that exists at the arg index.
Definition at line 854 of file Attributes.h.
References FirstArgIndex, and getAttributeAtIndex().
Referenced by llvm::CallBase::getParamAttr(), and llvm::Function::getParamAttribute().
Return the attribute object that exists at the given index.
Definition at line 859 of file Attributes.h.
References FirstArgIndex, and getAttributeAtIndex().
AttributeSet AttributeList::getParamAttrs | ( | unsigned | ArgNo | ) | const |
The attributes for the argument or parameter at the given index are returned.
Definition at line 1621 of file Attributes.cpp.
References FirstArgIndex, and getAttributes().
Referenced by llvm::CloneFunctionInto(), doPromotion(), getParamDereferenceableBytes(), getParamDereferenceableOrNullBytes(), getParamNoFPClass(), llvm::Argument::getPassPointeeByValueCopySize(), llvm::Argument::getPointeeInMemoryValueType(), llvm::Attributor::identifyDefaultAbstractAttributes(), llvm::InlineFunction(), legalizeCallAttributes(), moveFunctionAdaptingType(), optimizeCallInst(), and llvm::promoteCall().
Return the byref type for the specified function parameter.
Definition at line 1689 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), and llvm::AttributeSet::getByRefType().
Referenced by llvm::Function::getParamByRefType(), and llvm::CallBase::getParamByRefType().
Return the byval type for the specified function parameter.
Definition at line 1681 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), and llvm::AttributeSet::getByValType().
Referenced by llvm::Function::getParamByValType(), and llvm::CallBase::getParamByValType().
Get the number of dereferenceable bytes (or zero if unknown) of an arg.
Definition at line 1717 of file Attributes.cpp.
References llvm::AttributeSet::getDereferenceableBytes(), and getParamAttrs().
Referenced by llvm::Function::getParamDereferenceableBytes(), and llvm::CallBase::getParamDereferenceableBytes().
Get the number of dereferenceable_or_null bytes (or zero if unknown) of an arg.
Definition at line 1726 of file Attributes.cpp.
References llvm::AttributeSet::getDereferenceableOrNullBytes(), and getParamAttrs().
Referenced by llvm::Function::getParamDereferenceableOrNullBytes(), and llvm::CallBase::getParamDereferenceableOrNullBytes().
Return the elementtype type for the specified function parameter.
Definition at line 1701 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), and llvm::AttributeSet::getElementType().
Referenced by llvm::CallBase::getParamElementType().
Return the inalloca type for the specified function parameter.
Definition at line 1697 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), and llvm::AttributeSet::getInAllocaType().
Referenced by llvm::Function::getParamInAllocaType(), and llvm::CallBase::getParamInAllocaType().
FPClassTest AttributeList::getParamNoFPClass | ( | unsigned | ArgNo | ) | const |
Get the disallowed floating-point classes of the argument value.
Definition at line 1734 of file Attributes.cpp.
References llvm::AttributeSet::getNoFPClass(), and getParamAttrs().
Referenced by llvm::Function::getParamNoFPClass(), and llvm::CallBase::getParamNoFPClass().
Return the preallocated type for the specified function parameter.
Definition at line 1693 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), and llvm::AttributeSet::getPreallocatedType().
Referenced by llvm::Function::getParamPreallocatedType(), and llvm::CallBase::getParamPreallocatedType().
MaybeAlign AttributeList::getParamStackAlignment | ( | unsigned | ArgNo | ) | const |
Return the stack alignment for the specified function parameter.
Definition at line 1677 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), and llvm::AttributeSet::getStackAlignment().
Referenced by llvm::Function::getParamStackAlign(), and llvm::CallBase::getParamStackAlign().
Return the sret type for the specified function parameter.
Definition at line 1685 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), and llvm::AttributeSet::getStructRetType().
Referenced by llvm::Function::getParamStructRetType(), and llvm::CallBase::getParamStructRetType().
|
inline |
Return a raw pointer that uniquely identifies this attribute list.
Definition at line 989 of file Attributes.h.
MaybeAlign AttributeList::getRetAlignment | ( | ) | const |
Return the alignment of the return value.
Definition at line 1669 of file Attributes.cpp.
References llvm::AttributeSet::getAlignment(), getAttributes(), and ReturnIndex.
Referenced by llvm::CallBase::getRetAlign().
|
inline |
Return the attribute for the given attribute kind for the return value.
Definition at line 874 of file Attributes.h.
References getAttributeAtIndex(), and ReturnIndex.
Referenced by llvm::CallBase::getRetAttr(), and llvm::Function::getRetAttribute().
AttributeSet AttributeList::getRetAttrs | ( | ) | const |
The attributes for the ret value are returned.
Definition at line 1625 of file Attributes.cpp.
References getAttributes(), and ReturnIndex.
Referenced by llvm::CloneFunctionInto(), doPromotion(), getRetDereferenceableBytes(), getRetDereferenceableOrNullBytes(), getRetNoFPClass(), getRetStackAlignment(), isLibCallInTailPosition(), llvm::PPCInstrInfo::isSignOrZeroExtended(), moveFunctionAdaptingType(), llvm::promoteCall(), and llvm::UpgradeIntrinsicCall().
uint64_t AttributeList::getRetDereferenceableBytes | ( | ) | const |
Get the number of dereferenceable bytes (or zero if unknown) of the return value.
Definition at line 1713 of file Attributes.cpp.
References llvm::AttributeSet::getDereferenceableBytes(), and getRetAttrs().
Referenced by llvm::CallBase::getRetDereferenceableBytes().
uint64_t AttributeList::getRetDereferenceableOrNullBytes | ( | ) | const |
Get the number of dereferenceable_or_null bytes (or zero if unknown) of the return value.
Definition at line 1721 of file Attributes.cpp.
References llvm::AttributeSet::getDereferenceableOrNullBytes(), and getRetAttrs().
Referenced by llvm::CallBase::getRetDereferenceableOrNullBytes().
FPClassTest AttributeList::getRetNoFPClass | ( | ) | const |
Get the disallowed floating-point classes of the return value.
Definition at line 1730 of file Attributes.cpp.
References llvm::AttributeSet::getNoFPClass(), and getRetAttrs().
Referenced by llvm::CallBase::getRetNoFPClass().
MaybeAlign AttributeList::getRetStackAlignment | ( | ) | const |
Get the stack alignment of the return value.
Definition at line 1709 of file Attributes.cpp.
References getRetAttrs(), and llvm::AttributeSet::getStackAlignment().
UWTableKind AttributeList::getUWTableKind | ( | ) | const |
Get the unwind table kind requested for the function.
Definition at line 1738 of file Attributes.cpp.
References getFnAttrs(), and llvm::AttributeSet::getUWTableKind().
Referenced by llvm::Function::getUWTableKind().
bool AttributeList::hasAttributeAtIndex | ( | unsigned | Index, |
Attribute::AttrKind | Kind | ||
) | const |
Return true if the attribute exists at the given index.
Definition at line 1633 of file Attributes.cpp.
References getAttributes(), and llvm::AttributeSet::hasAttribute().
Referenced by hasFnAttr(), hasParamAttr(), and hasRetAttr().
Return true if the attribute exists at the given index.
Definition at line 1638 of file Attributes.cpp.
References getAttributes(), and llvm::AttributeSet::hasAttribute().
Return true if attribute exists at the given index.
Definition at line 1642 of file Attributes.cpp.
References getAttributes(), and llvm::AttributeSet::hasAttributes().
Referenced by hasFnAttrs(), hasParamAttrs(), and hasRetAttrs().
bool AttributeList::hasAttrSomewhere | ( | Attribute::AttrKind | Kind, |
unsigned * | Index = nullptr |
||
) | const |
Return true if the specified attribute is set for at least one parameter or for the return value.
If Index is not nullptr, the index of a parameter with the specified attribute is provided.
Definition at line 1654 of file Attributes.cpp.
Referenced by llvm::XCoreFrameLowering::emitPrologue(), llvm::CallBase::getArgOperandWithAttribute(), llvm::SystemZELFRegisters::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCalleeSavedRegs(), llvm::SystemZELFRegisters::getCallPreservedMask(), llvm::AArch64RegisterInfo::getCallPreservedMask(), llvm::ARMBaseRegisterInfo::getCallPreservedMask(), llvm::AArch64RegisterInfo::getDarwinCalleeSavedRegs(), llvm::AArch64RegisterInfo::getDarwinCallPreservedMask(), getFixedObjectSize(), llvm::CallBase::hasByValArgument(), and llvm::Attributor::isValidFunctionSignatureRewrite().
bool AttributeList::hasFnAttr | ( | Attribute::AttrKind | Kind | ) | const |
Return true if the attribute exists for the function.
Definition at line 1646 of file Attributes.cpp.
Referenced by getCopyFromParts(), getDeoptLowering(), llvm::AArch64TargetLowering::getOptimalMemOpLLT(), llvm::AArch64TargetLowering::getOptimalMemOpType(), llvm::ARMTargetLowering::getOptimalMemOpType(), llvm::RISCVTargetLowering::getOptimalMemOpType(), llvm::X86TargetLowering::getOptimalMemOpType(), llvm::Function::hasFnAttribute(), llvm::AArch64TargetLowering::isIntDivCheap(), llvm::RISCVTargetLowering::isIntDivCheap(), llvm::X86TargetLowering::isIntDivCheap(), maySpeculateLanes(), llvm::TLSVariableHoistPass::runImpl(), and llvm::TargetLowering::SimplifySetCC().
Return true if the attribute exists for the function.
Definition at line 1650 of file Attributes.cpp.
References FunctionIndex, and hasAttributeAtIndex().
|
inline |
Return true the attributes exist for the function.
Definition at line 839 of file Attributes.h.
References FunctionIndex, and hasAttributesAtIndex().
|
inline |
Return true if the attribute exists for the given argument.
Definition at line 805 of file Attributes.h.
References FirstArgIndex, and hasAttributeAtIndex().
Referenced by llvm::Function::hasParamAttribute(), llvm::Function::hasStructRetAttr(), llvm::Attributor::identifyDefaultAbstractAttributes(), llvm::isLegalToPromote(), llvm::NVPTXTargetLowering::LowerFormalArguments(), and llvm::CallBase::paramHasAttr().
Return true if the attribute exists for the given argument.
Definition at line 810 of file Attributes.h.
References FirstArgIndex, and hasAttributeAtIndex().
Return true if attributes exists for the given argument.
Definition at line 815 of file Attributes.h.
References FirstArgIndex, and hasAttributesAtIndex().
bool AttributeList::hasParentContext | ( | LLVMContext & | C | ) | const |
Return true if this attribute list belongs to the LLVMContext.
Definition at line 1761 of file Attributes.cpp.
References assert(), llvm::CallingConv::C, and isEmpty().
|
inline |
Return true if the attribute exists for the return value.
Definition at line 820 of file Attributes.h.
References hasAttributeAtIndex(), and ReturnIndex.
Referenced by llvm::GetReturnInfo(), llvm::Function::hasRetAttribute(), isLibCallInTailPosition(), llvm::Function::returnDoesNotAlias(), and llvm::CallBase::returnDoesNotAlias().
Return true if the attribute exists for the return value.
Definition at line 825 of file Attributes.h.
References hasAttributeAtIndex(), and ReturnIndex.
|
inline |
Return true if attributes exist for the return value.
Definition at line 830 of file Attributes.h.
References hasAttributesAtIndex(), and ReturnIndex.
|
inline |
Use this to iterate over the valid attribute indexes.
Definition at line 982 of file Attributes.h.
References getNumAttrSets().
Referenced by print().
|
inline |
Return true if there are no attributes.
Definition at line 994 of file Attributes.h.
Referenced by llvm::ValueEnumerator::getAttributeListID(), llvm::dxil::ValueEnumerator::getAttributeListID(), hasParentContext(), and legalizeCallAttributes().
|
inline |
Definition at line 986 of file Attributes.h.
References RHS.
|
inline |
operator==/!= - Provide equality predicates.
Definition at line 985 of file Attributes.h.
References RHS.
void AttributeList::print | ( | raw_ostream & | O | ) | const |
Definition at line 1785 of file Attributes.cpp.
References FirstArgIndex, FunctionIndex, getAsString(), getAttributes(), indexes(), and ReturnIndex.
Referenced by dump().
|
inline |
Definition at line 642 of file Attributes.h.
References llvm::CallingConv::C, and removeAttributeAtIndex().
AttributeList AttributeList::removeAttributeAtIndex | ( | LLVMContext & | C, |
unsigned | Index, | ||
Attribute::AttrKind | Kind | ||
) | const |
Remove the specified attribute at the specified index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 1540 of file Attributes.cpp.
References llvm::CallingConv::C, and getAttributes().
Referenced by removeAttribute(), llvm::Function::removeAttributeAtIndex(), llvm::CallBase::removeAttributeAtIndex(), removeFnAttribute(), removeParamAttribute(), removeRetAttribute(), and replaceAttributeTypeAtIndex().
AttributeList AttributeList::removeAttributeAtIndex | ( | LLVMContext & | C, |
unsigned | Index, | ||
StringRef | Kind | ||
) | const |
Remove the specified attribute at the specified index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 1549 of file Attributes.cpp.
References llvm::CallingConv::C, and getAttributes().
AttributeList AttributeList::removeAttributesAtIndex | ( | LLVMContext & | C, |
unsigned | Index | ||
) | const |
Remove all attributes at the specified index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 1570 of file Attributes.cpp.
References AttributeSet, attrIdxToArrayIdx(), llvm::CallingConv::C, and getNumAttrSets().
AttributeList AttributeList::removeAttributesAtIndex | ( | LLVMContext & | C, |
unsigned | Index, | ||
const AttributeMask & | AttrsToRemove | ||
) | const |
Remove the specified attributes at the specified index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 1559 of file Attributes.cpp.
References llvm::CallingConv::C, and getAttributes().
Referenced by removeFnAttributes(), removeParamAttributes(), and removeRetAttributes().
|
inline |
Remove the specified attribute at the function index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 661 of file Attributes.h.
References llvm::CallingConv::C, FunctionIndex, and removeAttributeAtIndex().
Referenced by llvm::Function::removeFnAttr(), and llvm::CallBase::removeFnAttr().
|
inline |
Remove the specified attribute at the function index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 667 of file Attributes.h.
References llvm::CallingConv::C, FunctionIndex, and removeAttributeAtIndex().
|
inline |
Remove the attributes at the function index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 681 of file Attributes.h.
References llvm::CallingConv::C, FunctionIndex, and removeAttributesAtIndex().
|
inline |
Remove the specified attribute at the function index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 675 of file Attributes.h.
References llvm::CallingConv::C, FunctionIndex, and removeAttributesAtIndex().
Referenced by llvm::Function::removeFnAttrs(), and llvm::CallBase::removeFnAttrs().
|
inline |
Remove the specified attribute at the specified arg index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 710 of file Attributes.h.
References llvm::CallingConv::C, FirstArgIndex, and removeAttributeAtIndex().
Referenced by llvm::Function::removeParamAttr(), and llvm::CallBase::removeParamAttr().
|
inline |
Remove the specified attribute at the specified arg index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 718 of file Attributes.h.
References llvm::CallingConv::C, FirstArgIndex, and removeAttributeAtIndex().
|
inline |
Remove all attributes at the specified arg index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 732 of file Attributes.h.
References llvm::CallingConv::C, FirstArgIndex, and removeAttributesAtIndex().
|
inline |
Remove the specified attribute at the specified arg index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 725 of file Attributes.h.
References llvm::CallingConv::C, FirstArgIndex, and removeAttributesAtIndex().
Referenced by lowerAwaitSuspend(), llvm::Function::removeParamAttrs(), and llvm::CallBase::removeParamAttrs().
|
inline |
Remove the specified attribute at the return value index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 688 of file Attributes.h.
References llvm::CallingConv::C, removeAttributeAtIndex(), and ReturnIndex.
Referenced by llvm::Function::removeRetAttr(), and llvm::CallBase::removeRetAttr().
|
inline |
Remove the specified attribute at the return value index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 694 of file Attributes.h.
References llvm::CallingConv::C, removeAttributeAtIndex(), and ReturnIndex.
|
inline |
Remove the specified attribute at the return value index from this attribute list.
Returns a new list because attribute lists are immutable.
Definition at line 702 of file Attributes.h.
References llvm::CallingConv::C, removeAttributesAtIndex(), and ReturnIndex.
Referenced by llvm::Function::removeRetAttrs(), and llvm::CallBase::removeRetAttrs().
|
inline |
Replace the type contained by attribute AttrKind
at index ArgNo
wih ReplacementTy
, preserving all other attributes.
Definition at line 740 of file Attributes.h.
References llvm::CallingConv::C, getAttributeAtIndex(), llvm::Attribute::getWithNewType(), and removeAttributeAtIndex().
|
friend |
Definition at line 477 of file Attributes.h.
Referenced by get().
|
friend |
Definition at line 478 of file Attributes.h.
|
friend |
Definition at line 479 of file Attributes.h.
Referenced by removeAttributesAtIndex().
|
friend |
Definition at line 480 of file Attributes.h.
|
friend |
Definition at line 481 of file Attributes.h.