Attributes Rewrite

Convert the uses of the Attributes class over to the new format. The
Attributes::get method call now takes an LLVM context so that the attributes
object can be uniquified and stored.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165918 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index e8d99e2..15db9fd 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -990,7 +990,8 @@
       SRETAttrs.addAttribute(llvm::Attributes::InReg);
     PAL.push_back(llvm::
                   AttributeWithIndex::get(Index,
-                                          llvm::Attributes::get(SRETAttrs)));
+                                         llvm::Attributes::get(getLLVMContext(),
+                                                               SRETAttrs)));
 
     ++Index;
     // sret disables readnone and readonly
@@ -1006,7 +1007,8 @@
   if (RetAttrs.hasAttributes())
     PAL.push_back(llvm::
                   AttributeWithIndex::get(0,
-                                          llvm::Attributes::get(RetAttrs)));
+                                         llvm::Attributes::get(getLLVMContext(),
+                                                               RetAttrs)));
 
   for (CGFunctionInfo::const_arg_iterator it = FI.arg_begin(),
          ie = FI.arg_end(); it != ie; ++it) {
@@ -1039,7 +1041,8 @@
         if (Attrs.hasAttributes())
           for (unsigned I = 0; I < Extra; ++I)
             PAL.push_back(llvm::AttributeWithIndex::get(Index + I,
-                                                 llvm::Attributes::get(Attrs)));
+                                         llvm::Attributes::get(getLLVMContext(),
+                                                               Attrs)));
         Index += Extra;
       }
       break;
@@ -1072,12 +1075,14 @@
 
     if (Attrs.hasAttributes())
       PAL.push_back(llvm::AttributeWithIndex::get(Index,
-                                                 llvm::Attributes::get(Attrs)));
+                                         llvm::Attributes::get(getLLVMContext(),
+                                                               Attrs)));
     ++Index;
   }
   if (FuncAttrs.hasAttributes())
     PAL.push_back(llvm::AttributeWithIndex::get(~0,
-                                             llvm::Attributes::get(FuncAttrs)));
+                                         llvm::Attributes::get(getLLVMContext(),
+                                                               FuncAttrs)));
 }
 
 /// An argument came in as a promoted argument; demote it back to its
@@ -1127,7 +1132,7 @@
     AI->setName("agg.result");
     llvm::Attributes::Builder B;
     B.addAttribute(llvm::Attributes::NoAlias);
-    AI->addAttr(llvm::Attributes::get(B));
+    AI->addAttr(llvm::Attributes::get(getLLVMContext(), B));
     ++AI;
   }
 
@@ -1199,7 +1204,7 @@
         if (Arg->getType().isRestrictQualified()) {
           llvm::Attributes::Builder B;
           B.addAttribute(llvm::Attributes::NoAlias);
-          AI->addAttr(llvm::Attributes::get(B));
+          AI->addAttr(llvm::Attributes::get(getLLVMContext(), B));
         }
 
         // Ensure the argument is the correct type.