Add some additonal attribute helper functions. Test will be on follow
[oota-llvm.git] / include / llvm / IR / Function.h
index a7dea5ca3d7677e67ba324731048e5e24603a42b..f97929f658548d6b5a059804e1854f20ee65b660 100644 (file)
@@ -181,6 +181,14 @@ public:
                                              AttributeSet::FunctionIndex, N));
   }
 
+  /// addFnAttr - Add function attributes to this function.
+  ///
+  void addFnAttr(StringRef Kind) {
+    setAttributes(
+      AttributeSets.addAttribute(getContext(),
+                                 AttributeSet::FunctionIndex, Kind));
+  }
+
   /// \brief Return true if the function has the attribute.
   bool hasFnAttribute(Attribute::AttrKind Kind) const {
     return AttributeSets.hasAttribute(AttributeSet::FunctionIndex, Kind);