Remove addRetAttributes and addFnAttributes, which aren't useful abstractions.
authorBill Wendling <isanbard@gmail.com>
Wed, 30 Jan 2013 23:40:31 +0000 (23:40 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 30 Jan 2013 23:40:31 +0000 (23:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173992 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Attributes.h
lib/IR/Core.cpp
lib/Transforms/IPO/PruneEH.cpp
lib/Transforms/Utils/CloneFunction.cpp

index 5cad4c9e496cab57629e6fb7bae774ead752fb34..1b8195ff0522086d0ede98ceaf2226139720d08f 100644 (file)
@@ -230,18 +230,6 @@ public:
   AttributeSet addAttributes(LLVMContext &C, unsigned Idx,
                              AttributeSet Attrs) const;
 
-  /// \brief Add return attributes to this attribute set. Since attribute sets
-  /// are immutable, this returns a new set.
-  AttributeSet addRetAttributes(LLVMContext &C, AttributeSet Attrs) const {
-    return addAttributes(C, ReturnIndex, Attrs);
-  }
-
-  /// \brief Add function attributes to this attribute set. Since attribute sets
-  /// are immutable, this returns a new set.
-  AttributeSet addFnAttributes(LLVMContext &C, AttributeSet Attrs) const {
-    return addAttributes(C, FunctionIndex, Attrs);
-  }
-
   /// \brief Remove the specified attribute at the specified index from this
   /// attribute list. Since attribute lists are immutable, this returns the new
   /// list.
index 1e3258f6aa1883f7bde040a6b7b44c52ce20dea4..aaf661f0825a19676222ba6686ddd547a7b407d7 100644 (file)
@@ -1383,9 +1383,9 @@ void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) {
   const AttributeSet PAL = Func->getAttributes();
   AttrBuilder B(PA);
   const AttributeSet PALnew =
-    PAL.addFnAttributes(Func->getContext(),
-                        AttributeSet::get(Func->getContext(),
-                                          AttributeSet::FunctionIndex, B));
+    PAL.addAttributes(Func->getContext(), AttributeSet::FunctionIndex,
+                      AttributeSet::get(Func->getContext(),
+                                        AttributeSet::FunctionIndex, B));
   Func->setAttributes(PALnew);
 }
 
index 98c2602dde644335106d372cb489c3360b81afdc..73d9323195bbe4422484c21ae4f3ae75e23f7618 100644 (file)
@@ -147,10 +147,10 @@ bool PruneEH::runOnSCC(CallGraphSCC &SCC) {
       Function *F = (*I)->getFunction();
       const AttributeSet &PAL = F->getAttributes();
       const AttributeSet &NPAL =
-        PAL.addFnAttributes(F->getContext(),
-                            AttributeSet::get(F->getContext(),
-                                              AttributeSet::FunctionIndex,
-                                              NewAttributes));
+        PAL.addAttributes(F->getContext(), AttributeSet::FunctionIndex,
+                          AttributeSet::get(F->getContext(),
+                                            AttributeSet::FunctionIndex,
+                                            NewAttributes));
       if (PAL != NPAL) {
         MadeChange = true;
         F->setAttributes(NPAL);
index 12311c39a0e7114d4c6d2224112beb0bb3588fe9..a309bce5448d081048c46c26258ed4183a2f8e7f 100644 (file)
@@ -98,11 +98,13 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
         Anew->addAttr(OldFunc->getAttributes()
                        .getParamAttributes(I->getArgNo() + 1));
     NewFunc->setAttributes(NewFunc->getAttributes()
-                           .addRetAttributes(NewFunc->getContext(),
-                                             OldFunc->getAttributes()));
+                           .addAttributes(NewFunc->getContext(),
+                                          AttributeSet::ReturnIndex,
+                                          OldFunc->getAttributes()));
     NewFunc->setAttributes(NewFunc->getAttributes()
-                           .addFnAttributes(NewFunc->getContext(),
-                                            OldFunc->getAttributes()));
+                           .addAttributes(NewFunc->getContext(),
+                                          AttributeSet::FunctionIndex,
+                                          OldFunc->getAttributes()));
 
   }