Add the IR attribute 'sspstrong'.
[oota-llvm.git] / include / llvm / IR / Function.h
index 1762b2c10acb1435e6a516b37151854df93df3e6..fe27d9b75d4b4304c0eaa8f858d89e0c5b6b52b8 100644 (file)
@@ -15,8 +15,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_FUNCTION_H
-#define LLVM_FUNCTION_H
+#ifndef LLVM_IR_FUNCTION_H
+#define LLVM_IR_FUNCTION_H
 
 #include "llvm/IR/Argument.h"
 #include "llvm/IR/Attributes.h"
@@ -171,15 +171,8 @@ public:
   /// addFnAttr - Add function attributes to this function.
   ///
   void addFnAttr(Attribute::AttrKind N) {
-    // Function Attribute are stored at ~0 index
-    addAttribute(AttributeSet::FunctionIndex, Attribute::get(getContext(), N));
-  }
-
-  /// removeFnAttr - Remove function attributes from this function.
-  ///
-  void removeFnAttr(Attribute N) {
-    // Function Attribute are stored at ~0 index
-    removeAttribute(~0U, N);
+    setAttributes(AttributeList.addAttribute(getContext(),
+                                             AttributeSet::FunctionIndex, N));
   }
 
   /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm
@@ -189,11 +182,14 @@ public:
   void setGC(const char *Str);
   void clearGC();
 
-  /// addAttribute - adds the attribute to the list of attributes.
-  void addAttribute(unsigned i, Attribute attr);
+  /// @brief adds the attribute to the list of attributes.
+  void addAttribute(unsigned i, Attribute::AttrKind attr);
+
+  /// @brief adds the attributes to the list of attributes.
+  void addAttributes(unsigned i, AttributeSet attrs);
 
-  /// removeAttribute - removes the attribute from the list of attributes.
-  void removeAttribute(unsigned i, Attribute attr);
+  /// @brief removes the attributes from the list of attributes.
+  void removeAttributes(unsigned i, AttributeSet attr);
 
   /// @brief Extract the alignment for a call or parameter (0=unknown).
   unsigned getParamAlignment(unsigned i) const {
@@ -273,7 +269,7 @@ public:
     return AttributeList.hasAttribute(n, Attribute::NoAlias);
   }
   void setDoesNotAlias(unsigned n) {
-    addAttribute(n, Attribute::get(getContext(), Attribute::NoAlias));
+    addAttribute(n, Attribute::NoAlias);
   }
 
   /// @brief Determine if the parameter can be captured.
@@ -282,7 +278,7 @@ public:
     return AttributeList.hasAttribute(n, Attribute::NoCapture);
   }
   void setDoesNotCapture(unsigned n) {
-    addAttribute(n, Attribute::get(getContext(), Attribute::NoCapture));
+    addAttribute(n, Attribute::NoCapture);
   }
 
   /// copyAttributesFrom - copy all additional attributes (those not needed to