Home | History | Annotate | Download | only in llvm

Lines Matching refs:Attributes

1 //===-- llvm/Attributes.h - Container for Attributes ------------*- C++ -*-===//
11 // attributes associated with functions and their calls.
25 /// Attributes - A bitset of attributes.
26 typedef unsigned Attributes;
30 /// Function parameters and results can have attributes to indicate how they
32 /// lists the attributes that can be associated with parameters, function
34 /// @brief Function attributes.
36 const Attributes None = 0; ///< No attributes have been set
37 const Attributes ZExt = 1<<0; ///< Zero extended before/after call
38 const Attributes SExt = 1<<1; ///< Sign extended before/after call
39 const Attributes NoReturn = 1<<2; ///< Mark the function as not returning
40 const Attributes InReg = 1<<3; ///< Force argument to be passed in register
41 const Attributes StructRet = 1<<4; ///< Hidden pointer to structure to return
42 const Attributes NoUnwind = 1<<5; ///< Function doesn't unwind stack
43 const Attributes NoAlias = 1<<6; ///< Considered to not alias after call
44 const Attributes ByVal = 1<<7; ///< Pass structure by value
45 const Attributes Nest = 1<<8; ///< Nested function static chain
46 const Attributes ReadNone = 1<<9; ///< Function does not access memory
47 const Attributes ReadOnly = 1<<10; ///< Function only reads from memory
48 const Attributes NoInline = 1<<11; ///< inline=never
49 const Attributes AlwaysInline = 1<<12; ///< inline=always
50 const Attributes OptimizeForSize = 1<<13; ///< opt_size
51 const Attributes StackProtect = 1<<14; ///< Stack protection.
52 const Attributes StackProtectReq = 1<<15; ///< Stack protection required.
53 const Attributes Alignment = 31<<16; ///< Alignment of parameter (5 bits)
56 const Attributes NoCapture = 1<<21; ///< Function creates no aliases of pointer
57 const Attributes NoRedZone = 1<<22; /// disable redzone
58 const Attributes NoImplicitFloat = 1<<23; /// disable implicit floating point
60 const Attributes Naked = 1<<24; ///< Naked function
61 const Attributes InlineHint = 1<<25; ///< source said inlining was
63 const Attributes StackAlignment = 7<<26; ///< Alignment of stack for
68 const Attributes ReturnsTwice = 1<<29; ///< Function can return twice
69 const Attributes UWTable = 1<<30; ///< Function must be in a unwind
71 const Attributes NonLazyBind = 1U<<31; ///< Function is called early and/or
87 /// @brief Attributes that only apply to function parameters.
88 const Attributes ParameterOnly = ByVal | Nest | StructRet | NoCapture;
90 /// @brief Attributes that may be applied to the function itself. These cannot
92 const Attributes FunctionOnly = NoReturn | NoUnwind | ReadNone | ReadOnly |
97 /// @brief Parameter attributes that do not apply to vararg call arguments.
98 const Attributes VarArgsIncompatible = StructRet;
100 /// @brief Attributes that are mutually incompatible.
101 const Attributes MutuallyIncompatible[4] = {
108 /// @brief Which attributes cannot be applied to a type.
109 Attributes typeIncompatible(Type *Ty);
112 /// form used internally in Attributes.
113 inline Attributes constructAlignmentFromInt(unsigned i) {
124 inline unsigned getAlignmentFromAttrs(Attributes A) {
125 Attributes Align = A & Attribute::Alignment;
133 /// the form used internally in Attributes.
134 inline Attributes constructStackAlignmentFromInt(unsigned i) {
146 inline unsigned getStackAlignmentFromAttrs(Attributes A) {
147 Attributes StackAlign = A & Attribute::StackAlignment;
155 /// The set of Attributes set in Attributes is converted to a
159 std::string getAsString(Attributes Attrs);
162 /// This is just a pair of values to associate a set of attributes
165 Attributes Attrs; ///< The attributes that are set, or'd together.
166 unsigned Index; ///< Index of the parameter for which the attributes apply.
167 ///< Index 0 is used for return value attributes.
168 ///< Index ~0U is used for function attributes.
170 static AttributeWithIndex get(unsigned Idx, Attributes Attrs) {
187 /// AttrList - The attributes that we are managing. This can be null
188 /// to represent the empty attributes list.
200 /// get - Return a Attributes list with the specified parameter in it.
214 AttrListPtr addAttr(unsigned Idx, Attributes Attrs) const;
219 AttrListPtr removeAttr(unsigned Idx, Attributes Attrs) const;
224 /// getParamAttributes - The attributes for the specified index are
226 Attributes getParamAttributes(unsigned Idx) const {
231 /// getRetAttributes - The attributes for the ret value are
233 Attributes getRetAttributes() const {
237 /// getFnAttributes - The function attributes are returned.
238 Attributes getFnAttributes() const {
244 bool paramHasAttr(unsigned Idx, Attributes Attr) const {
256 bool hasAttrSomewhere(Attributes Attr) const;
276 // Attributes are stored as a dense set of slots, where there is one
278 // dense set instead of walking the sparse list of attributes.
280 /// isEmpty - Return true if there are no attributes.
292 /// holds a index number plus a set of attributes.
298 /// getAttributes - The attributes for the specified index are
299 /// returned. Attributes for the result are denoted with Idx = 0.
300 Attributes getAttributes(unsigned Idx) const;