- Revision
- 163519
- Author
- [email protected]
- Date
- 2014-02-05 23:49:15 -0800 (Wed, 05 Feb 2014)
Log Message
Remove the WTF_COMPILER_SUPPORTS_CXX_GENERALIZED_INITIALIZERS macro
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):
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (163518 => 163519)
--- trunk/Source/WTF/ChangeLog 2014-02-06 07:24:27 UTC (rev 163518)
+++ trunk/Source/WTF/ChangeLog 2014-02-06 07:49:15 UTC (rev 163519)
@@ -1,3 +1,20 @@
+2014-02-05 Zan Dobersek <[email protected]>
+
+ 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 <[email protected]>
Remove ENABLE(DIRECTORY_UPLOAD).
Modified: trunk/Source/WTF/wtf/Compiler.h (163518 => 163519)
--- trunk/Source/WTF/wtf/Compiler.h 2014-02-06 07:24:27 UTC (rev 163518)
+++ trunk/Source/WTF/wtf/Compiler.h 2014-02-06 07:49:15 UTC (rev 163519)
@@ -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")
@@ -106,7 +105,6 @@
#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
Modified: trunk/Source/WTF/wtf/HashMap.h (163518 => 163519)
--- trunk/Source/WTF/wtf/HashMap.h 2014-02-06 07:24:27 UTC (rev 163518)
+++ trunk/Source/WTF/wtf/HashMap.h 2014-02-06 07:49:15 UTC (rev 163519)
@@ -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 @@
{
}
-#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&);
Modified: trunk/Source/WTF/wtf/Vector.h (163518 => 163519)
--- trunk/Source/WTF/wtf/Vector.h 2014-02-06 07:24:27 UTC (rev 163518)
+++ trunk/Source/WTF/wtf/Vector.h 2014-02-06 07:49:15 UTC (rev 163519)
@@ -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 @@
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()
{
Modified: trunk/Tools/ChangeLog (163518 => 163519)
--- trunk/Tools/ChangeLog 2014-02-06 07:24:27 UTC (rev 163518)
+++ trunk/Tools/ChangeLog 2014-02-06 07:49:15 UTC (rev 163519)
@@ -1,3 +1,18 @@
+2014-02-05 Zan Dobersek <[email protected]>
+
+ 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 <[email protected]>
[EFL][WK2] Remove legacy behavior mode in MiniBrowser
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp (163518 => 163519)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp 2014-02-06 07:24:27 UTC (rev 163518)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp 2014-02-06 07:49:15 UTC (rev 163519)
@@ -130,7 +130,6 @@
ASSERT_TRUE(moveOnlyKeys.isEmpty());
}
-#if COMPILER_SUPPORTS(CXX_GENERALIZED_INITIALIZERS)
TEST(WTF_HashMap, InitializerList)
{
HashMap<unsigned, std::string> map = {
@@ -148,6 +147,5 @@
EXPECT_EQ("four", map.get(4));
EXPECT_EQ(std::string(), map.get(5));
}
-#endif
} // namespace TestWebKitAPI
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/Vector.cpp (163518 => 163519)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/Vector.cpp 2014-02-06 07:24:27 UTC (rev 163518)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/Vector.cpp 2014-02-06 07:49:15 UTC (rev 163519)
@@ -83,7 +83,6 @@
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 @@
EXPECT_EQ(3, vector[2]);
EXPECT_EQ(4, vector[3]);
}
-#endif
TEST(WTF_Vector, Reverse)
{