16 #ifndef LLVM_IR_ATTRIBUTES_H
17 #define LLVM_IR_ATTRIBUTES_H
32 class AttributeSetImpl;
33 class AttributeSetNode;
35 template<
typename T>
struct DenseMapInfo;
180 std::string
getAsString(
bool InAttrGrp =
false)
const;
317 std::string
getAsString(
unsigned Index,
bool InAttrGrp =
false)
const;
326 return pImpl == RHS.pImpl;
329 return pImpl != RHS.pImpl;
337 uint64_t
Raw(
unsigned Index)
const;
368 uintptr_t Val =
static_cast<uintptr_t
>(-1);
369 Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable;
370 return AttributeSet(reinterpret_cast<AttributeSetImpl*>(Val));
373 uintptr_t Val =
static_cast<uintptr_t
>(-2);
374 Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable;
375 return AttributeSet(reinterpret_cast<AttributeSetImpl*>(Val));
378 return (
unsigned((uintptr_t)AS.pImpl) >> 4) ^
379 (
unsigned((uintptr_t)AS.pImpl) >> 9);
391 std::bitset<Attribute::EndAttrKinds> Attrs;
392 std::map<std::string, std::string> TargetDepAttrs;
394 uint64_t StackAlignment;
398 : Attrs(0), Alignment(0), StackAlignment(0) {
407 TargetDepAttrs(B.TargetDepAttrs.
begin(), B.TargetDepAttrs.
end()),
408 Alignment(B.Alignment), StackAlignment(B.StackAlignment) {}
469 bool empty()
const {
return Attrs.none(); }
472 typedef std::pair<std::string, std::string>
td_type;
482 bool td_empty()
const {
return TargetDepAttrs.empty(); }
486 return !(*
this == B);
495 namespace AttributeFuncs {
void AddPointer(const void *Ptr)
COFF::RelocationTypeX86 Type
const_iterator end(StringRef path)
Get end iterator over path.
void * getRawPointer() const
Return a raw pointer that uniquely identifies this attribute list.
static AttributeSet getEmptyKey()
AttributeSet getParamAttributes(unsigned Index) const
The attributes for the specified index are returned.
unsigned getStackAlignment(unsigned Index) const
Get the stack alignment.
Sign extended before/after call.
std::string getAsString(unsigned Index, bool InAttrGrp=false) const
Return the attributes at the index as a string.
enum AttrIndex LLVM_ENUM_INT_TYPE(unsigned)
static Attribute getWithAlignment(LLVMContext &Context, uint64_t Align)
Return a uniquified Attribute object that has the specific alignment set.
Force argument to be passed in register.
Nested function static chain.
static unsigned getHashValue(AttributeSet AS)
uint64_t getAlignment() const
Retrieve the alignment attribute, if it exists.
uint64_t getValueAsInt() const
Return the attribute's value as an integer. This requires that the attribute be an alignment attribut...
Source said inlining was desirable.
iterator begin(unsigned Slot) const
const_iterator begin(StringRef path)
Get begin iterator over path.
unsigned getParamAlignment(unsigned Index) const
Return the alignment for the specified function parameter.
unsigned getAlignment() const
Returns the alignment field of an attribute as a byte alignment value.
AttrBuilder & addAttribute(Attribute::AttrKind Val)
Add an attribute to the builder.
bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return true if the attribute exists at the given index.
bool hasAlignmentAttr() const
Return true if the builder has an alignment attribute.
bool contains(Attribute::AttrKind A) const
Return true if the builder has the specified attribute.
bool hasAttribute(AttrKind Val) const
Return true if the attribute is present.
AttrBuilder & addRawValue(uint64_t Val)
Add the raw value to the internal representation.
LoopInfoBase< BlockT, LoopT > * LI
AttributeSet getRetAttributes() const
The attributes for the ret value are returned.
StringRef getKindAsString() const
Return the attribute's kind as a string. This requires the attribute to be a string attribute...
AttributeSet removeAttribute(LLVMContext &C, unsigned Index, Attribute::AttrKind Attr) const
Remove the specified attribute at the specified index from this attribute list. Since attribute lists...
std::string getAsString(bool InAttrGrp=false) const
The Attribute is converted to a string of equivalent mnemonic. This is, presumably, for writing out the mnemonics for the assembly writer.
No attributes have been set.
Function must be in a unwind table.
ID
LLVM Calling Convention Representation.
AttributeSet typeIncompatible(Type *Ty, uint64_t Index)
Which attributes cannot be applied to a type.
Function does not access memory.
Hidden pointer to structure to return.
Function creates no aliases of pointer.
td_const_iterator td_begin() const
std::map< std::string, std::string >::iterator td_iterator
static AttributeSet getTombstoneKey()
unsigned getStackAlignment() const
Returns the stack alignment field of an attribute as a byte alignment value.
Considered to not alias after call.
static Attribute getWithStackAlignment(LLVMContext &Context, uint64_t Align)
bool isAlignAttribute() const
Return true if the attribute is an alignment attribute.
std::pair< std::string, std::string > td_type
unsigned getNumSlots() const
Return the number of slots used in this attribute list. This is the number of arguments that have an ...
bool operator==(const AttrBuilder &B)
AttributeSet getSlotAttributes(unsigned Slot) const
Return the attributes at the given slot.
bool operator!=(const AttrBuilder &B)
Return value is always equal to this argument.
Zero extended before/after call.
Function doesn't unwind stack.
bool isEnumAttribute() const
Return true if the attribute is an Attribute::AttrKind type.
bool operator==(Attribute A) const
Equality and non-equality operators.
Marks function as being in a cold path.
Sentinal value useful for loops.
Mark the function as not returning.
Call cannot be duplicated.
LLVMContext & getContext() const
Retrieve the LLVM context.
AttrBuilder(const AttrBuilder &B)
AttrBuilder & removeAttribute(Attribute::AttrKind Val)
Remove an attribute from the builder.
Attribute::AttrKind getKindAsEnum() const
Return the attribute's kind as an enum (Attribute::AttrKind). This requires the attribute to be an en...
iterator end(unsigned Slot) const
void Profile(FoldingSetNodeID &ID) const
bool empty() const
Return true if the builder contains no target-independent attributes.
AttrBuilder(const Attribute &A)
AttributeSet removeAttributes(LLVMContext &C, unsigned Index, AttributeSet Attrs) const
Remove the specified attributes at the specified index from this attribute list. Since attribute list...
Function must not be optimized.
Function only reads from memory.
std::map< std::string, std::string >::const_iterator td_const_iterator
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(DefaultAlign), cl::values(clEnumValN(DefaultAlign,"arm-default-align","Generate unaligned accesses only on hardware/OS ""combinations that are known to support them"), clEnumValN(StrictAlign,"arm-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"arm-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
bool operator<(Attribute A) const
Less-than operator. Useful for sorting the attributes list.
bool operator==(const AttributeSet &RHS) const
operator==/!= - Provide equality predicates.
AttributeSet addAttribute(LLVMContext &C, unsigned Index, Attribute::AttrKind Attr) const
Add an attribute to the attribute set at the given index. Since attribute sets are immutable...
unsigned getSlotIndex(unsigned Slot) const
Return the index for the given slot.
bool hasAttrSomewhere(Attribute::AttrKind Attr) const
Return true if the specified attribute is set for at least one parameter or for the return value...
bool hasAttributes(unsigned Index) const
Return true if attribute exists at the given index.
Callee isn't recognized as a builtin.
AttrBuilder(uint64_t Val)
ArrayRef< Attribute >::iterator iterator
bool isStringAttribute() const
Return true if the attribute is a string (target-dependent) attribute.
AttributeSet getAttributes(LLVMContext &C, ID id)
AttrBuilder & removeAttributes(AttributeSet A, uint64_t Index)
Remove the attributes from the builder.
Attribute getAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return the attribute object that exists at the given index.
AttrBuilder & merge(const AttrBuilder &B)
Add the attributes from the builder.
StringRef getValueAsString() const
Return the attribute's value as a string. This requires the attribute to be a string attribute...
Function can return twice.
LLVM Value Representation.
uint64_t Raw(unsigned Index) const
bool hasAttributes() const
Return true if the builder has IR-level attributes.
Disable implicit floating point insts.
AttrBuilder & addStackAlignmentAttr(unsigned Align)
This turns an int stack alignment (which must be a power of 2) into the form used internally in Attri...
AttrBuilder & addAlignmentAttr(unsigned Align)
This turns an int alignment (which must be a power of 2) into the form used internally in Attribute...
bool operator!=(Attribute A) const
static bool isEqual(AttributeSet LHS, AttributeSet RHS)
AttributeSet addAttributes(LLVMContext &C, unsigned Index, AttributeSet Attrs) const
Add attributes to the attribute set at the given index. Since attribute sets are immutable, this returns a new set.
Stack protection required.
td_const_iterator td_end() const
bool isEmpty() const
Return true if there are no attributes.
uint64_t getStackAlignment() const
Retrieve the stack alignment attribute, if it exists.
AttributeSet getFnAttributes() const
The function attributes are returned.
bool operator!=(const AttributeSet &RHS) const
Function must be optimized for size first.