|
LLVM
3.7.0
|
#include <Attributes.h>
Public Types | |
| enum | AttrIndex : unsigned { ReturnIndex = 0U, FunctionIndex = ~0U } |
| typedef ArrayRef< Attribute > ::iterator | iterator |
Public Member Functions | |
| AttributeSet () | |
| AttributeSet | addAttribute (LLVMContext &C, unsigned Index, Attribute::AttrKind Attr) const |
| Add an attribute to the attribute set at the given index. More... | |
| AttributeSet | addAttribute (LLVMContext &C, unsigned Index, StringRef Kind) const |
| Add an attribute to the attribute set at the given index. More... | |
| AttributeSet | addAttribute (LLVMContext &C, unsigned Index, StringRef Kind, StringRef Value) const |
| AttributeSet | addAttributes (LLVMContext &C, unsigned Index, AttributeSet Attrs) const |
| Add attributes to the attribute set at the given index. More... | |
| AttributeSet | removeAttribute (LLVMContext &C, unsigned Index, Attribute::AttrKind Attr) const |
| Remove the specified attribute at the specified index from this attribute list. More... | |
| AttributeSet | removeAttributes (LLVMContext &C, unsigned Index, AttributeSet Attrs) const |
| Remove the specified attributes at the specified index from this attribute list. More... | |
| AttributeSet | removeAttributes (LLVMContext &C, unsigned Index, const AttrBuilder &Attrs) const |
| Remove the specified attributes at the specified index from this attribute list. More... | |
| AttributeSet | addDereferenceableAttr (LLVMContext &C, unsigned Index, uint64_t Bytes) const |
| Add the dereferenceable attribute to the attribute set at the given index. More... | |
| AttributeSet | addDereferenceableOrNullAttr (LLVMContext &C, unsigned Index, uint64_t Bytes) const |
| Add the dereferenceable_or_null attribute to the attribute set at the given index. More... | |
| LLVMContext & | getContext () const |
| Retrieve the LLVM context. More... | |
| AttributeSet | getParamAttributes (unsigned Index) const |
| The attributes for the specified index are returned. More... | |
| AttributeSet | getRetAttributes () const |
| The attributes for the ret value are returned. More... | |
| AttributeSet | getFnAttributes () const |
| The function attributes are returned. More... | |
| bool | hasAttribute (unsigned Index, Attribute::AttrKind Kind) const |
| Return true if the attribute exists at the given index. More... | |
| bool | hasAttribute (unsigned Index, StringRef Kind) const |
| Return true if the attribute exists at the given index. More... | |
| bool | hasAttributes (unsigned Index) const |
| Return true if attribute exists at the given index. More... | |
| bool | hasAttrSomewhere (Attribute::AttrKind Attr) const |
| Return true if the specified attribute is set for at least one parameter or for the return value. More... | |
| Attribute | getAttribute (unsigned Index, Attribute::AttrKind Kind) const |
| Return the attribute object that exists at the given index. More... | |
| Attribute | getAttribute (unsigned Index, StringRef Kind) const |
| Return the attribute object that exists at the given index. More... | |
| unsigned | getParamAlignment (unsigned Index) const |
| Return the alignment for the specified function parameter. More... | |
| unsigned | getStackAlignment (unsigned Index) const |
| Get the stack alignment. More... | |
| uint64_t | getDereferenceableBytes (unsigned Index) const |
| Get the number of dereferenceable bytes (or zero if unknown). More... | |
| uint64_t | getDereferenceableOrNullBytes (unsigned Index) const |
| Get the number of dereferenceable_or_null bytes (or zero if unknown). More... | |
| std::string | getAsString (unsigned Index, bool InAttrGrp=false) const |
| Return the attributes at the index as a string. More... | |
| iterator | begin (unsigned Slot) const |
| iterator | end (unsigned Slot) const |
| bool | operator== (const AttributeSet &RHS) const |
| operator==/!= - Provide equality predicates. More... | |
| bool | operator!= (const AttributeSet &RHS) const |
| uint64_t | Raw (unsigned Index) 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... | |
| unsigned | getNumSlots () const |
| Return the number of slots used in this attribute list. More... | |
| unsigned | getSlotIndex (unsigned Slot) const |
| Return the index for the given slot. More... | |
| AttributeSet | getSlotAttributes (unsigned Slot) const |
| Return the attributes at the given slot. More... | |
| void | dump () const |
Static Public Member Functions | |
| static AttributeSet | get (LLVMContext &C, ArrayRef< AttributeSet > Attrs) |
| Return an AttributeSet with the specified parameters in it. More... | |
| static AttributeSet | get (LLVMContext &C, unsigned Index, ArrayRef< Attribute::AttrKind > Kind) |
| static AttributeSet | get (LLVMContext &C, unsigned Index, const AttrBuilder &B) |
Friends | |
| class | AttrBuilder |
| class | AttributeSetImpl |
| template<typename Ty > | |
| struct | DenseMapInfo |
Definition at line 223 of file Attributes.h.
Definition at line 364 of file Attributes.h.
| Enumerator | |
|---|---|
| ReturnIndex | |
| FunctionIndex | |
Definition at line 225 of file Attributes.h.
|
inline |
Definition at line 255 of file Attributes.h.
Referenced by get(), getFnAttributes(), getParamAttributes(), getRetAttributes(), and removeAttributes().
| AttributeSet AttributeSet::addAttribute | ( | LLVMContext & | C, |
| unsigned | Index, | ||
| Attribute::AttrKind | Attr | ||
| ) | const |
Add an attribute to the attribute set at the given index.
Because attribute sets are immutable, this returns a new set.
Definition at line 753 of file Attributes.cpp.
References addAttributes(), and hasAttribute().
Referenced by llvm::Function::addAttribute(), llvm::CallInst::addAttribute(), llvm::InvokeInst::addAttribute(), llvm::Function::addFnAttr(), fixupFPReturnAndCall(), and removeUseSoftFloat().
| AttributeSet AttributeSet::addAttribute | ( | LLVMContext & | C, |
| unsigned | Index, | ||
| StringRef | Kind | ||
| ) | const |
Add an attribute to the attribute set at the given index.
Because attribute sets are immutable, this returns a new set.
Definition at line 759 of file Attributes.cpp.
References llvm::AttrBuilder::addAttribute(), and addAttributes().
| AttributeSet AttributeSet::addAttribute | ( | LLVMContext & | C, |
| unsigned | Index, | ||
| StringRef | Kind, | ||
| StringRef | Value | ||
| ) | const |
Definition at line 766 of file Attributes.cpp.
References llvm::AttrBuilder::addAttribute(), and addAttributes().
| AttributeSet AttributeSet::addAttributes | ( | LLVMContext & | C, |
| unsigned | Index, | ||
| AttributeSet | Attrs | ||
| ) | const |
Add attributes to the attribute set at the given index.
Because attribute sets are immutable, this returns a new set.
Definition at line 773 of file Attributes.cpp.
References llvm::AttrBuilder::addAttribute(), llvm::AttributeSetImpl::begin(), llvm::C, llvm::AttributeSetImpl::end(), llvm::AttributeSetImpl::getNumAttributes(), getParamAlignment(), getSlotAttributes(), getSlotIndex(), I, llvm::ARM_PROC::IE, and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by addAttribute(), llvm::Function::addAttributes(), addDereferenceableAttr(), addDereferenceableOrNullAttr(), llvm::CloneFunctionInto(), legalizeCallAttributes(), LLVMAddFunctionAttr(), LLVMAddInstrAttribute(), LLVMSetInstrParamAlignment(), and setFunctionAttributes().
| AttributeSet AttributeSet::addDereferenceableAttr | ( | LLVMContext & | C, |
| unsigned | Index, | ||
| uint64_t | Bytes | ||
| ) | const |
Add the dereferenceable attribute to the attribute set at the given index.
Because attribute sets are immutable, this returns a new set.
Definition at line 907 of file Attributes.cpp.
References addAttributes(), and llvm::AttrBuilder::addDereferenceableAttr().
Referenced by llvm::Function::addDereferenceableAttr(), llvm::CallInst::addDereferenceableAttr(), and llvm::InvokeInst::addDereferenceableAttr().
| AttributeSet AttributeSet::addDereferenceableOrNullAttr | ( | LLVMContext & | C, |
| unsigned | Index, | ||
| uint64_t | Bytes | ||
| ) | const |
Add the dereferenceable_or_null attribute to the attribute set at the given index.
Because attribute sets are immutable, this returns a new set.
Definition at line 914 of file Attributes.cpp.
References addAttributes(), and llvm::AttrBuilder::addDereferenceableOrNullAttr().
Referenced by llvm::Function::addDereferenceableOrNullAttr(), llvm::CallInst::addDereferenceableOrNullAttr(), and llvm::InvokeInst::addDereferenceableOrNullAttr().
| AttributeSet::iterator AttributeSet::begin | ( | unsigned | Slot | ) | const |
Definition at line 1035 of file Attributes.cpp.
Referenced by llvm::AttrBuilder::hasAttributes(), legalizeCallAttributes(), llvm::AttrBuilder::removeAttributes(), and WriteAttributeGroupTable().
| void AttributeSet::dump | ( | ) | const |
Definition at line 1075 of file Attributes.cpp.
References llvm::dbgs(), getAsString(), getNumSlots(), and getSlotIndex().
| AttributeSet::iterator AttributeSet::end | ( | unsigned | Slot | ) | const |
Definition at line 1041 of file Attributes.cpp.
Referenced by llvm::AttrBuilder::hasAttributes(), legalizeCallAttributes(), llvm::AttrBuilder::removeAttributes(), and WriteAttributeGroupTable().
|
static |
Return an AttributeSet with the specified parameters in it.
Definition at line 722 of file Attributes.cpp.
References llvm::SmallVectorImpl< T >::append(), AttributeSet(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::ArrayRef< T >::empty(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::AttributeSetImpl::getNumAttributes(), I, llvm::SmallVectorImpl< T >::insert(), and llvm::ArrayRef< T >::size().
|
static |
Definition at line 713 of file Attributes.cpp.
References llvm::ArrayRef< T >::begin(), llvm::C, llvm::ArrayRef< T >::end(), llvm::Attribute::get(), I, and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
|
static |
Definition at line 675 of file Attributes.cpp.
References llvm::Attribute::Alignment, AttributeSet(), llvm::C, llvm::AttrBuilder::contains(), llvm::Attribute::Dereferenceable, llvm::Attribute::DereferenceableOrNull, llvm::Attribute::EndAttrKinds, llvm::Attribute::get(), llvm::AttrBuilder::getAlignment(), llvm::AttrBuilder::getDereferenceableBytes(), llvm::AttrBuilder::getDereferenceableOrNullBytes(), llvm::AttrBuilder::getStackAlignment(), llvm::Attribute::getWithDereferenceableBytes(), llvm::Attribute::getWithDereferenceableOrNullBytes(), llvm::AttrBuilder::hasAttributes(), Kind, llvm::Attribute::None, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Attribute::StackAlignment, and llvm::AttrBuilder::td_attrs().
Return the attributes at the index as a string.
Definition at line 1017 of file Attributes.cpp.
References llvm::AttributeSetNode::getAsString(), and llvm::Intrinsic::getAttributes().
Referenced by dump().
| Attribute AttributeSet::getAttribute | ( | unsigned | Index, |
| Attribute::AttrKind | Kind | ||
| ) | const |
Return the attribute object that exists at the given index.
Definition at line 985 of file Attributes.cpp.
References llvm::AttributeSetNode::getAttribute(), and llvm::Intrinsic::getAttributes().
Referenced by llvm::Function::getFnAttribute(), and ReplaceWithStatepoint().
Return the attribute object that exists at the given index.
Definition at line 991 of file Attributes.cpp.
References llvm::AttributeSetNode::getAttribute(), and llvm::Intrinsic::getAttributes().
| LLVMContext & AttributeSet::getContext | ( | ) | const |
Retrieve the LLVM context.
Definition at line 926 of file Attributes.cpp.
Referenced by legalizeCallAttributes().
| uint64_t AttributeSet::getDereferenceableBytes | ( | unsigned | Index | ) | const |
Get the number of dereferenceable bytes (or zero if unknown).
Definition at line 1007 of file Attributes.cpp.
References llvm::Intrinsic::getAttributes(), and llvm::AttributeSetNode::getDereferenceableBytes().
Referenced by llvm::Function::getDereferenceableBytes(), llvm::CallInst::getDereferenceableBytes(), and llvm::InvokeInst::getDereferenceableBytes().
| uint64_t AttributeSet::getDereferenceableOrNullBytes | ( | unsigned | Index | ) | const |
Get the number of dereferenceable_or_null bytes (or zero if unknown).
Definition at line 1012 of file Attributes.cpp.
References llvm::Intrinsic::getAttributes(), and llvm::AttributeSetNode::getDereferenceableOrNullBytes().
Referenced by llvm::Function::getDereferenceableOrNullBytes(), llvm::CallInst::getDereferenceableOrNullBytes(), and llvm::InvokeInst::getDereferenceableOrNullBytes().
| AttributeSet AttributeSet::getFnAttributes | ( | ) | const |
The function attributes are returned.
Definition at line 947 of file Attributes.cpp.
References AttributeSet(), FunctionIndex, llvm::Intrinsic::getAttributes(), and hasAttributes().
Referenced by llvm::CloneFunctionInto(), makeStatepointExplicitImpl(), and ReplaceWithStatepoint().
| unsigned AttributeSet::getNumSlots | ( | ) | const |
Return the number of slots used in this attribute list.
This is the number of arguments that have an attribute set on them (including the function itself).
Definition at line 1054 of file Attributes.cpp.
Referenced by llvm::Argument::addAttr(), llvm::CloneFunctionInto(), dump(), llvm::AttrBuilder::hasAttributes(), isEmpty(), legalizeCallAttributes(), llvm::Argument::removeAttr(), llvm::AttrBuilder::removeAttributes(), StripNest(), WriteAttributeGroupTable(), and WriteAttributeTable().
Return the alignment for the specified function parameter.
Definition at line 997 of file Attributes.cpp.
References llvm::AttributeSetNode::getAlignment(), and llvm::Intrinsic::getAttributes().
Referenced by addAttributes(), llvm::Function::getParamAlignment(), llvm::CallInst::getParamAlignment(), llvm::InvokeInst::getParamAlignment(), and getParameterABIAttributes().
| AttributeSet AttributeSet::getParamAttributes | ( | unsigned | Index | ) | const |
The attributes for the specified index are returned.
Definition at line 930 of file Attributes.cpp.
References AttributeSet(), llvm::Intrinsic::getAttributes(), and hasAttributes().
Referenced by llvm::CloneFunctionInto().
|
inline |
Return a raw pointer that uniquely identifies this attribute list.
Definition at line 385 of file Attributes.h.
| AttributeSet AttributeSet::getRetAttributes | ( | ) | const |
The attributes for the ret value are returned.
Definition at line 938 of file Attributes.cpp.
References AttributeSet(), llvm::Intrinsic::getAttributes(), hasAttributes(), and ReturnIndex.
Referenced by llvm::CloneFunctionInto(), makeStatepointExplicitImpl(), and ReplaceWithStatepoint().
| AttributeSet AttributeSet::getSlotAttributes | ( | unsigned | Slot | ) | const |
Return the attributes at the given slot.
Definition at line 1064 of file Attributes.cpp.
Referenced by addAttributes(), removeAttributes(), StripNest(), WriteAttributeGroupTable(), and WriteAttributeTable().
Return the index for the given slot.
Definition at line 1058 of file Attributes.cpp.
Referenced by llvm::Argument::addAttr(), addAttributes(), dump(), llvm::AttrBuilder::hasAttributes(), legalizeCallAttributes(), llvm::Argument::removeAttr(), removeAttributes(), llvm::AttrBuilder::removeAttributes(), StripNest(), and WriteAttributeGroupTable().
Get the stack alignment.
Definition at line 1002 of file Attributes.cpp.
References llvm::Intrinsic::getAttributes(), and llvm::AttributeSetNode::getStackAlignment().
Referenced by llvm::Function::getFnStackAlignment().
| bool AttributeSet::hasAttribute | ( | unsigned | Index, |
| Attribute::AttrKind | Kind | ||
| ) | const |
Return true if the attribute exists at the given index.
Definition at line 956 of file Attributes.cpp.
References llvm::Intrinsic::getAttributes(), and llvm::AttributeSetNode::hasAttribute().
Referenced by addAttribute(), llvm::Function::cannotDuplicate(), llvm::Function::doesNotAccessMemory(), llvm::Function::doesNotAlias(), llvm::Function::doesNotCapture(), llvm::Function::doesNotReturn(), llvm::Function::doesNotThrow(), getParameterABIAttributes(), llvm::GetReturnInfo(), llvm::Argument::hasByValOrInAllocaAttr(), llvm::Function::hasFnAttribute(), llvm::Function::hasStructRetAttr(), llvm::Function::hasUWTable(), llvm::HexagonEvaluator::HexagonEvaluator(), llvm::Function::isConvergent(), llvm::TargetLowering::isInTailCallPosition(), isMinSize(), isOptSize(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::WebAssemblyRegisterInfo::needsStackRealignment(), llvm::AArch64RegisterInfo::needsStackRealignment(), llvm::Function::onlyAccessesArgMemory(), llvm::Function::onlyReadsMemory(), llvm::StatepointBase< Function, Instruction, Value, CallSite >::paramHasAttr(), llvm::CallInst::paramHasAttr(), llvm::InvokeInst::paramHasAttr(), removeAttribute(), removeAttributes(), and StripNest().
Return true if the attribute exists at the given index.
Definition at line 961 of file Attributes.cpp.
References llvm::Intrinsic::getAttributes(), and llvm::AttributeSetNode::hasAttribute().
Return true if attribute exists at the given index.
Definition at line 966 of file Attributes.cpp.
References llvm::Intrinsic::getAttributes(), and llvm::AttributeSetNode::hasAttributes().
Referenced by getFnAttributes(), getParamAttributes(), and getRetAttributes().
| bool AttributeSet::hasAttrSomewhere | ( | Attribute::AttrKind | Attr | ) | const |
Return true if the specified attribute is set for at least one parameter or for the return value.
Definition at line 973 of file Attributes.cpp.
References I, and llvm::ARM_PROC::IE.
Referenced by llvm::XCoreFrameLowering::emitPrologue(), llvm::CallInst::hasByValArgument(), and llvm::InvokeInst::hasByValArgument().
|
inline |
Return true if there are no attributes.
Definition at line 390 of file Attributes.h.
References getNumSlots().
Referenced by llvm::ValueEnumerator::getAttributeGroupID(), and llvm::ValueEnumerator::getAttributeID().
|
inline |
Definition at line 373 of file Attributes.h.
|
inline |
operator==/!= - Provide equality predicates.
Definition at line 370 of file Attributes.h.
| uint64_t AttributeSet::Raw | ( | unsigned | Index | ) | const |
Definition at line 1070 of file Attributes.cpp.
Referenced by LLVMGetFunctionAttr().
| AttributeSet AttributeSet::removeAttribute | ( | LLVMContext & | C, |
| unsigned | Index, | ||
| Attribute::AttrKind | Attr | ||
| ) | const |
Remove the specified attribute at the specified index from this attribute list.
Because attribute lists are immutable, this returns the new list.
Definition at line 822 of file Attributes.cpp.
References hasAttribute(), and removeAttributes().
Referenced by llvm::Function::removeFnAttr(), and StripNest().
| AttributeSet AttributeSet::removeAttributes | ( | LLVMContext & | C, |
| unsigned | Index, | ||
| AttributeSet | Attrs | ||
| ) | const |
Remove the specified attributes at the specified index from this attribute list.
Because attribute lists are immutable, this returns the new list.
Definition at line 828 of file Attributes.cpp.
References llvm::Attribute::Alignment, AttributeSet(), llvm::C, llvm::AttributeSetImpl::getNumAttributes(), llvm::AttributeSetImpl::getSlotAttributes(), getSlotAttributes(), getSlotIndex(), hasAttribute(), I, and llvm::AttrBuilder::removeAttributes().
Referenced by LLVMRemoveFunctionAttr(), LLVMRemoveInstrAttribute(), removeAttribute(), llvm::CallInst::removeAttribute(), llvm::InvokeInst::removeAttribute(), llvm::Function::removeAttributes(), and ReplaceWithStatepoint().
| AttributeSet AttributeSet::removeAttributes | ( | LLVMContext & | C, |
| unsigned | Index, | ||
| const AttrBuilder & | Attrs | ||
| ) | const |
Remove the specified attributes at the specified index from this attribute list.
Because attribute lists are immutable, this returns the new list.
Definition at line 871 of file Attributes.cpp.
References AttributeSet(), llvm::C, getSlotAttributes(), getSlotIndex(), llvm::AttrBuilder::hasAlignmentAttr(), I, and llvm::AttrBuilder::remove().
|
friend |
Definition at line 230 of file Attributes.h.
|
friend |
Definition at line 231 of file Attributes.h.
|
friend |
Definition at line 232 of file Attributes.h.
1.8.6