16 #ifndef LLVM_ATTRIBUTESIMPL_H
17 #define LLVM_ATTRIBUTESIMPL_H
97 virtual void anchor();
112 virtual void anchor();
120 "Wrong kind for alignment attribute!");
127 virtual void anchor();
148 std::copy(Attrs.
begin(), Attrs.
end(),
149 reinterpret_cast<Attribute *
>(
this + 1));
177 for (
unsigned I = 0, E = AttrList.
size();
I != E; ++
I)
191 typedef std::pair<unsigned, AttributeSetNode*> IndexAttrPair;
195 const IndexAttrPair *getNode(
unsigned Slot)
const {
196 return reinterpret_cast<const IndexAttrPair *
>(
this + 1) + Slot;
205 : Context(C), NumAttrs(Attrs.size()) {
207 if (Attrs.size() >= 2) {
208 for (
const std::pair<unsigned, AttributeSetNode *> *i = Attrs.begin() + 1,
211 assert((i-1)->first <= i->first &&
"Attribute set not ordered!");
216 std::copy(Attrs.begin(), Attrs.end(),
217 reinterpret_cast<IndexAttrPair *
>(
this + 1));
231 return getNode(Slot)->first;
238 return AttributeSet::get(Context, *getNode(Slot));
244 return getNode(Slot)->second;
255 ArrayRef<std::pair<unsigned, AttributeSetNode*> > Nodes) {
256 for (
unsigned i = 0, e = Nodes.size(); i != e; ++i) {
263 uint64_t
Raw(
unsigned Index)
const;
void AddPointer(const void *Ptr)
std::string getAsString(bool InAttrGrp) const
AttributeSet getSlotAttributes(unsigned Slot) const
Retrieve the attributes for the given "slot" in the AttrNode list. Slot is an index into the AttrNode...
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)
ID
LLVM Calling Convention Representation.
EnumAttributeImpl(AttrEntryKind ID, Attribute::AttrKind Kind)
bool operator<(const AttributeImpl &AI) const
Used when sorting the attributes.
EnumAttributeImpl(Attribute::AttrKind Kind)
unsigned getAlignment() const
iterator end(unsigned Slot) const
AlignAttributeImpl(Attribute::AttrKind Kind, unsigned Align)
AttributeSetNode::iterator iterator
size_t size() const
size - Get the array size.
StringRef getKindAsString() const
bool hasAttribute(Attribute::AttrKind Kind) const
StringRef getStringKind() const
iterator begin(unsigned Slot) const
bool isStringAttribute() const
unsigned getSlotIndex(unsigned Slot) const
Get the index of the given "slot" in the AttrNodes list. This index is the index of the return...
unsigned getAlignment() const
uint64_t Raw(unsigned Index) const
StringRef getValueAsString() const
bool hasAttribute(Attribute::AttrKind A) const
uint64_t getValueAsInt() const
Attribute::AttrKind getEnumKind() const
bool isAlignAttribute() 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
#define LLVM_DELETED_FUNCTION
LLVMContext & getContext()
Get the context that created this AttributeSetImpl.
unsigned getStackAlignment() const
AttributeImpl(AttrEntryKind KindID)
static void Profile(FoldingSetNodeID &ID, Attribute::AttrKind Kind, uint64_t Val)
bool isEnumAttribute() const
void AddString(StringRef String)
static void Profile(FoldingSetNodeID &ID, ArrayRef< std::pair< unsigned, AttributeSetNode * > > Nodes)
unsigned getNumAttributes() const
Return the number of attributes this AttributeSet contains.
void Profile(FoldingSetNodeID &ID) const
void Profile(FoldingSetNodeID &ID) const
Attribute getAttribute(Attribute::AttrKind Kind) const
static void Profile(FoldingSetNodeID &ID, StringRef Kind, StringRef Values)
bool empty() const
empty - Check if the string is empty.