16 #ifndef LLVM_LIB_IR_ATTRIBUTEIMPL_H
17 #define LLVM_LIB_IR_ATTRIBUTEIMPL_H
97 virtual void anchor();
112 void anchor()
override;
121 "Wrong kind for int attribute!");
128 virtual void anchor();
149 std::copy(Attrs.
begin(), Attrs.
end(),
150 reinterpret_cast<Attribute *
>(
this + 1));
180 for (
unsigned I = 0, E = AttrList.
size();
I != E; ++
I)
185 AlignOf<AttributeSetNode>::Alignment >= AlignOf<Attribute>::Alignment,
186 "Alignment is insufficient for objects appended to AttributeSetNode");
204 return reinterpret_cast<const IndexAttrPair *
>(
this + 1) + Slot;
212 ArrayRef<std::pair<unsigned, AttributeSetNode *> > Attrs)
213 : Context(C), NumAttrs(Attrs.
size()) {
216 if (Attrs.size() >= 2) {
217 for (
const std::pair<unsigned, AttributeSetNode *> *i = Attrs.begin() + 1,
220 assert((i-1)->first <= i->first &&
"Attribute set not ordered!");
225 std::copy(Attrs.begin(), Attrs.end(),
240 return getNode(Slot)->first;
247 return AttributeSet::get(Context, *getNode(Slot));
253 return getNode(Slot)->second;
264 ArrayRef<std::pair<unsigned, AttributeSetNode*> > Nodes) {
265 for (
unsigned i = 0, e = Nodes.size(); i != e; ++i) {
272 uint64_t
Raw(
unsigned Index)
const;
277 AlignOf<AttributeSetImpl>::Alignment >=
278 AlignOf<AttributeSetImpl::IndexAttrPair>::Alignment,
279 "Alignment is insufficient for objects appended to AttributeSetImpl");
void AddPointer(const void *Ptr)
Add* - Add various data types to Bit data.
uint64_t getDereferenceableBytes() const
std::string getAsString(bool InAttrGrp) const
Alignment of stack for function (3 bits) stored as log2 of alignment with +1 bias 0 means unaligned (...
std::pair< unsigned, AttributeSetNode * > IndexAttrPair
AttributeSet getSlotAttributes(unsigned Slot) const
Retrieve the attributes for the given "slot" in the AttrNode list.
StringRef getStringValue() const
StringAttributeImpl(StringRef Kind, StringRef Val=StringRef())
void Profile(FoldingSetNodeID &ID) const
static void Profile(FoldingSetNodeID &ID, ArrayRef< Attribute > AttrList)
bool hasAttributes() const
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
This file contains the simple types necessary to represent the attributes associated with functions a...
Attribute::AttrKind getKindAsEnum() const
void AddInteger(signed I)
EnumAttributeImpl(AttrEntryKind ID, Attribute::AttrKind Kind)
bool operator<(const AttributeImpl &AI) const
Used when sorting the attributes.
EnumAttributeImpl(Attribute::AttrKind Kind)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
iterator end(unsigned Slot) const
AttributeSetNode::iterator iterator
size_t size() const
size - Get the array size.
StringRef getKindAsString() const
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
bool hasAttribute(Attribute::AttrKind Kind) const
StringRef getStringKind() const
iterator begin(unsigned Slot) const
This is an important class for using LLVM in a threaded context.
bool isStringAttribute() const
IntAttributeImpl(Attribute::AttrKind Kind, uint64_t Val)
unsigned getSlotIndex(unsigned Slot) const
Get the index of the given "slot" in the AttrNodes list.
unsigned getAlignment() const
uint64_t Raw(unsigned Index) const
StringRef getValueAsString() const
bool isIntAttribute() const
bool hasAttribute(Attribute::AttrKind A) const
uint64_t getValueAsInt() const
Attribute::AttrKind getEnumKind() const
static uint64_t getAttrMask(Attribute::AttrKind Val)
AttributeSetNode * getSlotNode(unsigned Slot) const
Retrieve the attribute set node for the given "slot" in the AttrNode list.
const Attribute * iterator
Node - This class is used to maintain the singly linked bucket list in a folding set.
Alignment of parameter (5 bits) stored as log2 of alignment with +1 bias 0 means unaligned (different...
LLVMContext & getContext()
Get the context that created this AttributeSetImpl.
unsigned getStackAlignment() const
uint64_t getValue() const
AttributeImpl(AttrEntryKind KindID)
static void Profile(FoldingSetNodeID &ID, Attribute::AttrKind Kind, uint64_t Val)
bool isEnumAttribute() const
void AddString(StringRef String)
uint64_t getDereferenceableOrNullBytes() const
const ARM::ArchExtKind Kind
static void Profile(FoldingSetNodeID &ID, ArrayRef< std::pair< unsigned, AttributeSetNode * > > Nodes)
unsigned getNumAttributes() const
Return the number of attributes this AttributeSet contains.
Pointer is known to be dereferenceable.
void Profile(FoldingSetNodeID &ID) const
AttributeSetImpl(LLVMContext &C, ArrayRef< std::pair< unsigned, AttributeSetNode * > > Attrs)
void Profile(FoldingSetNodeID &ID) const
StringRef - Represent a constant reference to a string, i.e.
Attribute getAttribute(Attribute::AttrKind Kind) const
static void Profile(FoldingSetNodeID &ID, StringRef Kind, StringRef Values)
Pointer is either null or dereferenceable.
AttrKind
This enumeration lists the attributes that can be associated with parameters, function results...
bool empty() const
empty - Check if the string is empty.