summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-09-06 21:25:27 +0000
committerEric Fiselier <eric@efcs.ca>2016-09-06 21:25:27 +0000
commitb683ec20e4e1abc63778a7fff3506f4be8b15f37 (patch)
tree5be72bd12b57c3c52667e69a0e2793e080859373
parent5b0fb8f4d5299fcdcf9f4049d45aa9382c590244 (diff)
downloadbcm5719-llvm-b683ec20e4e1abc63778a7fff3506f4be8b15f37.tar.gz
bcm5719-llvm-b683ec20e4e1abc63778a7fff3506f4be8b15f37.zip
Try 2 - Remove <cstdlib> include from `<exception>`
This patch removes the `<cstdlib>` include from exception where it is no longer needed. Unlike my previous attempt this patch also adds <cstdlib> where needed in other headers like <new> and <typeinfo>. This won't fix the Firefox build issues discussed on IRC but it is more correct for libc++. llvm-svn: 280754
-rw-r--r--libcxx/include/exception4
-rw-r--r--libcxx/include/new3
-rw-r--r--libcxx/include/stdexcept3
-rw-r--r--libcxx/include/typeinfo3
4 files changed, 9 insertions, 4 deletions
diff --git a/libcxx/include/exception b/libcxx/include/exception
index a130bca4e67..686e4ecd057 100644
--- a/libcxx/include/exception
+++ b/libcxx/include/exception
@@ -80,10 +80,6 @@ template <class E> void rethrow_if_nested(const E& e);
#include <__config>
#include <cstddef>
#include <type_traits>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
-#include <cstdio>
-#include <cstdlib>
-#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
diff --git a/libcxx/include/new b/libcxx/include/new
index 95208671270..936f9ee0b40 100644
--- a/libcxx/include/new
+++ b/libcxx/include/new
@@ -69,6 +69,9 @@ void operator delete[](void* ptr, void*) noexcept;
#include <__config>
#include <exception>
#include <cstddef>
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
#include <__undef___deallocate>
diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept
index 684578ffb96..b78d5d60273 100644
--- a/libcxx/include/stdexcept
+++ b/libcxx/include/stdexcept
@@ -45,6 +45,9 @@ public:
#include <__config>
#include <exception>
#include <iosfwd> // for string forward decl
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo
index d3155e459b9..ace66099142 100644
--- a/libcxx/include/typeinfo
+++ b/libcxx/include/typeinfo
@@ -61,6 +61,9 @@ public:
#include <exception>
#include <cstddef>
#include <cstdint>
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
OpenPOWER on IntegriCloud