[llvm] r302655 - Use clang++-3.5 compatible initializer_list constructor

Serge Guelton via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 06:23:47 PDT 2017


Author: serge_sans_paille
Date: Wed May 10 08:23:47 2017
New Revision: 302655

URL: http://llvm.org/viewvc/llvm-project?rev=302655&view=rev
Log:
Use clang++-3.5 compatible initializer_list constructor

Otherwise, a warning is issued.

Modified:
    llvm/trunk/include/llvm/IR/Constants.h
    llvm/trunk/include/llvm/IR/DerivedTypes.h

Modified: llvm/trunk/include/llvm/IR/Constants.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Constants.h?rev=302655&r1=302654&r2=302655&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Constants.h (original)
+++ llvm/trunk/include/llvm/IR/Constants.h Wed May 10 08:23:47 2017
@@ -458,7 +458,7 @@ public:
   static typename std::enable_if<are_base_of<Constant, Csts...>::value,
                                  Constant *>::type
   get(StructType *T, Csts *... Vs) {
-    SmallVector<Constant *, 8> Values{{Vs...}};
+    SmallVector<Constant *, 8> Values({Vs...});
     return get(T, Values);
   }
 

Modified: llvm/trunk/include/llvm/IR/DerivedTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DerivedTypes.h?rev=302655&r1=302654&r2=302655&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DerivedTypes.h (original)
+++ llvm/trunk/include/llvm/IR/DerivedTypes.h Wed May 10 08:23:47 2017
@@ -234,7 +234,7 @@ public:
                                  StructType *>::type
   create(StringRef Name, Type *elt1, Tys *... elts) {
     assert(elt1 && "Cannot create a struct type with no elements with this");
-    SmallVector<llvm::Type *, 8> StructFields{{elt1, elts...}};
+    SmallVector<llvm::Type *, 8> StructFields({elt1, elts...});
     return create(StructFields, Name);
   }
 
@@ -254,7 +254,7 @@ public:
   get(Type *elt1, Tys *... elts) {
     assert(elt1 && "Cannot create a struct type with no elements with this");
     LLVMContext &Ctx = elt1->getContext();
-    SmallVector<llvm::Type *, 8> StructFields{{elt1, elts...}};
+    SmallVector<llvm::Type *, 8> StructFields({elt1, elts...});
     return llvm::StructType::get(Ctx, StructFields);
   }
 
@@ -290,7 +290,7 @@ public:
   typename std::enable_if<are_base_of<Type, Tys...>::value, void>::type
   setBody(Type *elt1, Tys *... elts) {
     assert(elt1 && "Cannot create a struct type with no elements with this");
-    SmallVector<llvm::Type *, 8> StructFields{{elt1, elts...}};
+    SmallVector<llvm::Type *, 8> StructFields({elt1, elts...});
     setBody(StructFields);
   }
 




More information about the llvm-commits mailing list