mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 10:56:07 +00:00
[libc++] NFCI: Remove the _LIBCPP_DEBUG_MODE helper macro
It was used inconsistently and the name was pretty confusing, so we might as well use `#if _LIBCPP_DEBUG_LEVEL == 2` consistently everywhere.
This commit is contained in:
parent
31e820378b
commit
870827f652
@ -29,15 +29,12 @@
|
|||||||
|
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 0
|
#if _LIBCPP_DEBUG_LEVEL == 0
|
||||||
# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
|
# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
|
||||||
# define _LIBCPP_DEBUG_MODE(...) ((void)0)
|
|
||||||
# define _LIBCPP_ASSERT_IMPL(x, m) ((void)0)
|
# define _LIBCPP_ASSERT_IMPL(x, m) ((void)0)
|
||||||
#elif _LIBCPP_DEBUG_LEVEL == 1
|
#elif _LIBCPP_DEBUG_LEVEL == 1
|
||||||
# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
|
# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
|
||||||
# define _LIBCPP_DEBUG_MODE(...) ((void)0)
|
|
||||||
# define _LIBCPP_ASSERT_IMPL(x, m) ((x) ? (void)0 : _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
|
# define _LIBCPP_ASSERT_IMPL(x, m) ((x) ? (void)0 : _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
|
||||||
#elif _LIBCPP_DEBUG_LEVEL == 2
|
#elif _LIBCPP_DEBUG_LEVEL == 2
|
||||||
# define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(x, m)
|
# define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(x, m)
|
||||||
# define _LIBCPP_DEBUG_MODE(...) __VA_ARGS__
|
|
||||||
# define _LIBCPP_ASSERT_IMPL(x, m) ((x) ? (void)0 : _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
|
# define _LIBCPP_ASSERT_IMPL(x, m) ((x) ? (void)0 : _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
|
||||||
#else
|
#else
|
||||||
# error _LIBCPP_DEBUG_LEVEL must be one of 0, 1, 2
|
# error _LIBCPP_DEBUG_LEVEL must be one of 0, 1, 2
|
||||||
|
@ -295,7 +295,9 @@ public:
|
|||||||
typedef typename _NodeTypes::__node_value_type_pointer pointer;
|
typedef typename _NodeTypes::__node_value_type_pointer pointer;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) {
|
_LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) {
|
||||||
_LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
|
__get_db()->__insert_i(this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
@ -405,14 +407,18 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {
|
_LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {
|
||||||
_LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
|
__get_db()->__insert_i(this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
|
__hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
|
||||||
: __node_(__x.__node_)
|
: __node_(__x.__node_)
|
||||||
{
|
{
|
||||||
_LIBCPP_DEBUG_MODE(__get_db()->__iterator_copy(this, &__x));
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
|
__get_db()->__iterator_copy(this, &__x);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
@ -518,7 +524,9 @@ public:
|
|||||||
typedef typename _NodeTypes::__node_value_type_pointer pointer;
|
typedef typename _NodeTypes::__node_value_type_pointer pointer;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {
|
_LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {
|
||||||
_LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
|
__get_db()->__insert_i(this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
@ -650,7 +658,9 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {
|
_LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {
|
||||||
_LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
|
__get_db()->__insert_i(this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -659,7 +669,9 @@ public:
|
|||||||
__bucket_(__x.__bucket_),
|
__bucket_(__x.__bucket_),
|
||||||
__bucket_count_(__x.__bucket_count_)
|
__bucket_count_(__x.__bucket_count_)
|
||||||
{
|
{
|
||||||
_LIBCPP_DEBUG_MODE(__get_db()->__iterator_copy(this, &__x));
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
|
__get_db()->__iterator_copy(this, &__x);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if _LIBCPP_DEBUG_LEVEL == 2
|
#if _LIBCPP_DEBUG_LEVEL == 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user