#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/FoldingSet.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
#include <bitset>
#include <cassert>
///< stored as log2 of alignment with +1 bias
///< 0 means unaligned (different from align(1))
AlwaysInline, ///< inline=always
+ Builtin, ///< Callee is recognized as a builtin, despite
+ ///< nobuiltin attribute on its declaration.
ByVal, ///< Pass structure by value
+ Cold, ///< Marks function as being in a cold path.
InlineHint, ///< Source said inlining was desirable
InReg, ///< Force argument to be passed in register
MinSize, ///< Function must be optimized for size first
NoReturn, ///< Mark the function as not returning
NoUnwind, ///< Function doesn't unwind stack
OptimizeForSize, ///< opt_size
+ OptimizeNone, ///< Function must not be optimized.
ReadNone, ///< Function does not access memory
ReadOnly, ///< Function only reads from memory
+ Returned, ///< Return value is always equal to this argument
ReturnsTwice, ///< Function can return twice
SExt, ///< Sign extended before/after call
StackAlignment, ///< Alignment of stack for function (3 bits)
/// index `1'.
class AttributeSet {
public:
- enum AttrIndex {
+ enum AttrIndex LLVM_ENUM_INT_TYPE(unsigned) {
ReturnIndex = 0U,
FunctionIndex = ~0U
};
/// attribute sets are immutable, this returns a new set.
AttributeSet addAttribute(LLVMContext &C, unsigned Index,
StringRef Kind) const;
+ AttributeSet addAttribute(LLVMContext &C, unsigned Index,
+ StringRef Kind, StringRef Value) const;
/// \brief Add attributes to the attribute set at the given index. Since
/// attribute sets are immutable, this returns a new set.
unsigned getStackAlignment(unsigned Index) const;
/// \brief Return the attributes at the index as a string.
- std::string getAsString(unsigned Index, bool TargetIndependent = false,
- bool InAttrGrp = false) const;
+ std::string getAsString(unsigned Index, bool InAttrGrp = false) const;
typedef ArrayRef<Attribute>::iterator iterator;
unsigned getNumSlots() const;
/// \brief Return the index for the given slot.
- uint64_t getSlotIndex(unsigned Slot) const;
+ unsigned getSlotIndex(unsigned Slot) const;
/// \brief Return the attributes at the given slot.
AttributeSet getSlotAttributes(unsigned Slot) const;