diff options
author | Eric Fiselier <eric@efcs.ca> | 2014-08-10 23:53:08 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2014-08-10 23:53:08 +0000 |
commit | c1bd9197ebfc0a8de772dfe5ecd88ceea1e7c18c (patch) | |
tree | 7796ffd6c6ba5b78fb7b9ab1f36ac4e7c5f6a5fe /libcxx/include | |
parent | 3b0e32bf61e45ef2bcfcaa962cad13a081b88b45 (diff) | |
download | bcm5719-llvm-c1bd9197ebfc0a8de772dfe5ecd88ceea1e7c18c.tar.gz bcm5719-llvm-c1bd9197ebfc0a8de772dfe5ecd88ceea1e7c18c.zip |
NFC. Move definition of _LIBCPP_ASSERT into __debug header and remove external include guards.
Things done in this patch:
1. Make __debug include __config since it uses macros from it.
2. The current method of defining _LIBCPP_ASSERT is prone to redefinitions. Move
the null _LIBCPP_ASSERT definition into the __debug header to prevent this.
3. Remove external <__debug> include gaurds. <__debug> guards almost all of its
contents internally. There is no reason to be doing it externally.
This patch should not change any functionality.
llvm-svn: 215332
Diffstat (limited to 'libcxx/include')
-rw-r--r-- | libcxx/include/__debug | 6 | ||||
-rw-r--r-- | libcxx/include/__hash_table | 6 | ||||
-rw-r--r-- | libcxx/include/algorithm | 2 | ||||
-rw-r--r-- | libcxx/include/experimental/optional | 6 | ||||
-rw-r--r-- | libcxx/include/experimental/string_view | 2 | ||||
-rw-r--r-- | libcxx/include/iterator | 6 | ||||
-rw-r--r-- | libcxx/include/list | 6 | ||||
-rw-r--r-- | libcxx/include/string | 2 | ||||
-rw-r--r-- | libcxx/include/unordered_map | 2 | ||||
-rw-r--r-- | libcxx/include/unordered_set | 2 | ||||
-rw-r--r-- | libcxx/include/vector | 6 |
11 files changed, 20 insertions, 26 deletions
diff --git a/libcxx/include/__debug b/libcxx/include/__debug index f1805adcfe4..c1512246bfc 100644 --- a/libcxx/include/__debug +++ b/libcxx/include/__debug @@ -11,19 +11,23 @@ #ifndef _LIBCPP_DEBUG_H #define _LIBCPP_DEBUG_H +#include <__config> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif #if _LIBCPP_DEBUG_LEVEL >= 1 - # include <cstdlib> # include <cstdio> # include <cstddef> # ifndef _LIBCPP_ASSERT # define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort())) # endif +#endif +#ifndef _LIBCPP_ASSERT +# define _LIBCPP_ASSERT(x, m) ((void)0) #endif #if _LIBCPP_DEBUG_LEVEL >= 2 diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table index 4c4feb03eab..7c954b68011 100644 --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -20,11 +20,7 @@ #include <__undef_min_max> -#ifdef _LIBCPP_DEBUG -# include <__debug> -#else -# define _LIBCPP_ASSERT(x, m) ((void)0) -#endif +#include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index 4d064dae88c..3ba104bf4ea 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -638,6 +638,8 @@ template <class BidirectionalIterator, class Compare> #include <__undef_min_max> +#include <__debug> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/experimental/optional b/libcxx/include/experimental/optional index 3848da872b8..41d86b4a169 100644 --- a/libcxx/include/experimental/optional +++ b/libcxx/include/experimental/optional @@ -151,11 +151,7 @@ public: #include <__undef_min_max> -#ifdef _LIBCPP_DEBUG -# include <__debug> -#else -# define _LIBCPP_ASSERT(x, m) ((void)0) -#endif +#include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/string_view b/libcxx/include/experimental/string_view index 3147e221e62..b0382e5d257 100644 --- a/libcxx/include/experimental/string_view +++ b/libcxx/include/experimental/string_view @@ -182,6 +182,8 @@ namespace std { #include <ostream> #include <iomanip> +#include <__debug> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/iterator b/libcxx/include/iterator index f338e018dec..88e615a3253 100644 --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -338,11 +338,7 @@ template <class C> auto crend(const C& c) -> decltype(std::rend(c)); // #include <Availability.h> #endif -#ifdef _LIBCPP_DEBUG -# include <__debug> -#else -# define _LIBCPP_ASSERT(x, m) ((void)0) -#endif +#include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/list b/libcxx/include/list index c36786dd49a..13f8a53bf25 100644 --- a/libcxx/include/list +++ b/libcxx/include/list @@ -179,11 +179,7 @@ template <class T, class Alloc> #include <__undef_min_max> -#ifdef _LIBCPP_DEBUG -# include <__debug> -#else -# define _LIBCPP_ASSERT(x, m) ((void)0) -#endif +#include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/string b/libcxx/include/string index d6c148ac6da..fe72e9d38d6 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -453,6 +453,8 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1 #include <__undef_min_max> +#include <__debug> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map index 4e2298bf9b2..0fa87d19ad0 100644 --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -351,6 +351,8 @@ template <class Key, class T, class Hash, class Pred, class Alloc> #include <functional> #include <stdexcept> +#include <__debug> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set index fd378fa0714..d06629fdcd4 100644 --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -325,6 +325,8 @@ template <class Value, class Hash, class Pred, class Alloc> #include <__hash_table> #include <functional> +#include <__debug> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/vector b/libcxx/include/vector index 5d41bd11081..1be584d061c 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -276,11 +276,7 @@ void swap(vector<T,Allocator>& x, vector<T,Allocator>& y) #include <__undef_min_max> -#ifdef _LIBCPP_DEBUG -# include <__debug> -#else -# define _LIBCPP_ASSERT(x, m) ((void)0) -#endif +#include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header |