Remove the WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS macro
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Feb 2014 07:49:15 +0000 (07:49 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Feb 2014 07:49:15 +0000 (07:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=128267

Reviewed by Andreas Kling.

Source/WTF:

Remove the WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS macro that was manually defined for compilers
that support the C++11 initializer lists. The feature is well supported in Clang, MSVC and also GCC. It
was actually already used unguarded in HashSet.

* wtf/Compiler.h:
* wtf/HashMap.h:
(WTF::HashMap::HashMap):
* wtf/Vector.h:
(WTF::Vector::Vector):

Tools:

Remove the COMPILER_SUPPORTS(CXX_GENERALIZED_INITIALIZERS) as the underlying macro is also
being removed since the feature is supported by all the compilers the project approves.

* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/Vector.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163519 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/Compiler.h
Source/WTF/wtf/HashMap.h
Source/WTF/wtf/Vector.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp
Tools/TestWebKitAPI/Tests/WTF/Vector.cpp

index 128d3ec..66d1805 100644 (file)
@@ -1,3 +1,20 @@
+2014-02-05  Zan Dobersek  <zdobersek@igalia.com>
+
+        Remove the WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS macro
+        https://bugs.webkit.org/show_bug.cgi?id=128267
+
+        Reviewed by Andreas Kling.
+
+        Remove the WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS macro that was manually defined for compilers
+        that support the C++11 initializer lists. The feature is well supported in Clang, MSVC and also GCC. It
+        was actually already used unguarded in HashSet.
+
+        * wtf/Compiler.h:
+        * wtf/HashMap.h:
+        (WTF::HashMap::HashMap):
+        * wtf/Vector.h:
+        (WTF::Vector::Vector):
+
 2014-02-05  Andreas Kling  <akling@apple.com>
 
         Remove ENABLE(DIRECTORY_UPLOAD).
index a65daba..2e2cfba 100644 (file)
@@ -44,7 +44,6 @@
 #define WTF_COMPILER_SUPPORTS_BLOCKS __has_feature(blocks)
 #define WTF_COMPILER_SUPPORTS_C_STATIC_ASSERT __has_feature(c_static_assert)
 #define WTF_COMPILER_SUPPORTS_CXX_CONSTEXPR __has_feature(cxx_constexpr)
-#define WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS __has_feature(cxx_generalized_initializers)
 #define WTF_COMPILER_SUPPORTS_CXX_REFERENCE_QUALIFIED_FUNCTIONS __has_feature(cxx_reference_qualified_functions)
 #define WTF_COMPILER_SUPPORTS_CXX_USER_LITERALS __has_feature(cxx_user_literals)
 #define WTF_COMPILER_SUPPORTS_FALLTHROUGH_WARNINGS __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
 
 #if defined(_MSC_VER)
 #define WTF_COMPILER_MSVC 1
-#define WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS 1
 #endif
 
 #if defined(_MSC_VER) && _MSC_VER < 1800
index dbd17b4..be30014 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef WTF_HashMap_h
 #define WTF_HashMap_h
 
+#include <initializer_list>
 #include <wtf/HashTable.h>
 #include <wtf/IteratorRange.h>
 
@@ -72,13 +73,11 @@ public:
     {
     }
 
-#if COMPILER_SUPPORTS(CXX_GENERALIZED_INITIALIZERS)
     HashMap(std::initializer_list<KeyValuePairType> initializerList)
     {
         for (const auto& keyValuePair : initializerList)
             add(keyValuePair.key, keyValuePair.value);
     }
-#endif
 
     void swap(HashMap&);
 
index 954f612..964fe55 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef WTF_Vector_h
 #define WTF_Vector_h
 
+#include <initializer_list>
 #include <limits>
 #include <string.h>
 #include <type_traits>
@@ -548,14 +549,12 @@ public:
             TypeOperations::uninitializedFill(begin(), end(), val);
     }
 
-#if COMPILER_SUPPORTS(CXX_GENERALIZED_INITIALIZERS)
     Vector(std::initializer_list<T> initializerList)
     {
         reserveInitialCapacity(initializerList.size());
         for (const auto& element : initializerList)
             uncheckedAppend(element);
     }
-#endif
 
     ~Vector()
     {
index 5ecf3af..29f4bcd 100644 (file)
@@ -1,3 +1,18 @@
+2014-02-05  Zan Dobersek  <zdobersek@igalia.com>
+
+        Remove the WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS macro
+        https://bugs.webkit.org/show_bug.cgi?id=128267
+
+        Reviewed by Andreas Kling.
+
+        Remove the COMPILER_SUPPORTS(CXX_GENERALIZED_INITIALIZERS) as the underlying macro is also
+        being removed since the feature is supported by all the compilers the project approves.
+
+        * TestWebKitAPI/Tests/WTF/HashMap.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WTF/Vector.cpp:
+        (TestWebKitAPI::TEST):
+
 2014-02-05  Jinwoo Song  <jinwoo7.song@samsung.com>
 
         [EFL][WK2] Remove legacy behavior mode in MiniBrowser
index 4716876..d03fb95 100644 (file)
@@ -130,7 +130,6 @@ TEST(WTF_HashMap, MoveOnlyKeys)
     ASSERT_TRUE(moveOnlyKeys.isEmpty());
 }
 
-#if COMPILER_SUPPORTS(CXX_GENERALIZED_INITIALIZERS)
 TEST(WTF_HashMap, InitializerList)
 {
     HashMap<unsigned, std::string> map = {
@@ -148,6 +147,5 @@ TEST(WTF_HashMap, InitializerList)
     EXPECT_EQ("four", map.get(4));
     EXPECT_EQ(std::string(), map.get(5));
 }
-#endif
 
 } // namespace TestWebKitAPI
index 9b628f0..2278784 100644 (file)
@@ -83,7 +83,6 @@ TEST(WTF_Vector, AppendLast)
         vector.append(const_cast<const unsigned&>(vector.last()));
 }
 
-#if COMPILER_SUPPORTS(CXX_GENERALIZED_INITIALIZERS)
 TEST(WTF_Vector, InitializerList)
 {
     Vector<int> vector = { 1, 2, 3, 4 };
@@ -94,7 +93,6 @@ TEST(WTF_Vector, InitializerList)
     EXPECT_EQ(3, vector[2]);
     EXPECT_EQ(4, vector[3]);
 }
-#endif
 
 TEST(WTF_Vector, Reverse)
 {