LLVM
8.0.1
|
#include "llvm/IR/Attributes.h"
Public Types | |
using | td_type = std::pair< std::string, std::string > |
using | td_iterator = std::map< std::string, std::string >::iterator |
using | td_const_iterator = std::map< std::string, std::string >::const_iterator |
using | td_range = iterator_range< td_iterator > |
using | td_const_range = iterator_range< td_const_iterator > |
Public Member Functions | |
AttrBuilder ()=default | |
AttrBuilder (const Attribute &A) | |
AttrBuilder (AttributeList AS, unsigned Idx) | |
AttrBuilder (AttributeSet AS) | |
void | clear () |
AttrBuilder & | addAttribute (Attribute::AttrKind Val) |
Add an attribute to the builder. More... | |
AttrBuilder & | addAttribute (Attribute A) |
Add the Attribute object to the builder. More... | |
AttrBuilder & | addAttribute (StringRef A, StringRef V=StringRef()) |
Add the target-dependent attribute to the builder. More... | |
AttrBuilder & | removeAttribute (Attribute::AttrKind Val) |
Remove an attribute from the builder. More... | |
AttrBuilder & | removeAttributes (AttributeList A, uint64_t WithoutIndex) |
Remove the attributes from the builder. More... | |
AttrBuilder & | removeAttribute (StringRef A) |
Remove the target-dependent attribute to the builder. More... | |
AttrBuilder & | merge (const AttrBuilder &B) |
Add the attributes from the builder. More... | |
AttrBuilder & | remove (const AttrBuilder &B) |
Remove the attributes from the builder. More... | |
bool | overlaps (const AttrBuilder &B) const |
Return true if the builder has any attribute that's in the specified builder. More... | |
bool | contains (Attribute::AttrKind A) const |
Return true if the builder has the specified attribute. More... | |
bool | contains (StringRef A) const |
Return true if the builder has the specified target-dependent attribute. More... | |
bool | hasAttributes () const |
Return true if the builder has IR-level attributes. More... | |
bool | hasAttributes (AttributeList A, uint64_t Index) const |
Return true if the builder has any attribute that's in the specified attribute. More... | |
bool | hasAlignmentAttr () const |
Return true if the builder has an alignment attribute. More... | |
uint64_t | getAlignment () const |
Retrieve the alignment attribute, if it exists. More... | |
uint64_t | getStackAlignment () const |
Retrieve the stack alignment attribute, if it exists. More... | |
uint64_t | getDereferenceableBytes () const |
Retrieve the number of dereferenceable bytes, if the dereferenceable attribute exists (zero is returned otherwise). More... | |
uint64_t | getDereferenceableOrNullBytes () const |
Retrieve the number of dereferenceable_or_null bytes, if the dereferenceable_or_null attribute exists (zero is returned otherwise). More... | |
std::pair< unsigned, Optional< unsigned > > | getAllocSizeArgs () const |
Retrieve the allocsize args, if the allocsize attribute exists. More... | |
AttrBuilder & | addAlignmentAttr (unsigned Align) |
This turns an int alignment (which must be a power of 2) into the form used internally in Attribute. More... | |
AttrBuilder & | addStackAlignmentAttr (unsigned Align) |
This turns an int stack alignment (which must be a power of 2) into the form used internally in Attribute. More... | |
AttrBuilder & | addDereferenceableAttr (uint64_t Bytes) |
This turns the number of dereferenceable bytes into the form used internally in Attribute. More... | |
AttrBuilder & | addDereferenceableOrNullAttr (uint64_t Bytes) |
This turns the number of dereferenceable_or_null bytes into the form used internally in Attribute. More... | |
AttrBuilder & | addAllocSizeAttr (unsigned ElemSizeArg, const Optional< unsigned > &NumElemsArg) |
This turns one (or two) ints into the form used internally in Attribute. More... | |
AttrBuilder & | addAllocSizeAttrFromRawRepr (uint64_t RawAllocSizeRepr) |
Add an allocsize attribute, using the representation returned by Attribute.getIntValue(). More... | |
bool | empty () const |
Return true if the builder contains no target-independent attributes. More... | |
td_iterator | td_begin () |
td_iterator | td_end () |
td_const_iterator | td_begin () const |
td_const_iterator | td_end () const |
td_range | td_attrs () |
td_const_range | td_attrs () const |
bool | td_empty () const |
bool | operator== (const AttrBuilder &B) |
bool | operator!= (const AttrBuilder &B) |
Definition at line 693 of file Attributes.h.
using llvm::AttrBuilder::td_const_iterator = std::map<std::string, std::string>::const_iterator |
Definition at line 811 of file Attributes.h.
Definition at line 813 of file Attributes.h.
using llvm::AttrBuilder::td_iterator = std::map<std::string, std::string>::iterator |
Definition at line 810 of file Attributes.h.
Definition at line 812 of file Attributes.h.
using llvm::AttrBuilder::td_type = std::pair<std::string, std::string> |
Definition at line 809 of file Attributes.h.
|
default |
Definition at line 705 of file Attributes.h.
AttrBuilder::AttrBuilder | ( | AttributeList | AS, |
unsigned | Idx | ||
) |
Definition at line 1322 of file Attributes.cpp.
References A, and llvm::AttributeList::getAttributes().
AttrBuilder::AttrBuilder | ( | AttributeSet | AS | ) |
Definition at line 1328 of file Attributes.cpp.
References A.
AttrBuilder & AttrBuilder::addAlignmentAttr | ( | unsigned | Align | ) |
This turns an int alignment (which must be a power of 2) into the form used internally in Attribute.
Definition at line 1410 of file Attributes.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::Attribute::Alignment, assert(), and llvm::isPowerOf2_32().
Referenced by addRawAttributeValue(), decodeLLVMAttributesForBitcode(), getParameterABIAttributes(), and maybeSetDSOLocal().
AttrBuilder & AttrBuilder::addAllocSizeAttr | ( | unsigned | ElemSizeArg, |
const Optional< unsigned > & | NumElemsArg | ||
) |
This turns one (or two) ints into the form used internally in Attribute.
Definition at line 1450 of file Attributes.cpp.
References packAllocSizeArgs().
Referenced by llvm::AttributeList::addAllocSizeAttr(), and maybeSetDSOLocal().
AttrBuilder & AttrBuilder::addAllocSizeAttrFromRawRepr | ( | uint64_t | RawAllocSizeRepr | ) |
Add an allocsize attribute, using the representation returned by Attribute.getIntValue().
Definition at line 1455 of file Attributes.cpp.
References llvm::Attribute::AllocSize, and assert().
AttrBuilder & AttrBuilder::addAttribute | ( | Attribute::AttrKind | Val | ) |
Add an attribute to the builder.
Definition at line 1340 of file Attributes.cpp.
References llvm::Attribute::Alignment, llvm::Attribute::AllocSize, assert(), llvm::Attribute::Dereferenceable, llvm::Attribute::EndAttrKinds, and llvm::Attribute::StackAlignment.
Referenced by llvm::AttributeSet::addAttribute(), llvm::AttributeList::addAttribute(), llvm::AttributeSet::addAttributes(), llvm::AttributeList::addParamAttribute(), addRawAttributeValue(), adjustCallerSSPLevel(), CreateVarArgHelper(), llvm::createX86RetpolineThunksPass(), getParameterABIAttributes(), maybeSetDSOLocal(), RemoveNonValidAttrAtIndex(), removeUseSoftFloat(), setFastFlags(), llvm::AttributeFuncs::typeIncompatible(), and TypeSizeToSizeIndex().
AttrBuilder & AttrBuilder::addAttribute | ( | Attribute | A | ) |
Add the Attribute object to the builder.
Definition at line 1349 of file Attributes.cpp.
References llvm::Attribute::Alignment, llvm::Attribute::AllocSize, llvm::Attribute::Dereferenceable, llvm::Attribute::DereferenceableOrNull, llvm::Attribute::getAlignment(), llvm::Attribute::getDereferenceableBytes(), llvm::Attribute::getDereferenceableOrNullBytes(), llvm::Attribute::getKindAsEnum(), llvm::Attribute::getKindAsString(), llvm::Attribute::getStackAlignment(), llvm::Attribute::getValueAsInt(), llvm::Attribute::getValueAsString(), llvm::Attribute::isStringAttribute(), Kind, and llvm::Attribute::StackAlignment.
AttrBuilder & AttrBuilder::addAttribute | ( | StringRef | A, |
StringRef | V = StringRef() |
||
) |
Add the target-dependent attribute to the builder.
Definition at line 1371 of file Attributes.cpp.
References A.
AttrBuilder & AttrBuilder::addDereferenceableAttr | ( | uint64_t | Bytes | ) |
This turns the number of dereferenceable bytes into the form used internally in Attribute.
Definition at line 1433 of file Attributes.cpp.
References llvm::Attribute::Dereferenceable.
Referenced by llvm::AttributeList::addDereferenceableAttr(), and llvm::AttributeFuncs::typeIncompatible().
AttrBuilder & AttrBuilder::addDereferenceableOrNullAttr | ( | uint64_t | Bytes | ) |
This turns the number of dereferenceable_or_null bytes into the form used internally in Attribute.
Definition at line 1441 of file Attributes.cpp.
References llvm::Attribute::DereferenceableOrNull.
Referenced by llvm::AttributeList::addDereferenceableOrNullAttr(), and llvm::AttributeFuncs::typeIncompatible().
AttrBuilder & AttrBuilder::addStackAlignmentAttr | ( | unsigned | Align | ) |
This turns an int stack alignment (which must be a power of 2) into the form used internally in Attribute.
Definition at line 1421 of file Attributes.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, assert(), llvm::isPowerOf2_32(), and llvm::Attribute::StackAlignment.
Referenced by addRawAttributeValue(), and maybeSetDSOLocal().
void AttrBuilder::clear | ( | ) |
Definition at line 1333 of file Attributes.cpp.
Referenced by maybeSetDSOLocal().
|
inline |
Return true if the builder has the specified attribute.
Definition at line 743 of file Attributes.h.
References assert(), contains(), and llvm::Attribute::EndAttrKinds.
Referenced by FunctionNumber(), llvm::AttributeSetNode::get(), and overlaps().
Return true if the builder has the specified target-dependent attribute.
Definition at line 1529 of file Attributes.cpp.
|
inline |
Return true if the builder contains no target-independent attributes.
Definition at line 806 of file Attributes.h.
Referenced by RemoveNonValidAttrAtIndex().
|
inline |
Retrieve the alignment attribute, if it exists.
Definition at line 763 of file Attributes.h.
References llvm::Attribute::Alignment.
Referenced by llvm::AttributeList::addAttributes(), FunctionNumber(), and llvm::AttributeSetNode::get().
Retrieve the allocsize args, if the allocsize attribute exists.
If it doesn't exist, pair(0, 0) is returned.
Definition at line 1406 of file Attributes.cpp.
References unpackAllocSizeArgs().
Referenced by llvm::AttributeSetNode::get().
|
inline |
Retrieve the number of dereferenceable bytes, if the dereferenceable attribute exists (zero is returned otherwise).
Definition at line 770 of file Attributes.h.
Referenced by llvm::AttributeSetNode::get().
|
inline |
Retrieve the number of dereferenceable_or_null bytes, if the dereferenceable_or_null attribute exists (zero is returned otherwise).
Definition at line 774 of file Attributes.h.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, and llvm::Attribute::getAllocSizeArgs().
Referenced by llvm::AttributeSetNode::get().
|
inline |
Retrieve the stack alignment attribute, if it exists.
Definition at line 766 of file Attributes.h.
References llvm::Attribute::StackAlignment.
Referenced by llvm::AttributeSetNode::get().
bool AttrBuilder::hasAlignmentAttr | ( | ) | const |
Return true if the builder has an alignment attribute.
Definition at line 1553 of file Attributes.cpp.
Referenced by FunctionNumber().
bool AttrBuilder::hasAttributes | ( | ) | const |
Return true if the builder has IR-level attributes.
Definition at line 1533 of file Attributes.cpp.
References llvm::ArrayRef< T >::empty().
Referenced by llvm::AttributeList::addAttributes(), llvm::AttributeList::get(), maybeSetDSOLocal(), and setFastFlags().
bool AttrBuilder::hasAttributes | ( | AttributeList | A, |
uint64_t | Index | ||
) | const |
Return true if the builder has any attribute that's in the specified attribute.
Definition at line 1537 of file Attributes.cpp.
References assert(), contains(), and llvm::AttributeList::getAttributes().
AttrBuilder & AttrBuilder::merge | ( | const AttrBuilder & | B | ) |
Add the attributes from the builder.
Definition at line 1466 of file Attributes.cpp.
References I, and td_attrs().
Referenced by llvm::AttributeList::addAttributes(), and llvm::AttributeList::get().
|
inline |
Definition at line 830 of file Attributes.h.
References B.
bool AttrBuilder::operator== | ( | const AttrBuilder & | B | ) |
Definition at line 1557 of file Attributes.cpp.
bool AttrBuilder::overlaps | ( | const AttrBuilder & | B | ) | const |
Return true if the builder has any attribute that's in the specified builder.
Definition at line 1516 of file Attributes.cpp.
References contains(), and I.
Referenced by findInitTrampoline().
AttrBuilder & AttrBuilder::remove | ( | const AttrBuilder & | B | ) |
Remove the attributes from the builder.
Definition at line 1491 of file Attributes.cpp.
References I, and td_attrs().
Referenced by findInitTrampoline(), getRetComponentType(), legalizeCallAttributes(), llvm::promoteCall(), and llvm::AttributeSet::removeAttributes().
AttrBuilder & AttrBuilder::removeAttribute | ( | Attribute::AttrKind | Val | ) |
Remove an attribute from the builder.
Definition at line 1376 of file Attributes.cpp.
References llvm::Attribute::Alignment, llvm::Attribute::AllocSize, assert(), llvm::Attribute::Dereferenceable, llvm::Attribute::DereferenceableOrNull, llvm::Attribute::EndAttrKinds, and llvm::Attribute::StackAlignment.
Referenced by FunctionNumber(), getRetComponentType(), legalizeCallAttributes(), and llvm::AttributeSet::removeAttribute().
AttrBuilder & AttrBuilder::removeAttribute | ( | StringRef | A | ) |
Remove the target-dependent attribute to the builder.
Definition at line 1399 of file Attributes.cpp.
References I.
AttrBuilder & AttrBuilder::removeAttributes | ( | AttributeList | A, |
uint64_t | WithoutIndex | ||
) |
Remove the attributes from the builder.
Definition at line 1394 of file Attributes.cpp.
References llvm::AttributeList::getAttributes().
|
inline |
Definition at line 821 of file Attributes.h.
Referenced by llvm::AttributeSetNode::get(), merge(), and remove().
|
inline |
Definition at line 823 of file Attributes.h.
|
inline |
Definition at line 815 of file Attributes.h.
|
inline |
Definition at line 818 of file Attributes.h.
|
inline |
Definition at line 827 of file Attributes.h.
References llvm::Attribute::operator==().
|
inline |
Definition at line 816 of file Attributes.h.
|
inline |
Definition at line 819 of file Attributes.h.