Use the appropriate Attributes::get method to create an Attributes object.
authorBill Wendling <isanbard@gmail.com>
Tue, 16 Oct 2012 18:06:06 +0000 (18:06 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 16 Oct 2012 18:06:06 +0000 (18:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166035 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Attributes.h

index a28aa183473ad1fe910c5e67e68eb26f127ef5cb..4222a62251b084f3655925b6ad60710f4bb3f244 100644 (file)
@@ -290,15 +290,9 @@ struct AttributeWithIndex {
 
   static AttributeWithIndex get(LLVMContext &C, unsigned Idx,
                                 ArrayRef<Attributes::AttrVal> Attrs) {
 
   static AttributeWithIndex get(LLVMContext &C, unsigned Idx,
                                 ArrayRef<Attributes::AttrVal> Attrs) {
-    AttrBuilder B;
-
-    for (ArrayRef<Attributes::AttrVal>::iterator I = Attrs.begin(),
-           E = Attrs.end(); I != E; ++I)
-      B.addAttribute(*I);
-
     AttributeWithIndex P;
     P.Index = Idx;
     AttributeWithIndex P;
     P.Index = Idx;
-    P.Attrs = Attributes::get(C, B);
+    P.Attrs = Attributes::get(C, Attrs);
     return P;
   }
   static AttributeWithIndex get(unsigned Idx, Attributes Attrs) {
     return P;
   }
   static AttributeWithIndex get(unsigned Idx, Attributes Attrs) {