class Attribute
Declaration
class Attribute { /* full declaration omitted */ };
Description
Functions, function parameters, and return types can have attributes to indicate how they should be treated by optimizations and code generation. This class represents one of those attributes. It's light-weight and should be passed around by-value.
Declared at: llvm/include/llvm/IR/Attributes.h:51
Method Overview
- public Attribute()
- public void Profile(llvm::FoldingSetNodeID & ID) const
- public static llvm::Attribute fromRawPointer(void * RawPtr)
- public static llvm::Attribute get(llvm::LLVMContext & Context, llvm::Attribute::AttrKind Kind, uint64_t Val = 0)
- public static llvm::Attribute get(llvm::LLVMContext & Context, llvm::StringRef Kind, llvm::StringRef Val = llvm::StringRef())
- public static llvm::Attribute get(llvm::LLVMContext & Context, llvm::Attribute::AttrKind Kind, llvm::Type * Ty)
- public llvm::MaybeAlign getAlignment() const
- public std::pair<unsigned int, Optional<unsigned int>> getAllocSizeArgs() const
- public std::string getAsString(bool InAttrGrp = false) const
- public uint64_t getDereferenceableBytes() const
- public uint64_t getDereferenceableOrNullBytes() const
- public Attribute::AttrKind getKindAsEnum() const
- public llvm::StringRef getKindAsString() const
- public void * getRawPointer() const
- public llvm::MaybeAlign getStackAlignment() const
- public uint64_t getValueAsInt() const
- public llvm::StringRef getValueAsString() const
- public llvm::Type * getValueAsType() const
- public static llvm::Attribute getWithAlignment(llvm::LLVMContext & Context, llvm::Align Alignment)
- public static llvm::Attribute getWithAllocSizeArgs(llvm::LLVMContext & Context, unsigned int ElemSizeArg, const Optional<unsigned int> & NumElemsArg)
- public static llvm::Attribute getWithByValType(llvm::LLVMContext & Context, llvm::Type * Ty)
- public static llvm::Attribute getWithDereferenceableBytes(llvm::LLVMContext & Context, uint64_t Bytes)
- public static llvm::Attribute getWithDereferenceableOrNullBytes(llvm::LLVMContext & Context, uint64_t Bytes)
- public static llvm::Attribute getWithStackAlignment(llvm::LLVMContext & Context, llvm::Align Alignment)
- public bool hasAttribute(llvm::StringRef Val) const
- public bool hasAttribute(llvm::Attribute::AttrKind Val) const
- public bool isEnumAttribute() const
- public bool isIntAttribute() const
- public bool isStringAttribute() const
- public bool isTypeAttribute() const
Methods
¶Attribute()
Attribute()
Declared at: llvm/include/llvm/IR/Attributes.h:84
¶void Profile(llvm::FoldingSetNodeID& ID) const
void Profile(llvm::FoldingSetNodeID& ID) const
Declared at: llvm/include/llvm/IR/Attributes.h:183
Parameters
¶static llvm::Attribute fromRawPointer(
void* RawPtr)
static llvm::Attribute fromRawPointer(
void* RawPtr)
Description
Get an attribute from a raw pointer created by getRawPointer.
Declared at: llvm/include/llvm/IR/Attributes.h:193
Parameters
- void* RawPtr
¶static llvm::Attribute get(
llvm::LLVMContext& Context,
llvm::Attribute::AttrKind Kind,
uint64_t Val = 0)
static llvm::Attribute get(
llvm::LLVMContext& Context,
llvm::Attribute::AttrKind Kind,
uint64_t Val = 0)
Description
Return a uniquified Attribute object.
Declared at: llvm/include/llvm/IR/Attributes.h:91
Parameters
- llvm::LLVMContext& Context
- llvm::Attribute::AttrKind Kind
- uint64_t Val = 0
¶static llvm::Attribute get(
llvm::LLVMContext& Context,
llvm::StringRef Kind,
llvm::StringRef Val = llvm::StringRef())
static llvm::Attribute get(
llvm::LLVMContext& Context,
llvm::StringRef Kind,
llvm::StringRef Val = llvm::StringRef())
Declared at: llvm/include/llvm/IR/Attributes.h:92
Parameters
- llvm::LLVMContext& Context
- llvm::StringRef Kind
- llvm::StringRef Val = llvm::StringRef()
¶static llvm::Attribute get(
llvm::LLVMContext& Context,
llvm::Attribute::AttrKind Kind,
llvm::Type* Ty)
static llvm::Attribute get(
llvm::LLVMContext& Context,
llvm::Attribute::AttrKind Kind,
llvm::Type* Ty)
Declared at: llvm/include/llvm/IR/Attributes.h:94
Parameters
- llvm::LLVMContext& Context
- llvm::Attribute::AttrKind Kind
- llvm::Type* Ty
¶llvm::MaybeAlign getAlignment() const
llvm::MaybeAlign getAlignment() const
Description
Returns the alignment field of an attribute as a byte alignment value.
Declared at: llvm/include/llvm/IR/Attributes.h:154
¶std::pair<unsigned int, Optional<unsigned int>>
getAllocSizeArgs() const
std::pair<unsigned int, Optional<unsigned int>>
getAllocSizeArgs() const
Description
Returns the argument numbers for the allocsize attribute (or pair(0, 0) if not known).
Declared at: llvm/include/llvm/IR/Attributes.h:170
¶std::string getAsString(
bool InAttrGrp = false) const
std::string getAsString(
bool InAttrGrp = false) const
Description
The Attribute is converted to a string of equivalent mnemonic. This is, presumably, for writing out the mnemonics for the assembly writer.
Declared at: llvm/include/llvm/IR/Attributes.h:174
Parameters
- bool InAttrGrp = false
¶uint64_t getDereferenceableBytes() const
uint64_t getDereferenceableBytes() const
Description
Returns the number of dereferenceable bytes from the dereferenceable attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:162
¶uint64_t getDereferenceableOrNullBytes() const
uint64_t getDereferenceableOrNullBytes() const
Description
Returns the number of dereferenceable_or_null bytes from the dereferenceable_or_null attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:166
¶Attribute::AttrKind getKindAsEnum() const
Attribute::AttrKind getKindAsEnum() const
Description
Return the attribute's kind as an enum (Attribute::AttrKind). This requires the attribute to be an enum or integer attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:134
¶llvm::StringRef getKindAsString() const
llvm::StringRef getKindAsString() const
Description
Return the attribute's kind as a string. This requires the attribute to be a string attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:142
¶void* getRawPointer() const
void* getRawPointer() const
Description
Return a raw pointer that uniquely identifies this attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:188
¶llvm::MaybeAlign getStackAlignment() const
llvm::MaybeAlign getStackAlignment() const
Description
Returns the stack alignment field of an attribute as a byte alignment value.
Declared at: llvm/include/llvm/IR/Attributes.h:158
¶uint64_t getValueAsInt() const
uint64_t getValueAsInt() const
Description
Return the attribute's value as an integer. This requires that the attribute be an integer attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:138
¶llvm::StringRef getValueAsString() const
llvm::StringRef getValueAsString() const
Description
Return the attribute's value as a string. This requires the attribute to be a string attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:146
¶llvm::Type* getValueAsType() const
llvm::Type* getValueAsType() const
Description
Return the attribute's value as a Type. This requires the attribute to be a type attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:150
¶static llvm::Attribute getWithAlignment(
llvm::LLVMContext& Context,
llvm::Align Alignment)
static llvm::Attribute getWithAlignment(
llvm::LLVMContext& Context,
llvm::Align Alignment)
Description
Return a uniquified Attribute object that has the specific alignment set.
Declared at: llvm/include/llvm/IR/Attributes.h:98
Parameters
- llvm::LLVMContext& Context
- llvm::Align Alignment
¶static llvm::Attribute getWithAllocSizeArgs(
llvm::LLVMContext& Context,
unsigned int ElemSizeArg,
const Optional<unsigned int>& NumElemsArg)
static llvm::Attribute getWithAllocSizeArgs(
llvm::LLVMContext& Context,
unsigned int ElemSizeArg,
const Optional<unsigned int>& NumElemsArg)
Declared at: llvm/include/llvm/IR/Attributes.h:104
Parameters
- llvm::LLVMContext& Context
- unsigned int ElemSizeArg
- const Optional<unsigned int>& NumElemsArg
¶static llvm::Attribute getWithByValType(
llvm::LLVMContext& Context,
llvm::Type* Ty)
static llvm::Attribute getWithByValType(
llvm::LLVMContext& Context,
llvm::Type* Ty)
Declared at: llvm/include/llvm/IR/Attributes.h:107
Parameters
- llvm::LLVMContext& Context
- llvm::Type* Ty
¶static llvm::Attribute
getWithDereferenceableBytes(
llvm::LLVMContext& Context,
uint64_t Bytes)
static llvm::Attribute
getWithDereferenceableBytes(
llvm::LLVMContext& Context,
uint64_t Bytes)
Declared at: llvm/include/llvm/IR/Attributes.h:100
Parameters
- llvm::LLVMContext& Context
- uint64_t Bytes
¶static llvm::Attribute
getWithDereferenceableOrNullBytes(
llvm::LLVMContext& Context,
uint64_t Bytes)
static llvm::Attribute
getWithDereferenceableOrNullBytes(
llvm::LLVMContext& Context,
uint64_t Bytes)
Declared at: llvm/include/llvm/IR/Attributes.h:102
Parameters
- llvm::LLVMContext& Context
- uint64_t Bytes
¶static llvm::Attribute getWithStackAlignment(
llvm::LLVMContext& Context,
llvm::Align Alignment)
static llvm::Attribute getWithStackAlignment(
llvm::LLVMContext& Context,
llvm::Align Alignment)
Declared at: llvm/include/llvm/IR/Attributes.h:99
Parameters
- llvm::LLVMContext& Context
- llvm::Align Alignment
¶bool hasAttribute(llvm::StringRef Val) const
bool hasAttribute(llvm::StringRef Val) const
Description
Return true if the target-dependent attribute is present.
Declared at: llvm/include/llvm/IR/Attributes.h:130
Parameters
- llvm::StringRef Val
¶bool hasAttribute(
llvm::Attribute::AttrKind Val) const
bool hasAttribute(
llvm::Attribute::AttrKind Val) const
Description
Return true if the attribute is present.
Declared at: llvm/include/llvm/IR/Attributes.h:127
Parameters
- llvm::Attribute::AttrKind Val
¶bool isEnumAttribute() const
bool isEnumAttribute() const
Description
Return true if the attribute is an Attribute::AttrKind type.
Declared at: llvm/include/llvm/IR/Attributes.h:114
¶bool isIntAttribute() const
bool isIntAttribute() const
Description
Return true if the attribute is an integer attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:117
¶bool isStringAttribute() const
bool isStringAttribute() const
Description
Return true if the attribute is a string (target-dependent) attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:121
¶bool isTypeAttribute() const
bool isTypeAttribute() const
Description
Return true if the attribute is a type attribute.
Declared at: llvm/include/llvm/IR/Attributes.h:124