|
LLVM 24.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 448 of file Attributes.h.
| using llvm::AttributeSet::iterator = const Attribute * |
Definition at line 570 of file Attributes.h.
|
default |
AttributeSet is a trivially copyable value type.
Referenced by addSortedAttributes(), get(), and get().
|
default |
|
nodiscard |
Add an argument attribute.
Returns a new set because attribute sets are immutable.
Definition at line 977 of file Attributes.cpp.
References addAttributes(), B(), C(), get(), and hasAttribute().
Referenced by llvm::OpenMPIRBuilder::addAttributes(), and llvm::RTLIB::RuntimeLibcallsInfo::getDefaultFunctionTy().
|
nodiscard |
Add a target-dependent attribute.
Returns a new set because attribute sets are immutable.
Definition at line 985 of file Attributes.cpp.
References addAttributes(), B(), C(), and get().
|
nodiscard |
Add attributes to the attribute set.
Returns a new set because attribute sets are immutable.
Definition at line 992 of file Attributes.cpp.
References B(), C(), get(), and hasAttributes().
Referenced by addAttribute(), addAttribute(), llvm::OpenMPIRBuilder::addAttributes(), and llvm::RTLIB::RuntimeLibcallsInfo::getDefaultFunctionTy().
| 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 1005 of file Attributes.cpp.
References B(), C(), get(), and hasAttributes().
|
nodiscard |
Add attributes to the attribute set, replacing attributes of the same kind.
Attrs must be sorted like an attribute set, with at most one attribute of each kind. Returns a new set because attribute sets are immutable.
Definition at line 2455 of file Attributes.cpp.
References llvm::ArrayRef(), assert(), AttributeSet(), begin(), C(), end(), llvm::AttributeSetNode::getSorted(), isSortedAndUnique(), and mergeSortedAttrs().
Referenced by llvm::RTLIB::RuntimeLibcallsInfo::getDefaultFunctionTy().
| AttributeSet::iterator AttributeSet::begin | ( | ) | const |
Definition at line 1283 of file Attributes.cpp.
References getNode().
Referenced by addSortedAttributes(), and intersectWith().
| LLVM_DUMP_METHOD void AttributeSet::dump | ( | ) | const |
Definition at line 1292 of file Attributes.cpp.
References llvm::dbgs(), getAsString(), and LLVM_DUMP_METHOD.
| AttributeSet::iterator AttributeSet::end | ( | ) | const |
Definition at line 1287 of file Attributes.cpp.
References getNode().
Referenced by addSortedAttributes(), and intersectWith().
|
static |
Definition at line 973 of file Attributes.cpp.
References AttributeSet(), C(), and llvm::AttributeSetNode::get().
|
static |
Definition at line 969 of file Attributes.cpp.
References AttributeSet(), B(), C(), and llvm::AttributeSetNode::get().
Referenced by addAttribute(), addAttribute(), addAttributes(), addAttributes(), AddParamAndFnBasicAttributes(), llvm::RTLIB::RuntimeLibcallsInfo::getDefaultFunctionTy(), intersectWith(), llvm::promoteCall(), removeAttribute(), removeAttribute(), removeAttributes(), and llvm::VPIRAttributes::VPIRAttributes().
| MaybeAlign AttributeSet::getAlignment | ( | ) | const |
Definition at line 1192 of file Attributes.cpp.
References getNode().
| AllocFnKind AttributeSet::getAllocKind | ( | ) | const |
Definition at line 1257 of file Attributes.cpp.
References getNode(), and llvm::Unknown.
| std::optional< std::pair< unsigned, std::optional< unsigned > > > AttributeSet::getAllocSizeArgs | ( | ) | const |
Definition at line 1239 of file Attributes.cpp.
References getNode().
| std::string AttributeSet::getAsString | ( | bool | InAttrGrp = false | ) | const |
Definition at line 1273 of file Attributes.cpp.
References getNode().
Referenced by dump(), llvm::VPIRAttributes::printFnAttrs(), llvm::VPIRAttributes::printParamAttrs(), and llvm::VPIRAttributes::printRetAttrs().
| Attribute AttributeSet::getAttribute | ( | Attribute::AttrKind | Kind | ) | const |
Return the attribute object.
Definition at line 1184 of file Attributes.cpp.
References llvm::Attribute, and getNode().
Referenced by getDenormalFPEnv(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::GCNTargetMachine::getSubtargetImpl(), llvm::HexagonTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::R600TargetMachine::getSubtargetImpl(), llvm::RISCVTargetMachine::getSubtargetImpl(), llvm::SparcTargetMachine::getSubtargetImpl(), llvm::SystemZTargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), intersectWith(), isEqual(), isEqual(), llvm::Attributor::manifestAttrs(), and llvm::typeIncompatible().
Return the target-dependent attribute object.
Definition at line 1188 of file Attributes.cpp.
References llvm::Attribute, and getNode().
| Type * AttributeSet::getByRefType | ( | ) | const |
Definition at line 1212 of file Attributes.cpp.
References getNode().
| Type * AttributeSet::getByValType | ( | ) | const |
Definition at line 1216 of file Attributes.cpp.
References getNode().
| CaptureInfo AttributeSet::getCaptureInfo | ( | ) | const |
Definition at line 1265 of file Attributes.cpp.
References llvm::CaptureInfo::all(), and getNode().
Referenced by llvm::CallBase::getCaptureInfo(), llvm::CallBase::hasArgumentWithAdditionalReturnCaptureComponents(), and llvm::isParamGridConstant().
| DeadOnReturnInfo AttributeSet::getDeadOnReturnInfo | ( | ) | const |
Definition at line 1204 of file Attributes.cpp.
References getNode().
| uint64_t AttributeSet::getDereferenceableBytes | ( | ) | const |
Definition at line 1200 of file Attributes.cpp.
References getNode().
| uint64_t AttributeSet::getDereferenceableOrNullBytes | ( | ) | const |
Definition at line 1208 of file Attributes.cpp.
References getNode().
| Type * AttributeSet::getElementType | ( | ) | const |
Definition at line 1233 of file Attributes.cpp.
References getNode().
| Type * AttributeSet::getInAllocaType | ( | ) | const |
Definition at line 1229 of file Attributes.cpp.
References getNode().
| MemoryEffects AttributeSet::getMemoryEffects | ( | ) | const |
Definition at line 1261 of file Attributes.cpp.
References getNode(), and llvm::MemoryEffectsBase< IRMemLocation >::unknown().
Referenced by llvm::VPIRAttributes::getMemoryEffects(), and llvm::SITargetLowering::getTgtMemIntrinsic().
| FPClassTest AttributeSet::getNoFPClass | ( | ) | const |
Definition at line 1269 of file Attributes.cpp.
References llvm::fcNone, and getNode().
| unsigned AttributeSet::getNumAttributes | ( | ) | const |
Return the number of attributes in this set.
Definition at line 1175 of file Attributes.cpp.
References getNode().
| Type * AttributeSet::getPreallocatedType | ( | ) | const |
Definition at line 1224 of file Attributes.cpp.
References getNode().
| MaybeAlign AttributeSet::getStackAlignment | ( | ) | const |
Definition at line 1196 of file Attributes.cpp.
References getNode().
| Type * AttributeSet::getStructRetType | ( | ) | const |
Definition at line 1220 of file Attributes.cpp.
References getNode().
| UWTableKind AttributeSet::getUWTableKind | ( | ) | const |
Definition at line 1253 of file Attributes.cpp.
References getNode(), and llvm::None.
| std::optional< unsigned > AttributeSet::getVScaleRangeMax | ( | ) | const |
Definition at line 1249 of file Attributes.cpp.
References getNode().
| unsigned AttributeSet::getVScaleRangeMin | ( | ) | const |
Definition at line 1245 of file Attributes.cpp.
References getNode().
|
inline |
Return true if the attribute exists in this set.
Definition at line 532 of file Attributes.h.
Referenced by addAttribute(), checkStrictFP(), llvm::VPIRAttributes::hasFnAttr(), llvm::GlobalVariable::hasImplicitSection(), llvm::VPRecipeBase::isSafeToSpeculativelyExecute(), maySpeculateLanes(), printFunctionArgExts(), removeAttribute(), removeAttribute(), and removeUnnecessaryCallSiteExtends().
Return true if the attribute exists in this set.
Definition at line 1180 of file Attributes.cpp.
References getNode().
|
inline |
Return true if attributes exists in this set.
Definition at line 529 of file Attributes.h.
Referenced by addAttributes(), addAttributes(), hasParentContext(), llvm::VPIRAttributes::printFnAttrs(), llvm::VPIRAttributes::printParamAttrs(), and llvm::VPIRAttributes::printRetAttrs().
| bool AttributeSet::hasParentContext | ( | LLVMContext & | C | ) | const |
Return true if this attribute set belongs to the LLVMContext.
Definition at line 1277 of file Attributes.cpp.
References assert(), C(), getNode(), 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 1046 of file Attributes.cpp.
References assert(), begin(), 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 475 of file Attributes.h.
|
inline |
Definition at line 474 of file Attributes.h.
|
nodiscard |
Remove the specified attribute from this set.
Returns a new set because attribute sets are immutable.
Definition at line 1018 of file Attributes.cpp.
References B(), C(), get(), and hasAttribute().
|
nodiscard |
Remove the specified attribute from this set.
Returns a new set because attribute sets are immutable.
Definition at line 1026 of file Attributes.cpp.
References B(), C(), get(), and hasAttribute().
|
nodiscard |
Remove the specified attributes from this set.
Returns a new set because attribute sets are immutable.
Definition at line 1034 of file Attributes.cpp.
References A(), B(), C(), get(), and llvm::none_of().
Referenced by moveFunctionAdaptingType().
|
friend |
Definition at line 450 of file Attributes.h.
References DenseMapInfo, and LLVM_ABI.
Referenced by DenseMapInfo.