[llvm-commits] [llvm] r173613 - Fix miscompile. Add back the use of the ArrayRef version of the ::get method.

Bill Wendling isanbard at gmail.com
Sun Jan 27 02:28:39 PST 2013


Author: void
Date: Sun Jan 27 04:28:39 2013
New Revision: 173613

URL: http://llvm.org/viewvc/llvm-project?rev=173613&view=rev
Log:
Fix miscompile. Add back the use of the ArrayRef version of the ::get method.

Modified:
    llvm/trunk/include/llvm/IR/Attributes.h
    llvm/trunk/lib/IR/Attributes.cpp

Modified: llvm/trunk/include/llvm/IR/Attributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Attributes.h?rev=173613&r1=173612&r2=173613&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Attributes.h (original)
+++ llvm/trunk/include/llvm/IR/Attributes.h Sun Jan 27 04:28:39 2013
@@ -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.

Modified: llvm/trunk/lib/IR/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=173613&r1=173612&r2=173613&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Attributes.cpp (original)
+++ llvm/trunk/lib/IR/Attributes.cpp Sun Jan 27 04:28:39 2013
@@ -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);
 }
 





More information about the llvm-commits mailing list