LLVM  mainline
Public Types | Public Member Functions | Static Public Member Functions | Friends
llvm::AttributeSet Class Reference

#include <Attributes.h>

List of all members.

Public Types

enum  AttrIndex { 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.
AttributeSet addAttribute (LLVMContext &C, unsigned Index, StringRef Kind) const
 Add an attribute to the attribute set at the given index.
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.
AttributeSet removeAttribute (LLVMContext &C, unsigned Index, Attribute::AttrKind Attr) const
 Remove the specified attribute at the specified index from this attribute list.
AttributeSet removeAttributes (LLVMContext &C, unsigned Index, AttributeSet Attrs) const
 Remove the specified attributes at the specified index from this attribute list.
AttributeSet removeAttributes (LLVMContext &C, unsigned Index, const AttrBuilder &Attrs) const
 Remove the specified attributes at the specified index from this attribute list.
AttributeSet addDereferenceableAttr (LLVMContext &C, unsigned Index, uint64_t Bytes) const
 Add the dereferenceable attribute to the attribute set at the given index.
AttributeSet addDereferenceableOrNullAttr (LLVMContext &C, unsigned Index, uint64_t Bytes) const
 Add the dereferenceable_or_null attribute to the attribute set at the given index.
LLVMContextgetContext () const
 Retrieve the LLVM context.
AttributeSet getParamAttributes (unsigned Index) const
 The attributes for the specified index are returned.
AttributeSet getRetAttributes () const
 The attributes for the ret value are returned.
AttributeSet getFnAttributes () const
 The function attributes are returned.
bool hasAttribute (unsigned Index, Attribute::AttrKind Kind) const
 Return true if the attribute exists at the given index.
bool hasAttribute (unsigned Index, StringRef Kind) const
 Return true if the attribute exists at the given index.
bool hasAttributes (unsigned Index) const
 Return true if attribute exists at the given index.
bool hasAttrSomewhere (Attribute::AttrKind Attr) const
 Return true if the specified attribute is set for at least one parameter or for the return value.
Attribute getAttribute (unsigned Index, Attribute::AttrKind Kind) const
 Return the attribute object that exists at the given index.
Attribute getAttribute (unsigned Index, StringRef Kind) const
 Return the attribute object that exists at the given index.
unsigned getParamAlignment (unsigned Index) const
 Return the alignment for the specified function parameter.
unsigned getStackAlignment (unsigned Index) const
 Get the stack alignment.
uint64_t getDereferenceableBytes (unsigned Index) const
 Get the number of dereferenceable bytes (or zero if unknown).
uint64_t getDereferenceableOrNullBytes (unsigned Index) const
 Get the number of dereferenceable_or_null bytes (or zero if unknown).
std::string getAsString (unsigned Index, bool InAttrGrp=false) const
 Return the attributes at the index as a string.
iterator begin (unsigned Slot) const
iterator end (unsigned Slot) const
bool operator== (const AttributeSet &RHS) const
 operator==/!= - Provide equality predicates.
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.
bool isEmpty () const
 Return true if there are no attributes.
unsigned getNumSlots () const
 Return the number of slots used in this attribute list.
unsigned getSlotIndex (unsigned Slot) const
 Return the index for the given slot.
AttributeSet getSlotAttributes (unsigned Slot) const
 Return the attributes at the given slot.
void dump () const

Static Public Member Functions

static AttributeSet get (LLVMContext &C, ArrayRef< AttributeSet > Attrs)
 Return an AttributeSet with the specified parameters in it.
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
struct DenseMapInfo

Detailed Description

Definition at line 221 of file Attributes.h.


Member Typedef Documentation

Definition at line 362 of file Attributes.h.


Member Enumeration Documentation

Enumerator:
ReturnIndex 
FunctionIndex 

Definition at line 223 of file Attributes.h.


Constructor & Destructor Documentation

llvm::AttributeSet::AttributeSet ( ) [inline]

Member Function Documentation

Add an attribute to the attribute set at the given index.

Because attribute sets are immutable, this returns a new set.

Definition at line 748 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().

Add an attribute to the attribute set at the given index.

Because attribute sets are immutable, this returns a new set.

Definition at line 754 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 761 of file Attributes.cpp.

References llvm::AttrBuilder::addAttribute(), and addAttributes().

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 902 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 909 of file Attributes.cpp.

References addAttributes(), and llvm::AttrBuilder::addDereferenceableOrNullAttr().

Referenced by llvm::Function::addDereferenceableOrNullAttr(), llvm::CallInst::addDereferenceableOrNullAttr(), and llvm::InvokeInst::addDereferenceableOrNullAttr().

void AttributeSet::dump ( ) const

Definition at line 1070 of file Attributes.cpp.

References llvm::dbgs(), getAsString(), getNumSlots(), and getSlotIndex().

AttributeSet AttributeSet::get ( LLVMContext C,
ArrayRef< AttributeSet Attrs 
) [static]
AttributeSet AttributeSet::get ( LLVMContext C,
unsigned  Index,
ArrayRef< Attribute::AttrKind Kind 
) [static]
AttributeSet AttributeSet::get ( LLVMContext C,
unsigned  Index,
const AttrBuilder B 
) [static]
std::string AttributeSet::getAsString ( unsigned  Index,
bool  InAttrGrp = false 
) const

Return the attributes at the index as a string.

Definition at line 1012 of file Attributes.cpp.

References llvm::AttributeSetNode::getAsString(), and llvm::Intrinsic::getAttributes().

Referenced by dump().

Return the attribute object that exists at the given index.

Definition at line 980 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 986 of file Attributes.cpp.

References llvm::AttributeSetNode::getAttribute(), and llvm::Intrinsic::getAttributes().

Retrieve the LLVM context.

Definition at line 921 of file Attributes.cpp.

Referenced by legalizeCallAttributes().

The function attributes are returned.

Definition at line 942 of file Attributes.cpp.

References AttributeSet(), FunctionIndex, llvm::Intrinsic::getAttributes(), and hasAttributes().

Referenced by llvm::CloneFunctionInto(), makeStatepointExplicitImpl(), and ReplaceWithStatepoint().

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 1049 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().

The attributes for the specified index are returned.

Definition at line 925 of file Attributes.cpp.

References AttributeSet(), llvm::Intrinsic::getAttributes(), and hasAttributes().

Referenced by llvm::CloneFunctionInto().

void* llvm::AttributeSet::getRawPointer ( ) const [inline]

Return a raw pointer that uniquely identifies this attribute list.

Definition at line 383 of file Attributes.h.

The attributes for the ret value are returned.

Definition at line 933 of file Attributes.cpp.

References AttributeSet(), llvm::Intrinsic::getAttributes(), hasAttributes(), and ReturnIndex.

Referenced by llvm::CloneFunctionInto(), makeStatepointExplicitImpl(), and ReplaceWithStatepoint().

Return the attributes at the given slot.

Definition at line 1059 of file Attributes.cpp.

Referenced by addAttributes(), removeAttributes(), StripNest(), WriteAttributeGroupTable(), and WriteAttributeTable().

Get the stack alignment.

Definition at line 997 of file Attributes.cpp.

References llvm::Intrinsic::getAttributes(), and llvm::AttributeSetNode::getStackAlignment().

Referenced by llvm::Function::getFnStackAlignment().

bool AttributeSet::hasAttribute ( unsigned  Index,
StringRef  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().

Return true if attribute exists at the given index.

Definition at line 961 of file Attributes.cpp.

References llvm::Intrinsic::getAttributes(), and llvm::AttributeSetNode::hasAttributes().

Referenced by getFnAttributes(), getParamAttributes(), and getRetAttributes().

Return true if the specified attribute is set for at least one parameter or for the return value.

Definition at line 968 of file Attributes.cpp.

References I, and llvm::ARM_PROC::IE.

Referenced by llvm::XCoreFrameLowering::emitPrologue(), llvm::CallInst::hasByValArgument(), and llvm::InvokeInst::hasByValArgument().

bool llvm::AttributeSet::isEmpty ( ) const [inline]

Return true if there are no attributes.

Definition at line 388 of file Attributes.h.

References getNumSlots().

Referenced by llvm::ValueEnumerator::getAttributeGroupID(), and llvm::ValueEnumerator::getAttributeID().

bool llvm::AttributeSet::operator!= ( const AttributeSet RHS) const [inline]

Definition at line 371 of file Attributes.h.

bool llvm::AttributeSet::operator== ( const AttributeSet RHS) const [inline]

operator==/!= - Provide equality predicates.

Definition at line 368 of file Attributes.h.

uint64_t AttributeSet::Raw ( unsigned  Index) const

Definition at line 1065 of file Attributes.cpp.

Referenced by LLVMGetFunctionAttr().

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 817 of file Attributes.cpp.

References hasAttribute(), and removeAttributes().

Referenced by llvm::Function::removeFnAttr(), and StripNest().

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 866 of file Attributes.cpp.

References AttributeSet(), llvm::C, getSlotAttributes(), getSlotIndex(), llvm::AttrBuilder::hasAlignmentAttr(), I, and llvm::AttrBuilder::remove().


Friends And Related Function Documentation

friend class AttrBuilder [friend]

Definition at line 228 of file Attributes.h.

friend class AttributeSetImpl [friend]

Definition at line 229 of file Attributes.h.

friend struct DenseMapInfo [friend]

Definition at line 230 of file Attributes.h.


The documentation for this class was generated from the following files: