LLVM
15.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 | |
LLVM_NODISCARD AttributeList | addAttributeAtIndex (LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const |
Add an attribute to the attribute set at the given index. More... | |
LLVM_NODISCARD AttributeList | addAttributeAtIndex (LLVMContext &C, unsigned Index, StringRef Kind, StringRef Value=StringRef()) const |
Add an attribute to the attribute set at the given index. More... | |
LLVM_NODISCARD AttributeList | addAttributeAtIndex (LLVMContext &C, unsigned Index, Attribute A) const |
Add an attribute to the attribute set at the given index. More... | |
LLVM_NODISCARD AttributeList | addAttributesAtIndex (LLVMContext &C, unsigned Index, const AttrBuilder &B) const |
Add attributes to the attribute set at the given index. More... | |
LLVM_NODISCARD AttributeList | addFnAttribute (LLVMContext &C, Attribute::AttrKind Kind) const |
Add a function attribute to the list. More... | |
LLVM_NODISCARD AttributeList | addFnAttribute (LLVMContext &C, Attribute Attr) const |
Add a function attribute to the list. More... | |
LLVM_NODISCARD AttributeList | addFnAttribute (LLVMContext &C, StringRef Kind, StringRef Value=StringRef()) const |
Add a function attribute to the list. More... | |
LLVM_NODISCARD AttributeList | addFnAttributes (LLVMContext &C, const AttrBuilder &B) const |
Add function attribute to the list. More... | |
LLVM_NODISCARD AttributeList | addRetAttribute (LLVMContext &C, Attribute::AttrKind Kind) const |
Add a return value attribute to the list. More... | |
LLVM_NODISCARD AttributeList | addRetAttribute (LLVMContext &C, Attribute Attr) const |
Add a return value attribute to the list. More... | |
LLVM_NODISCARD AttributeList | addRetAttributes (LLVMContext &C, const AttrBuilder &B) const |
Add a return value attribute to the list. More... | |
LLVM_NODISCARD AttributeList | addParamAttribute (LLVMContext &C, unsigned ArgNo, Attribute::AttrKind Kind) const |
Add an argument attribute to the list. More... | |
LLVM_NODISCARD AttributeList | addParamAttribute (LLVMContext &C, unsigned ArgNo, StringRef Kind, StringRef Value=StringRef()) const |
Add an argument attribute to the list. More... | |
LLVM_NODISCARD AttributeList | addParamAttribute (LLVMContext &C, ArrayRef< unsigned > ArgNos, Attribute A) const |
Add an attribute to the attribute list at the given arg indices. More... | |
LLVM_NODISCARD AttributeList | addParamAttributes (LLVMContext &C, unsigned ArgNo, const AttrBuilder &B) const |
Add an argument attribute to the list. More... | |
LLVM_NODISCARD AttributeList | removeAttributeAtIndex (LLVMContext &C, unsigned Index, Attribute::AttrKind Kind) const |
Remove the specified attribute at the specified index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeAttributeAtIndex (LLVMContext &C, unsigned Index, StringRef Kind) const |
Remove the specified attribute at the specified index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeAttribute (LLVMContext &C, unsigned Index, StringRef Kind) const |
LLVM_NODISCARD AttributeList | removeAttributesAtIndex (LLVMContext &C, unsigned Index, const AttributeMask &AttrsToRemove) const |
Remove the specified attributes at the specified index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeAttributesAtIndex (LLVMContext &C, unsigned Index) const |
Remove all attributes at the specified index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeFnAttribute (LLVMContext &C, Attribute::AttrKind Kind) const |
Remove the specified attribute at the function index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeFnAttribute (LLVMContext &C, StringRef Kind) const |
Remove the specified attribute at the function index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeFnAttributes (LLVMContext &C, const AttributeMask &AttrsToRemove) const |
Remove the specified attribute at the function index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeFnAttributes (LLVMContext &C) const |
Remove the attributes at the function index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeRetAttribute (LLVMContext &C, Attribute::AttrKind Kind) const |
Remove the specified attribute at the return value index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeRetAttribute (LLVMContext &C, StringRef Kind) const |
Remove the specified attribute at the return value index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeRetAttributes (LLVMContext &C, const AttributeMask &AttrsToRemove) const |
Remove the specified attribute at the return value index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeParamAttribute (LLVMContext &C, unsigned ArgNo, Attribute::AttrKind Kind) const |
Remove the specified attribute at the specified arg index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeParamAttribute (LLVMContext &C, unsigned ArgNo, StringRef Kind) const |
Remove the specified attribute at the specified arg index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeParamAttributes (LLVMContext &C, unsigned ArgNo, const AttributeMask &AttrsToRemove) const |
Remove the specified attribute at the specified arg index from this attribute list. More... | |
LLVM_NODISCARD AttributeList | removeParamAttributes (LLVMContext &C, unsigned ArgNo) const |
Remove all attributes at the specified arg index from this attribute list. More... | |
LLVM_NODISCARD 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. More... | |
LLVM_NODISCARD AttributeList | addDereferenceableRetAttr (LLVMContext &C, uint64_t Bytes) const |
Add the dereferenceable attribute to the attribute set at the given index. More... | |
LLVM_NODISCARD AttributeList | addDereferenceableParamAttr (LLVMContext &C, unsigned ArgNo, uint64_t Bytes) const |
Add the dereferenceable attribute to the attribute set at the given arg index. More... | |
LLVM_NODISCARD 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. More... | |
LLVM_NODISCARD AttributeList | addAllocSizeParamAttr (LLVMContext &C, unsigned ArgNo, unsigned ElemSizeArg, const Optional< unsigned > &NumElemsArg) |
Add the allocsize attribute to the attribute set at the given arg index. More... | |
AttributeSet | getAttributes (unsigned Index) const |
The attributes for the specified index are returned. More... | |
AttributeSet | getParamAttrs (unsigned ArgNo) const |
The attributes for the argument or parameter at the given index are returned. More... | |
AttributeSet | getRetAttrs () const |
The attributes for the ret value are returned. More... | |
AttributeSet | getFnAttrs () const |
The function attributes are returned. More... | |
bool | hasAttributeAtIndex (unsigned Index, Attribute::AttrKind Kind) const |
Return true if the attribute exists at the given index. More... | |
bool | hasAttributeAtIndex (unsigned Index, StringRef Kind) const |
Return true if the attribute exists at the given index. More... | |
bool | hasAttributesAtIndex (unsigned Index) const |
Return true if attribute exists at the given index. More... | |
bool | hasParamAttr (unsigned ArgNo, Attribute::AttrKind Kind) const |
Return true if the attribute exists for the given argument. More... | |
bool | hasParamAttr (unsigned ArgNo, StringRef Kind) const |
Return true if the attribute exists for the given argument. More... | |
bool | hasParamAttrs (unsigned ArgNo) const |
Return true if attributes exists for the given argument. More... | |
bool | hasRetAttr (Attribute::AttrKind Kind) const |
Return true if the attribute exists for the return value. More... | |
bool | hasRetAttr (StringRef Kind) const |
Return true if the attribute exists for the return value. More... | |
bool | hasRetAttrs () const |
Return true if attributes exist for the return value. More... | |
bool | hasFnAttr (Attribute::AttrKind Kind) const |
Return true if the attribute exists for the function. More... | |
bool | hasFnAttr (StringRef Kind) const |
Return true if the attribute exists for the function. More... | |
bool | hasFnAttrs () const |
Return true the attributes exist for the function. More... | |
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. More... | |
Attribute | getAttributeAtIndex (unsigned Index, Attribute::AttrKind Kind) const |
Return the attribute object that exists at the given index. More... | |
Attribute | getAttributeAtIndex (unsigned Index, StringRef Kind) const |
Return the attribute object that exists at the given index. More... | |
Attribute | getParamAttr (unsigned ArgNo, Attribute::AttrKind Kind) const |
Return the attribute object that exists at the arg index. More... | |
Attribute | getParamAttr (unsigned ArgNo, StringRef Kind) const |
Return the attribute object that exists at the given index. More... | |
Attribute | getFnAttr (Attribute::AttrKind Kind) const |
Return the attribute object that exists for the function. More... | |
Attribute | getFnAttr (StringRef Kind) const |
Return the attribute object that exists for the function. More... | |
MaybeAlign | getRetAlignment () const |
Return the alignment of the return value. More... | |
MaybeAlign | getParamAlignment (unsigned ArgNo) const |
Return the alignment for the specified function parameter. More... | |
MaybeAlign | getParamStackAlignment (unsigned ArgNo) const |
Return the stack alignment for the specified function parameter. More... | |
Type * | getParamByValType (unsigned ArgNo) const |
Return the byval type for the specified function parameter. More... | |
Type * | getParamStructRetType (unsigned ArgNo) const |
Return the sret type for the specified function parameter. More... | |
Type * | getParamByRefType (unsigned ArgNo) const |
Return the byref type for the specified function parameter. More... | |
Type * | getParamPreallocatedType (unsigned ArgNo) const |
Return the preallocated type for the specified function parameter. More... | |
Type * | getParamInAllocaType (unsigned ArgNo) const |
Return the inalloca type for the specified function parameter. More... | |
Type * | getParamElementType (unsigned ArgNo) const |
Return the elementtype type for the specified function parameter. More... | |
MaybeAlign | getFnStackAlignment () const |
Get the stack alignment of the function. More... | |
MaybeAlign | getRetStackAlignment () const |
Get the stack alignment of the return value. More... | |
uint64_t | getRetDereferenceableBytes () const |
Get the number of dereferenceable bytes (or zero if unknown) of the return value. More... | |
uint64_t | getParamDereferenceableBytes (unsigned Index) const |
Get the number of dereferenceable bytes (or zero if unknown) of an arg. More... | |
uint64_t | getRetDereferenceableOrNullBytes () const |
Get the number of dereferenceable_or_null bytes (or zero if unknown) of the return value. More... | |
uint64_t | getParamDereferenceableOrNullBytes (unsigned ArgNo) const |
Get the number of dereferenceable_or_null bytes (or zero if unknown) of an arg. More... | |
UWTableKind | getUWTableKind () const |
Get the unwind table kind requested for the function. More... | |
std::string | getAsString (unsigned Index, bool InAttrGrp=false) const |
Return the attributes at the index as a string. More... | |
bool | hasParentContext (LLVMContext &C) const |
Return true if this attribute list belongs to the LLVMContext. More... | |
iterator | begin () const |
iterator | end () const |
unsigned | getNumAttrSets () const |
index_iterator | indexes () const |
Use this to iterate over the valid attribute indexes. More... | |
bool | operator== (const AttributeList &RHS) const |
operator==/!= - Provide equality predicates. More... | |
bool | operator!= (const AttributeList &RHS) const |
void * | getRawPointer () const |
Return a raw pointer that uniquely identifies this attribute list. More... | |
bool | isEmpty () const |
Return true if there are no attributes. More... | |
void | print (raw_ostream &O) const |
void | dump () const |
Static Public Member Functions | |
static AttributeList | get (LLVMContext &C, ArrayRef< std::pair< unsigned, Attribute >> Attrs) |
Create an AttributeList with the specified parameters in it. More... | |
static AttributeList | get (LLVMContext &C, ArrayRef< std::pair< unsigned, AttributeSet >> Attrs) |
static AttributeList | get (LLVMContext &C, AttributeSet FnAttrs, AttributeSet RetAttrs, ArrayRef< AttributeSet > ArgAttrs) |
Create an AttributeList from attribute sets for a function, its return value, and all of its arguments. More... | |
static AttributeList | get (LLVMContext &C, ArrayRef< AttributeList > Attrs) |
Return an AttributeList with the specified parameters in it. More... | |
static AttributeList | get (LLVMContext &C, unsigned Index, ArrayRef< Attribute::AttrKind > Kinds) |
static AttributeList | get (LLVMContext &C, unsigned Index, ArrayRef< Attribute::AttrKind > Kinds, ArrayRef< uint64_t > Values) |
static AttributeList | get (LLVMContext &C, unsigned Index, ArrayRef< StringRef > Kind) |
static AttributeList | get (LLVMContext &C, unsigned Index, AttributeSet Attrs) |
static AttributeList | get (LLVMContext &C, unsigned Index, const AttrBuilder &B) |
Friends | |
class | AttrBuilder |
class | AttributeListImpl |
class | AttributeSet |
class | AttributeSetNode |
template<typename Ty , typename Enable > | |
struct | DenseMapInfo |
Definition at line 408 of file Attributes.h.
using llvm::AttributeList::iterator = const AttributeSet * |
Definition at line 863 of file Attributes.h.
enum llvm::AttributeList::AttrIndex : unsigned |
Enumerator | |
---|---|
ReturnIndex | |
FunctionIndex | |
FirstArgIndex |
Definition at line 410 of file Attributes.h.
|
default |
AttributeList AttributeList::addAllocSizeParamAttr | ( | LLVMContext & | C, |
unsigned | ArgNo, | ||
unsigned | ElemSizeArg, | ||
const 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 1341 of file Attributes.cpp.
References addParamAttributes(), B, and Index.
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 1212 of file Attributes.cpp.
References A, addAttributesAtIndex(), B, and Index.
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 1193 of file Attributes.cpp.
References Attrs, llvm::Function::begin(), llvm::Function::end(), llvm::Attribute::get(), llvm::AttributeSet::get(), getAttributes(), hasAttributeAtIndex(), and Index.
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 1204 of file Attributes.cpp.
References addAttributesAtIndex(), B, and Index.
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 1230 of file Attributes.cpp.
References B, llvm::AttributeSet::get(), get(), getAttributes(), and Index.
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 1333 of file Attributes.cpp.
References addParamAttributes(), B, and Index.
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 1324 of file Attributes.cpp.
References addParamAttributes(), B, and Index.
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 1317 of file Attributes.cpp.
References addRetAttributes(), and B.
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 502 of file Attributes.h.
References addAttributeAtIndex(), and FunctionIndex.
|
inline |
Add a function attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 495 of file Attributes.h.
References addAttributeAtIndex(), and FunctionIndex.
Referenced by llvm::Function::addFnAttr(), llvm::CallBase::addFnAttr(), and llvm::AMDGPULibFunc::getOrInsertFunction().
|
inline |
Add a function attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 509 of file Attributes.h.
References addAttributeAtIndex(), and FunctionIndex.
|
inline |
Add function attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 516 of file Attributes.h.
References addAttributesAtIndex(), B, and FunctionIndex.
Referenced by llvm::Function::addFnAttrs(), 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 1244 of file Attributes.cpp.
References A, assert(), attrIdxToArrayIdx(), B, llvm::ArrayRef< T >::back(), begin(), end(), FirstArgIndex, llvm::AttributeSet::get(), getImpl(), Index, llvm::is_sorted(), and llvm::SmallVectorImpl< T >::resize().
|
inline |
Add an argument attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 544 of file Attributes.h.
References addAttributeAtIndex(), 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 552 of file Attributes.h.
References addAttributeAtIndex(), and FirstArgIndex.
|
inline |
Add an argument attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 565 of file Attributes.h.
References addAttributesAtIndex(), B, and FirstArgIndex.
Referenced by addAllocSizeParamAttr(), addDereferenceableOrNullParamAttr(), addDereferenceableParamAttr(), and llvm::Function::addParamAttrs().
|
inline |
Add a return value attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 530 of file Attributes.h.
References addAttributeAtIndex(), and ReturnIndex.
|
inline |
Add a return value attribute to the list.
Returns a new list because attribute lists are immutable.
Definition at line 523 of file Attributes.h.
References addAttributeAtIndex(), 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 537 of file Attributes.h.
References addAttributesAtIndex(), B, and ReturnIndex.
Referenced by addDereferenceableRetAttr(), and llvm::Function::addRetAttrs().
AttributeList::iterator AttributeList::begin | ( | ) | const |
Definition at line 1485 of file Attributes.cpp.
Referenced by addParamAttribute(), removeAttributeAtIndex(), and removeAttributesAtIndex().
LLVM_DUMP_METHOD void AttributeList::dump | ( | ) | const |
Definition at line 1525 of file Attributes.cpp.
References llvm::dbgs(), and print().
AttributeList::iterator AttributeList::end | ( | ) | const |
Definition at line 1489 of file Attributes.cpp.
Referenced by addParamAttribute(), removeAttributeAtIndex(), and removeAttributesAtIndex().
|
static |
Return an AttributeList with the specified parameters in it.
Definition at line 1166 of file Attributes.cpp.
References AttrBuilder, Attrs, llvm::Function::empty(), llvm::AttributeSet::get(), getImpl(), I, List, llvm::max(), llvm::AttrBuilder::merge(), and llvm::Function::size().
|
static |
Create an AttributeList with the specified parameters in it.
Definition at line 1015 of file Attributes.cpp.
References llvm::all_of(), assert(), Attrs, llvm::Function::begin(), E, llvm::SmallVectorImpl< T >::emplace_back(), llvm::Function::empty(), llvm::Function::end(), llvm::AttributeSet::get(), I, Index, llvm::is_sorted(), LHS, and RHS.
Referenced by addAttributesAtIndex(), llvm::CloneFunctionInto(), doPromotion(), llvm::emitMemCpyChk(), get(), llvm::GlobalVariable::getAttributesAsList(), getReturnAttrs(), llvm::InlineFunction(), makeStatepointExplicitImpl(), and llvm::promoteCall().
|
static |
Definition at line 1052 of file Attributes.cpp.
References assert(), attrIdxToArrayIdx(), Attrs, llvm::Function::back(), llvm::Function::empty(), FunctionIndex, getImpl(), llvm::is_sorted(), LHS, llvm::none_of(), RHS, and llvm::Function::size().
|
static |
Create an AttributeList from attribute sets for a function, its return value, and all of its arguments.
Definition at line 1083 of file Attributes.cpp.
References llvm::append_range(), getImpl(), llvm::AttributeSet::hasAttributes(), I, llvm::SmallVectorImpl< T >::reserve(), llvm::ArrayRef< T >::size(), and llvm::ArrayRef< T >::take_front().
|
static |
Definition at line 1139 of file Attributes.cpp.
References Attrs, llvm::Attribute::get(), get(), and Index.
|
static |
Definition at line 1147 of file Attributes.cpp.
References assert(), Attrs, llvm::ArrayRef< T >::begin(), llvm::Attribute::get(), get(), Index, llvm::ArrayRef< T >::size(), and VI.
|
static |
Definition at line 1158 of file Attributes.cpp.
References Attrs, llvm::Attribute::get(), get(), and Index.
|
static |
Definition at line 1124 of file Attributes.cpp.
References attrIdxToArrayIdx(), Attrs, getImpl(), and Index.
|
static |
Definition at line 1134 of file Attributes.cpp.
References B, llvm::AttributeSet::get(), get(), and Index.
std::string AttributeList::getAsString | ( | unsigned | Index, |
bool | InAttrGrp = false |
||
) | const |
Return the attributes at the index as a string.
Definition at line 1466 of file Attributes.cpp.
References llvm::AttributeSet::getAsString(), getAttributes(), and Index.
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 1391 of file Attributes.cpp.
References llvm::AttributeSet::getAttribute(), getAttributes(), and Index.
Referenced by llvm::Function::getAttributeAtIndex(), llvm::CallBase::getAttributeAtIndex(), getFnAttr(), getParamAttr(), and replaceAttributeTypeAtIndex().
Return the attribute object that exists at the given index.
Definition at line 1396 of file Attributes.cpp.
References llvm::AttributeSet::getAttribute(), getAttributes(), and Index.
AttributeSet AttributeList::getAttributes | ( | unsigned | Index | ) | const |
The attributes for the specified index are returned.
Definition at line 1470 of file Attributes.cpp.
References attrIdxToArrayIdx(), getNumAttrSets(), and Index.
Referenced by addAttributeAtIndex(), addAttributesAtIndex(), getAsString(), getAttributeAtIndex(), getFnAttrs(), getParamAlignment(), getParamAttrs(), getParamByRefType(), getParamByValType(), getParamElementType(), getParamInAllocaType(), getParamPreallocatedType(), getParamStackAlignment(), getParamStructRetType(), getRetAlignment(), getRetAttrs(), hasAttributeAtIndex(), hasAttributesAtIndex(), llvm::CombinerHelper::matchUDivByConst(), print(), removeAttributesAtIndex(), and llvm::IRPosition::removeAttrs().
|
inline |
Return the attribute object that exists for the function.
Definition at line 793 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 798 of file Attributes.h.
References FunctionIndex, and getAttributeAtIndex().
AttributeSet AttributeList::getFnAttrs | ( | ) | const |
The function attributes are returned.
Definition at line 1361 of file Attributes.cpp.
References FunctionIndex, and getAttributes().
Referenced by llvm::CloneFunctionInto(), doPromotion(), fillOverallFunction(), getFnStackAlignment(), getUWTableKind(), legalizeCallAttributes(), and llvm::promoteCall().
MaybeAlign AttributeList::getFnStackAlignment | ( | ) | const |
Get the stack alignment of the function.
Definition at line 1437 of file Attributes.cpp.
References getFnAttrs(), and llvm::AttributeSet::getStackAlignment().
Referenced by llvm::Function::getFnStackAlign().
unsigned AttributeList::getNumAttrSets | ( | ) | const |
Definition at line 1497 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 1405 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 783 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 788 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 1353 of file Attributes.cpp.
References FirstArgIndex, and getAttributes().
Referenced by llvm::CloneFunctionInto(), doPromotion(), getParamDereferenceableBytes(), getParamDereferenceableOrNullBytes(), llvm::Argument::getPassPointeeByValueCopySize(), llvm::Argument::getPointeeInMemoryValueType(), llvm::InlineFunction(), and llvm::promoteCall().
Type * AttributeList::getParamByRefType | ( | unsigned | ArgNo | ) | const |
Return the byref type for the specified function parameter.
Definition at line 1421 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), llvm::AttributeSet::getByRefType(), and Index.
Referenced by llvm::Function::getParamByRefType().
Type * AttributeList::getParamByValType | ( | unsigned | ArgNo | ) | const |
Return the byval type for the specified function parameter.
Definition at line 1413 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), llvm::AttributeSet::getByValType(), and Index.
Referenced by llvm::Function::getParamByValType(), and llvm::CallBase::getParamByValType().
uint64_t AttributeList::getParamDereferenceableBytes | ( | unsigned | Index | ) | const |
Get the number of dereferenceable bytes (or zero if unknown) of an arg.
Definition at line 1449 of file Attributes.cpp.
References llvm::AttributeSet::getDereferenceableBytes(), getParamAttrs(), and Index.
Referenced by llvm::Function::getParamDereferenceableBytes(), and llvm::CallBase::getParamDereferenceableBytes().
uint64_t AttributeList::getParamDereferenceableOrNullBytes | ( | unsigned | ArgNo | ) | const |
Get the number of dereferenceable_or_null bytes (or zero if unknown) of an arg.
Definition at line 1458 of file Attributes.cpp.
References llvm::AttributeSet::getDereferenceableOrNullBytes(), getParamAttrs(), and Index.
Referenced by llvm::Function::getParamDereferenceableOrNullBytes(), and llvm::CallBase::getParamDereferenceableOrNullBytes().
Type * AttributeList::getParamElementType | ( | unsigned | ArgNo | ) | const |
Return the elementtype type for the specified function parameter.
Definition at line 1433 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), llvm::AttributeSet::getElementType(), and Index.
Referenced by llvm::CallBase::getParamElementType().
Type * AttributeList::getParamInAllocaType | ( | unsigned | ArgNo | ) | const |
Return the inalloca type for the specified function parameter.
Definition at line 1429 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), llvm::AttributeSet::getInAllocaType(), and Index.
Referenced by llvm::Function::getParamInAllocaType(), and llvm::CallBase::getParamInAllocaType().
Type * AttributeList::getParamPreallocatedType | ( | unsigned | ArgNo | ) | const |
Return the preallocated type for the specified function parameter.
Definition at line 1425 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), llvm::AttributeSet::getPreallocatedType(), and Index.
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 1409 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), and llvm::AttributeSet::getStackAlignment().
Referenced by llvm::Function::getParamStackAlign(), and llvm::CallBase::getParamStackAlign().
Type * AttributeList::getParamStructRetType | ( | unsigned | ArgNo | ) | const |
Return the sret type for the specified function parameter.
Definition at line 1417 of file Attributes.cpp.
References FirstArgIndex, getAttributes(), llvm::AttributeSet::getStructRetType(), and Index.
Referenced by llvm::Function::getParamStructRetType(), and llvm::CallBase::getParamStructRetType().
|
inline |
Return a raw pointer that uniquely identifies this attribute list.
Definition at line 902 of file Attributes.h.
MaybeAlign AttributeList::getRetAlignment | ( | ) | const |
Return the alignment of the return value.
Definition at line 1401 of file Attributes.cpp.
References llvm::AttributeSet::getAlignment(), getAttributes(), and ReturnIndex.
Referenced by llvm::CallBase::getRetAlign().
AttributeSet AttributeList::getRetAttrs | ( | ) | const |
The attributes for the ret value are returned.
Definition at line 1357 of file Attributes.cpp.
References getAttributes(), and ReturnIndex.
Referenced by llvm::CloneFunctionInto(), doPromotion(), getRetDereferenceableBytes(), getRetDereferenceableOrNullBytes(), getRetStackAlignment(), IdentifyValidAttributes(), isLibCallInTailPosition(), llvm::PPCInstrInfo::isSignOrZeroExtended(), and llvm::promoteCall().
uint64_t AttributeList::getRetDereferenceableBytes | ( | ) | const |
Get the number of dereferenceable bytes (or zero if unknown) of the return value.
Definition at line 1445 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 1453 of file Attributes.cpp.
References llvm::AttributeSet::getDereferenceableOrNullBytes(), and getRetAttrs().
Referenced by llvm::CallBase::getRetDereferenceableOrNullBytes().
MaybeAlign AttributeList::getRetStackAlignment | ( | ) | const |
Get the stack alignment of the return value.
Definition at line 1441 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 1462 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 1365 of file Attributes.cpp.
References getAttributes(), llvm::AttributeSet::hasAttribute(), and Index.
Referenced by addAttributeAtIndex(), hasFnAttr(), hasParamAttr(), hasRetAttr(), and removeAttributeAtIndex().
bool AttributeList::hasAttributeAtIndex | ( | unsigned | Index, |
StringRef | Kind | ||
) | const |
Return true if the attribute exists at the given index.
Definition at line 1370 of file Attributes.cpp.
References getAttributes(), llvm::AttributeSet::hasAttribute(), and Index.
bool AttributeList::hasAttributesAtIndex | ( | unsigned | Index | ) | const |
Return true if attribute exists at the given index.
Definition at line 1374 of file Attributes.cpp.
References getAttributes(), llvm::AttributeSet::hasAttributes(), and Index.
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 1386 of file Attributes.cpp.
References Index.
Referenced by llvm::XCoreFrameLowering::emitPrologue(), llvm::CallBase::getArgOperandWithAttribute(), llvm::AArch64RegisterInfo::getCalleeSavedRegs(), llvm::SystemZELFRegisters::getCalleeSavedRegs(), llvm::AArch64RegisterInfo::getCallPreservedMask(), llvm::ARMBaseRegisterInfo::getCallPreservedMask(), llvm::SystemZELFRegisters::getCallPreservedMask(), llvm::AArch64RegisterInfo::getDarwinCalleeSavedRegs(), llvm::AArch64RegisterInfo::getDarwinCallPreservedMask(), 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 1378 of file Attributes.cpp.
Referenced by getDeoptLowering(), llvm::AArch64TargetLowering::getOptimalMemOpLLT(), llvm::ARMTargetLowering::getOptimalMemOpType(), llvm::AArch64TargetLowering::getOptimalMemOpType(), llvm::X86TargetLowering::getOptimalMemOpType(), llvm::SITargetLowering::getTgtMemIntrinsic(), llvm::Function::hasFnAttribute(), llvm::InlineFunction(), llvm::AArch64TargetLowering::isIntDivCheap(), llvm::X86TargetLowering::isIntDivCheap(), llvm::TLSVariableHoistPass::runImpl(), and llvm::TargetLowering::SimplifySetCC().
bool AttributeList::hasFnAttr | ( | StringRef | Kind | ) | const |
Return true if the attribute exists for the function.
Definition at line 1382 of file Attributes.cpp.
References FunctionIndex, and hasAttributeAtIndex().
|
inline |
Return true the attributes exist for the function.
Definition at line 768 of file Attributes.h.
References FunctionIndex, and hasAttributesAtIndex().
|
inline |
Return true if the attribute exists for the given argument.
Definition at line 734 of file Attributes.h.
References FirstArgIndex, and hasAttributeAtIndex().
Referenced by llvm::Function::hasParamAttribute(), llvm::Function::hasStructRetAttr(), llvm::isLegalToPromote(), llvm::NVPTXTargetLowering::LowerFormalArguments(), and llvm::CallBase::paramHasAttr().
|
inline |
Return true if the attribute exists for the given argument.
Definition at line 739 of file Attributes.h.
References FirstArgIndex, and hasAttributeAtIndex().
|
inline |
Return true if attributes exists for the given argument.
Definition at line 744 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 1477 of file Attributes.cpp.
|
inline |
Return true if the attribute exists for the return value.
Definition at line 749 of file Attributes.h.
References hasAttributeAtIndex(), and ReturnIndex.
Referenced by llvm::GetReturnInfo(), llvm::Function::hasRetAttribute(), isLibCallInTailPosition(), llvm::Function::returnDoesNotAlias(), and llvm::CallBase::returnDoesNotAlias().
|
inline |
Return true if the attribute exists for the return value.
Definition at line 754 of file Attributes.h.
References hasAttributeAtIndex(), and ReturnIndex.
|
inline |
Return true if attributes exist for the return value.
Definition at line 759 of file Attributes.h.
References hasAttributesAtIndex(), and ReturnIndex.
|
inline |
Use this to iterate over the valid attribute indexes.
Definition at line 895 of file Attributes.h.
References getNumAttrSets().
Referenced by print().
|
inline |
Return true if there are no attributes.
Definition at line 907 of file Attributes.h.
Referenced by llvm::ValueEnumerator::getAttributeListID(), llvm::dxil::ValueEnumerator::getAttributeListID(), hasParentContext(), and legalizeCallAttributes().
|
inline |
Definition at line 899 of file Attributes.h.
References RHS.
|
inline |
operator==/!= - Provide equality predicates.
Definition at line 898 of file Attributes.h.
References RHS.
void AttributeList::print | ( | raw_ostream & | O | ) | const |
Definition at line 1501 of file Attributes.cpp.
References getAsString(), getAttributes(), i, indexes(), and llvm::RISCVFenceField::O.
Referenced by dump().
|
inline |
Definition at line 581 of file Attributes.h.
References Index, 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 1265 of file Attributes.cpp.
References assert(), attrIdxToArrayIdx(), begin(), end(), getImpl(), hasAttributeAtIndex(), and Index.
Referenced by removeAttribute(), llvm::Function::removeAttributeAtIndex(), llvm::CallBase::removeAttributeAtIndex(), llvm::IRPosition::removeAttrs(), 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 1279 of file Attributes.cpp.
References assert(), attrIdxToArrayIdx(), begin(), end(), getImpl(), hasAttributeAtIndex(), and Index.
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 1305 of file Attributes.cpp.
References AttributeSet, attrIdxToArrayIdx(), begin(), end(), getImpl(), 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 1294 of file Attributes.cpp.
References Attrs, getAttributes(), and Index.
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 599 of file Attributes.h.
References 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 605 of file Attributes.h.
References 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 619 of file Attributes.h.
References 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 613 of file Attributes.h.
References 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 646 of file Attributes.h.
References 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 653 of file Attributes.h.
References 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 669 of file Attributes.h.
References 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 662 of file Attributes.h.
References FirstArgIndex, and removeAttributesAtIndex().
Referenced by 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 626 of file Attributes.h.
References 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 632 of file Attributes.h.
References 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 639 of file Attributes.h.
References 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 676 of file Attributes.h.
References Attrs, getAttributeAtIndex(), llvm::Attribute::getWithNewType(), and removeAttributeAtIndex().
|
friend |
Definition at line 417 of file Attributes.h.
Referenced by get().
|
friend |
Definition at line 418 of file Attributes.h.
|
friend |
Definition at line 419 of file Attributes.h.
Referenced by removeAttributesAtIndex().
|
friend |
Definition at line 420 of file Attributes.h.
|
friend |
Definition at line 421 of file Attributes.h.