|
LLVM 23.0.0git
|
This class holds the attributes for a particular argument, parameter, function, or return value. More...
#include "llvm/IR/Attributes.h"
Public Types | |
| using | iterator = const Attribute * |
Static Public Member Functions | |
| static LLVM_ABI AttributeSet | get (LLVMContext &C, const AttrBuilder &B) |
| static LLVM_ABI AttributeSet | get (LLVMContext &C, ArrayRef< Attribute > Attrs) |
Friends | |
| template<typename Ty, typename Enable> | |
| struct | DenseMapInfo |
This class holds the attributes for a particular argument, parameter, function, or return value.
It is an immutable value type that is cheap to copy. Adding and removing enum attributes is intended to be fast, but adding and removing string or integer attributes involves a FoldingSet lookup.
Definition at line 407 of file Attributes.h.
| using llvm::AttributeSet::iterator = const Attribute * |
Definition at line 516 of file Attributes.h.
|
default |
AttributeSet is a trivially copyable value type.
|
default |
|
default |
References B(), llvm::CallingConv::C, and LLVM_ABI.
|
nodiscard |
Add an argument attribute.
Returns a new set because attribute sets are immutable.
Definition at line 963 of file Attributes.cpp.
References addAttributes(), B(), llvm::CallingConv::C, get(), and hasAttribute().
Referenced by llvm::OpenMPIRBuilder::addAttributes().
|
nodiscard |
Add a target-dependent attribute.
Returns a new set because attribute sets are immutable.
Definition at line 971 of file Attributes.cpp.
References addAttributes(), B(), llvm::CallingConv::C, and get().
|
nodiscard |
Add attributes to the attribute set.
Returns a new set because attribute sets are immutable.
Definition at line 978 of file Attributes.cpp.
References B(), llvm::CallingConv::C, get(), and hasAttributes().
Referenced by addAttribute(), addAttribute(), and llvm::OpenMPIRBuilder::addAttributes().
| AttributeSet AttributeSet::addAttributes | ( | LLVMContext & | C, |
| const AttrBuilder & | B ) const |
Add attributes to the attribute set.
Returns a new set because attribute sets are immutable.
Definition at line 991 of file Attributes.cpp.
References B(), llvm::CallingConv::C, get(), and hasAttributes().
| AttributeSet::iterator AttributeSet::begin | ( | ) | const |
Definition at line 1272 of file Attributes.cpp.
Referenced by intersectWith().
| LLVM_DUMP_METHOD void AttributeSet::dump | ( | ) | const |
Definition at line 1281 of file Attributes.cpp.
References llvm::dbgs(), getAsString(), and LLVM_DUMP_METHOD.
| AttributeSet::iterator AttributeSet::end | ( | ) | const |
Definition at line 1276 of file Attributes.cpp.
Referenced by intersectWith().
|
static |
Definition at line 959 of file Attributes.cpp.
References AttributeSet(), llvm::CallingConv::C, and llvm::AttributeSetNode::get().
|
static |
Definition at line 955 of file Attributes.cpp.
References AttributeSet(), B(), llvm::CallingConv::C, and llvm::AttributeSetNode::get().
Referenced by addAttribute(), addAttribute(), addAttributes(), addAttributes(), AddParamAndFnBasicAttributes(), intersectWith(), llvm::promoteCall(), removeAttribute(), removeAttribute(), and removeAttributes().
| MaybeAlign AttributeSet::getAlignment | ( | ) | const |
Definition at line 1181 of file Attributes.cpp.
| AllocFnKind AttributeSet::getAllocKind | ( | ) | const |
Definition at line 1244 of file Attributes.cpp.
References llvm::Unknown.
| std::optional< std::pair< unsigned, std::optional< unsigned > > > AttributeSet::getAllocSizeArgs | ( | ) | const |
Definition at line 1226 of file Attributes.cpp.
| std::string AttributeSet::getAsString | ( | bool | InAttrGrp = false | ) | const |
Definition at line 1260 of file Attributes.cpp.
Referenced by dump().
| Attribute AttributeSet::getAttribute | ( | Attribute::AttrKind | Kind | ) | const |
Return the attribute object.
Definition at line 1173 of file Attributes.cpp.
References llvm::Attribute.
Referenced by addIfNotExistent(), intersectWith(), and llvm::typeIncompatible().
Return the target-dependent attribute object.
Definition at line 1177 of file Attributes.cpp.
References llvm::Attribute.
| Type * AttributeSet::getByRefType | ( | ) | const |
Definition at line 1201 of file Attributes.cpp.
| Type * AttributeSet::getByValType | ( | ) | const |
Definition at line 1205 of file Attributes.cpp.
| CaptureInfo AttributeSet::getCaptureInfo | ( | ) | const |
Definition at line 1252 of file Attributes.cpp.
References llvm::CaptureInfo::all().
Referenced by llvm::CallBase::getCaptureInfo(), llvm::CallBase::hasArgumentWithAdditionalReturnCaptureComponents(), and llvm::isParamGridConstant().
| DeadOnReturnInfo AttributeSet::getDeadOnReturnInfo | ( | ) | const |
Definition at line 1193 of file Attributes.cpp.
| uint64_t AttributeSet::getDereferenceableBytes | ( | ) | const |
Definition at line 1189 of file Attributes.cpp.
| uint64_t AttributeSet::getDereferenceableOrNullBytes | ( | ) | const |
Definition at line 1197 of file Attributes.cpp.
| Type * AttributeSet::getElementType | ( | ) | const |
Definition at line 1221 of file Attributes.cpp.
| Type * AttributeSet::getInAllocaType | ( | ) | const |
Definition at line 1217 of file Attributes.cpp.
| MemoryEffects AttributeSet::getMemoryEffects | ( | ) | const |
Definition at line 1248 of file Attributes.cpp.
References llvm::MemoryEffectsBase< IRMemLocation >::unknown().
Referenced by addIfNotExistent(), and llvm::SITargetLowering::getTgtMemIntrinsic().
| FPClassTest AttributeSet::getNoFPClass | ( | ) | const |
Definition at line 1256 of file Attributes.cpp.
References llvm::fcNone.
| unsigned AttributeSet::getNumAttributes | ( | ) | const |
Return the number of attributes in this set.
Definition at line 1161 of file Attributes.cpp.
| Type * AttributeSet::getPreallocatedType | ( | ) | const |
Definition at line 1213 of file Attributes.cpp.
| MaybeAlign AttributeSet::getStackAlignment | ( | ) | const |
Definition at line 1185 of file Attributes.cpp.
| Type * AttributeSet::getStructRetType | ( | ) | const |
Definition at line 1209 of file Attributes.cpp.
| UWTableKind AttributeSet::getUWTableKind | ( | ) | const |
Definition at line 1240 of file Attributes.cpp.
References llvm::None.
| std::optional< unsigned > AttributeSet::getVScaleRangeMax | ( | ) | const |
Definition at line 1236 of file Attributes.cpp.
| unsigned AttributeSet::getVScaleRangeMin | ( | ) | const |
Definition at line 1232 of file Attributes.cpp.
| bool AttributeSet::hasAttribute | ( | Attribute::AttrKind | Kind | ) | const |
Return true if the attribute exists in this set.
Definition at line 1165 of file Attributes.cpp.
Referenced by addAttribute(), addIfNotExistent(), llvm::GlobalVariable::hasImplicitSection(), maySpeculateLanes(), printFunctionArgExts(), removeAttribute(), and removeAttribute().
Return true if the attribute exists in this set.
Definition at line 1169 of file Attributes.cpp.
|
inline |
Return true if attributes exists in this set.
Definition at line 477 of file Attributes.h.
Referenced by addAttributes(), addAttributes(), and hasParentContext().
| bool AttributeSet::hasParentContext | ( | LLVMContext & | C | ) | const |
Return true if this attribute set belongs to the LLVMContext.
Definition at line 1264 of file Attributes.cpp.
References assert(), llvm::CallingConv::C, and hasAttributes().
|
nodiscard |
Try to intersect this AttributeSet with Other.
Returns std::nullopt if the two lists are inherently incompatible (imply different behavior, not just analysis).
Definition at line 1032 of file Attributes.cpp.
References assert(), begin(), llvm::CallingConv::C, end(), get(), llvm::Attribute::getAlignment(), getAttribute(), llvm::Attribute::getCaptureInfo(), llvm::Attribute::getKindAsEnum(), llvm::Attribute::getMemoryEffects(), llvm::Attribute::getNoFPClass(), llvm::Attribute::getRange(), llvm::Attribute::getValueAsInt(), llvm::Attribute::hasKindAsEnum(), llvm::Attribute::intersectMustPreserve(), llvm::Attribute::intersectWithAnd(), llvm::Attribute::intersectWithCustom(), llvm::Attribute::intersectWithMin(), llvm::Attribute::isEnumAttrKind(), llvm::ConstantRange::isFullSet(), llvm::Attribute::isIntAttrKind(), llvm::Attribute::isValid(), llvm_unreachable, llvm::Other, llvm::ConstantRange::unionWith(), and llvm::MaybeAlign::valueOrOne().
|
inline |
Definition at line 431 of file Attributes.h.
|
inline |
Definition at line 430 of file Attributes.h.
|
nodiscard |
Remove the specified attribute from this set.
Returns a new set because attribute sets are immutable.
Definition at line 1004 of file Attributes.cpp.
References B(), llvm::CallingConv::C, get(), and hasAttribute().
|
nodiscard |
Remove the specified attribute from this set.
Returns a new set because attribute sets are immutable.
Definition at line 1012 of file Attributes.cpp.
References B(), llvm::CallingConv::C, get(), and hasAttribute().
|
nodiscard |
Remove the specified attributes from this set.
Returns a new set because attribute sets are immutable.
Definition at line 1020 of file Attributes.cpp.
References B(), llvm::CallingConv::C, and get().
Referenced by moveFunctionAdaptingType().
|
friend |