Fix miscompile. Add back the use of the ArrayRef version of the ::get method.
authorBill Wendling <isanbard@gmail.com>
Sun, 27 Jan 2013 10:28:39 +0000 (10:28 +0000)
committerBill Wendling <isanbard@gmail.com>
Sun, 27 Jan 2013 10:28:39 +0000 (10:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173613 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Attributes.h
lib/IR/Attributes.cpp

index e8762942b1bea1fd7cbd998ebef4b9cd246a4cf8..46ba59630726ca7aac2df31ce2330564375bba86 100644 (file)
@@ -109,7 +109,7 @@ public:
 
   /// \brief Return a uniquified Attribute object. This takes the uniquified
   /// value from the Builder and wraps it in the Attribute class.
-  static Attribute get(LLVMContext &Context, AttrKind Kind);
+  static Attribute get(LLVMContext &Context, ArrayRef<AttrKind> Kinds);
   static Attribute get(LLVMContext &Context, AttrBuilder &B);
 
   /// \brief Return true if the attribute is present.
index 937514a0a4a8af3ee29759ec6d2108bda1fc5053..8ec192b813c7d00b40493422281e289483ad014f 100644 (file)
@@ -30,8 +30,11 @@ using namespace llvm;
 // Attribute Implementation
 //===----------------------------------------------------------------------===//
 
-Attribute Attribute::get(LLVMContext &Context, AttrKind Kind) {
-  AttrBuilder B(Kind);
+Attribute Attribute::get(LLVMContext &Context, ArrayRef<AttrKind> Kinds) {
+  AttrBuilder B;
+  for (ArrayRef<AttrKind>::iterator I = Kinds.begin(), E = Kinds.end();
+       I != E; ++I)
+    B.addAttribute(*I);
   return Attribute::get(Context, B);
 }