Live interval splitting:
[oota-llvm.git] / include / llvm / ParameterAttributes.h
index 86287e0a3ba5444d836eb6014a9df1215bdc4ccb..5d3ef9aba72ee59bc9aa610af131a3ef67580c9e 100644 (file)
@@ -29,13 +29,18 @@ namespace ParamAttr {
 /// results.
 /// @brief Function parameter attributes.
 enum Attributes {
-  None       = 0,      ///< No attributes have been set
-  ZExt       = 1 << 0, ///< zero extended before/after call
-  SExt       = 1 << 1, ///< sign extended before/after call
-  NoReturn   = 1 << 2, ///< mark the function as not returning
-  InReg      = 1 << 3, ///< force argument to be passed in register
-  StructRet  = 1 << 4, ///< hidden pointer to structure to return
-  NoUnwind   = 1 << 5  ///< Function doesn't unwind stack
+  None       = 0,       ///< No attributes have been set
+  ZExt       = 1 << 0,  ///< Zero extended before/after call
+  SExt       = 1 << 1,  ///< Sign extended before/after call
+  NoReturn   = 1 << 2,  ///< Mark the function as not returning
+  InReg      = 1 << 3,  ///< Force argument to be passed in register
+  StructRet  = 1 << 4,  ///< Hidden pointer to structure to return
+  NoUnwind   = 1 << 5,  ///< Function doesn't unwind stack
+  NoAlias    = 1 << 6,  ///< Considered to not alias after call
+  ByVal      = 1 << 7,  ///< Pass structure by value
+  Nest       = 1 << 8,  ///< Nested function static chain
+  Pure       = 1 << 9,  ///< Function is pure
+  Const      = 1 << 10  ///< Function is const
 };
 
 }
@@ -46,6 +51,13 @@ enum Attributes {
 struct ParamAttrsWithIndex {
   uint16_t attrs; ///< The attributes that are set, |'d together
   uint16_t index; ///< Index of the parameter for which the attributes apply
+  
+  static ParamAttrsWithIndex get(uint16_t idx, uint16_t attrs) {
+    ParamAttrsWithIndex P;
+    P.index = idx;
+    P.attrs = attrs;
+    return P;
+  }
 };
 
 /// @brief A vector of attribute/index pairs.
@@ -161,6 +173,10 @@ class ParamAttrsList : public FoldingSetNode {
       return attrs[attr_index].index;
     }
 
+    uint16_t getParamAttrsAtIndex(unsigned attr_index) const {
+      return attrs[attr_index].attrs;
+    }
+    
     /// Determines how many parameter attributes are set in this ParamAttrsList.
     /// This says nothing about how many parameters the function has. It also
     /// says nothing about the highest parameter index that has attributes.