[llvm] 7f54009 - Add missing overloads for Function::addRetAttr(s)

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 7 11:52:37 PDT 2021


Author: Arthur Eubanks
Date: 2021-09-07T11:52:22-07:00
New Revision: 7f54009a1fd8c7ea422bd58b45ba5cdc73a3a55e

URL: https://github.com/llvm/llvm-project/commit/7f54009a1fd8c7ea422bd58b45ba5cdc73a3a55e
DIFF: https://github.com/llvm/llvm-project/commit/7f54009a1fd8c7ea422bd58b45ba5cdc73a3a55e.diff

LOG: Add missing overloads for Function::addRetAttr(s)

Added: 
    

Modified: 
    llvm/include/llvm/IR/Function.h
    llvm/lib/IR/Function.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h
index 71876f6c0f1af..97dee357ea2fa 100644
--- a/llvm/include/llvm/IR/Function.h
+++ b/llvm/include/llvm/IR/Function.h
@@ -347,6 +347,12 @@ class LLVM_EXTERNAL_VISIBILITY Function : public GlobalObject,
   /// Add return value attributes to this function.
   void addRetAttr(Attribute::AttrKind Kind);
 
+  /// Add return value attributes to this function.
+  void addRetAttr(Attribute Attr);
+
+  /// Add return value attributes to this function.
+  void addRetAttrs(const AttrBuilder &Attrs);
+
   /// adds the attribute to the list of attributes for the given arg.
   void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind);
 

diff  --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 951d45cb6069a..977cd852a330e 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -553,6 +553,14 @@ void Function::addRetAttr(Attribute::AttrKind Kind) {
   AttributeSets = AttributeSets.addRetAttribute(getContext(), Kind);
 }
 
+void Function::addRetAttr(Attribute Attr) {
+  AttributeSets = AttributeSets.addRetAttribute(getContext(), Attr);
+}
+
+void Function::addRetAttrs(const AttrBuilder &Attrs) {
+  AttributeSets = AttributeSets.addRetAttributes(getContext(), Attrs);
+}
+
 void Function::addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) {
   AttributeSets = AttributeSets.addParamAttribute(getContext(), ArgNo, Kind);
 }


        


More information about the llvm-commits mailing list