From patchwork Wed May 11 19:39:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Dumont?= X-Patchwork-Id: 95210 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 0F5EE1007D9 for ; Thu, 12 May 2011 08:29:53 +1000 (EST) Received: (qmail 27980 invoked by alias); 11 May 2011 19:39:51 -0000 Received: (qmail 27672 invoked by uid 22791); 11 May 2011 19:39:44 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp6-g21.free.fr (HELO smtp6-g21.free.fr) (212.27.42.6) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 May 2011 19:39:24 +0000 Received: from localhost.localdomain (unknown [82.237.250.248]) by smtp6-g21.free.fr (Postfix) with ESMTP id 2B4A68228C; Wed, 11 May 2011 21:39:15 +0200 (CEST) Message-ID: <4DCAE5E2.6060504@free.fr> Date: Wed, 11 May 2011 21:39:14 +0200 From: =?ISO-8859-1?Q?Fran=E7ois_Dumont?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110501 Mandriva/3.1.10-0.1mdv2010.2 (2010.2) Thunderbird/3.1.10 MIME-Version: 1.0 To: Benjamin Kosnik CC: "libstdc++@gcc.gnu.org" , gcc-patches@gcc.gnu.org Subject: Re: pb_ds debug mode patch References: <4D8D0DB4.7010804@free.fr> <20110505101745.2242083d@shotwell> <4DC3009B.8080500@free.fr> <20110506100138.3ec9b211@shotwell> <4DC44C31.1020304@free.fr> <20110506143823.56931f83@shotwell> <4DC54DCF.2080904@free.fr> <4DC991A5.9070408@free.fr> <20110510213656.168a1571@shotwell> In-Reply-To: <20110510213656.168a1571@shotwell> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Attached patch applied. 2011-05-11 François Dumont * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp (assert_valid): Replace _GLIBCXX_DEBUG_ASSERT calls with PB_DS_DEBUG_VERIFY. * include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp, find_fn_imps.hpp, insert_fn_imps.hpp, binomial_heap_base_.hpp, constructors_destructor_fn_imps.hpp, split_join_fn_imps.hpp (PB_DS_ASSERT_VALID): Rename in PB_DS_ASSERT_VALID_COND. * include/ext/pb_ds/detail/debug_map_base.hpp, splay_tree_/splay_tree_.hpp, ov_tree_map_/ov_tree_map_.hpp, cc_hash_table_map_/cc_ht_map_.hpp, pat_trie_/pat_trie_.hpp, leaf.hpp, internal_node.hpp, gp_hash_table_map_/gp_ht_map_.hpp, bin_search_tree_/bin_search_tree_.hpp, list_update_map_/lu_map_.hpp, rb_tree_map_/rb_tree_.hpp (PB_DS_ASSERT_VALID, PB_DS_DEBUG_VERIFY, PB_DS_CHECK_KEY_EXISTS, PB_DS_CHECK_KEY_DOES_NOT_EXIST): Duplicate macro definitions move... * include/ext/pb_ds/detail/container_base_dispatch.hpp: ... here... * include/ext/pb_ds/detail/basic_tree_policy/traits.hpp: ... and here. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp, resize_policy.hpp, pairing_heap_/pairing_heap_.hpp, left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp, binomial_heap_/binomial_heap_.hpp, thin_heap_/thin_heap_.hpp, rc_binomial_heap_/rc_binomial_heap_.hpp, rc.hpp (PB_DS_ASSERT_VALID, PB_DS_DEBUG_VERIFY): Duplicate macro definitions move... * include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp: ...here. Regards On 05/11/2011 06:36 AM, Benjamin Kosnik wrote: >> Ok to commit ? > Yes, thanks. > >> Note that I just had a testsuite failure regarding pb_ds code that >> looks rather serious because it doesn't seem to come from pb_ds debug >> code: > Pre-existing. > > -benjamin > Index: include/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp =================================================================== --- include/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp (revision 173552) +++ include/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp (working copy) @@ -286,8 +286,8 @@ PB_DS_CLASS_C_DEC:: assert_valid(const char* __file, int __line) const { - _GLIBCXX_DEBUG_ASSERT(m_load_max > m_load_min); - _GLIBCXX_DEBUG_ASSERT(m_next_grow_size >= m_next_shrink_size); + PB_DS_DEBUG_VERIFY(m_load_max > m_load_min); + PB_DS_DEBUG_VERIFY(m_next_grow_size >= m_next_shrink_size); } # undef PB_DS_DEBUG_VERIFY #endif Index: include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp =================================================================== --- include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp (revision 173552) +++ include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp (working copy) @@ -43,7 +43,7 @@ PB_DS_CLASS_C_DEC:: pop() { - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) _GLIBCXX_DEBUG_ASSERT(!base_type::empty()); if (m_p_max == 0) @@ -59,7 +59,7 @@ m_p_max = 0; - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) } PB_DS_CLASS_T_DEC @@ -113,7 +113,7 @@ PB_DS_CLASS_C_DEC:: erase(point_iterator it) { - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) _GLIBCXX_DEBUG_ASSERT(!base_type::empty()); base_type::bubble_to_top(it.m_p_nd); @@ -124,7 +124,7 @@ m_p_max = 0; - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) } PB_DS_CLASS_T_DEC @@ -133,11 +133,11 @@ PB_DS_CLASS_C_DEC:: erase_if(Pred pred) { - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) if (base_type::empty()) { - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) return 0; } @@ -185,7 +185,7 @@ m_p_max = 0; - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) return ersd; } Index: include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp =================================================================== --- include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp (revision 173552) +++ include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp (working copy) @@ -43,7 +43,7 @@ PB_DS_CLASS_C_DEC:: top() const { - PB_DS_ASSERT_VALID((*this),false) + PB_DS_ASSERT_VALID_COND((*this),false) _GLIBCXX_DEBUG_ASSERT(!base_type::empty()); if (m_p_max == 0) Index: include/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp =================================================================== --- include/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp (revision 173552) +++ include/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp (working copy) @@ -43,7 +43,7 @@ PB_DS_CLASS_C_DEC:: push(const_reference r_val) { - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) node_pointer p_nd = base_type::get_new_node_for_insert(r_val); @@ -51,7 +51,7 @@ m_p_max = 0; - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) return point_iterator(p_nd); } @@ -171,7 +171,7 @@ PB_DS_CLASS_C_DEC:: modify(point_iterator it, const_reference r_new_val) { - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) node_pointer p_nd = it.m_p_nd; _GLIBCXX_DEBUG_ASSERT(p_nd != 0); @@ -198,7 +198,7 @@ m_p_max = 0; - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) return; } @@ -211,6 +211,6 @@ m_p_max = 0; - PB_DS_ASSERT_VALID((*this),true) + PB_DS_ASSERT_VALID_COND((*this),true) } Index: include/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp =================================================================== --- include/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp (revision 173552) +++ include/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp (working copy) @@ -217,19 +217,13 @@ node_pointer m_p_max; }; -#define PB_DS_ASSERT_VALID(X, _StrictlyBinomial) \ +#define PB_DS_ASSERT_VALID_COND(X, _StrictlyBinomial) \ _GLIBCXX_DEBUG_ONLY(X.assert_valid(_StrictlyBinomial,__FILE__, __LINE__);) #define PB_DS_ASSERT_BASE_NODE_CONSISTENT(_Node, _Bool) \ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(_Node, _Bool, \ __FILE__, __LINE__);) -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -237,9 +231,8 @@ #include #include -#undef PB_DS_DEBUG_VERIFY #undef PB_DS_ASSERT_BASE_NODE_CONSISTENT -#undef PB_DS_ASSERT_VALID +#undef PB_DS_ASSERT_VALID_COND #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_T_DEC #undef PB_DS_BASE_C_DEC Index: include/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp =================================================================== --- include/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp (revision 173552) +++ include/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp (working copy) @@ -47,7 +47,7 @@ while (first_it != last_it) push(*(first_it++)); - PB_DS_ASSERT_VALID((*this),false) + PB_DS_ASSERT_VALID_COND((*this),false) } PB_DS_CLASS_T_DEC @@ -55,7 +55,7 @@ binomial_heap_base_() : m_p_max(0) { - PB_DS_ASSERT_VALID((*this),false) + PB_DS_ASSERT_VALID_COND((*this),false) } PB_DS_CLASS_T_DEC @@ -64,7 +64,7 @@ PB_DS_BASE_C_DEC(r_cmp_fn), m_p_max(0) { - PB_DS_ASSERT_VALID((*this),false) + PB_DS_ASSERT_VALID_COND((*this),false) } PB_DS_CLASS_T_DEC @@ -73,7 +73,7 @@ PB_DS_BASE_C_DEC(other), m_p_max(0) { - PB_DS_ASSERT_VALID((*this),false) + PB_DS_ASSERT_VALID_COND((*this),false) } PB_DS_CLASS_T_DEC @@ -81,13 +81,13 @@ PB_DS_CLASS_C_DEC:: swap(PB_DS_CLASS_C_DEC& other) { - PB_DS_ASSERT_VALID((*this),false) + PB_DS_ASSERT_VALID_COND((*this),false) base_type::swap(other); std::swap(m_p_max, other.m_p_max); - PB_DS_ASSERT_VALID((*this),false) + PB_DS_ASSERT_VALID_COND((*this),false) } PB_DS_CLASS_T_DEC Index: include/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp =================================================================== --- include/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp (revision 173552) +++ include/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp (working copy) @@ -44,15 +44,15 @@ PB_DS_CLASS_C_DEC:: split(Pred pred, PB_DS_CLASS_C_DEC& other) { - PB_DS_ASSERT_VALID((*this),true) - PB_DS_ASSERT_VALID(other,true) + PB_DS_ASSERT_VALID_COND((*this),true) + PB_DS_ASSERT_VALID_COND(other,true) other.clear(); if (base_type::empty()) { - PB_DS_ASSERT_VALID((*this),true) - PB_DS_ASSERT_VALID(other,true) + PB_DS_ASSERT_VALID_COND((*this),true) + PB_DS_ASSERT_VALID_COND(other,true) return; } @@ -86,7 +86,7 @@ p_out = p_next; } - PB_DS_ASSERT_VALID(other,true) + PB_DS_ASSERT_VALID_COND(other,true) node_pointer p_cur = base_type::m_p_root; @@ -114,8 +114,8 @@ m_p_max = 0; - PB_DS_ASSERT_VALID((*this),true) - PB_DS_ASSERT_VALID(other,true) + PB_DS_ASSERT_VALID_COND((*this),true) + PB_DS_ASSERT_VALID_COND(other,true) } PB_DS_CLASS_T_DEC @@ -123,8 +123,8 @@ PB_DS_CLASS_C_DEC:: join(PB_DS_CLASS_C_DEC& other) { - PB_DS_ASSERT_VALID((*this),true) - PB_DS_ASSERT_VALID(other,true) + PB_DS_ASSERT_VALID_COND((*this),true) + PB_DS_ASSERT_VALID_COND(other,true) node_pointer p_other = other.m_p_root; @@ -147,8 +147,8 @@ other.m_size = 0; other.m_p_max = 0; - PB_DS_ASSERT_VALID((*this),true) - PB_DS_ASSERT_VALID(other,true) + PB_DS_ASSERT_VALID_COND((*this),true) + PB_DS_ASSERT_VALID_COND(other,true) } PB_DS_CLASS_T_DEC Index: include/ext/pb_ds/detail/container_base_dispatch.hpp =================================================================== --- include/ext/pb_ds/detail/container_base_dispatch.hpp (revision 173552) +++ include/ext/pb_ds/detail/container_base_dispatch.hpp (working copy) @@ -43,6 +43,22 @@ #include +#define PB_DS_ASSERT_VALID(X) \ + _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) + +#define PB_DS_DEBUG_VERIFY(_Cond) \ + _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ + _M_message(#_Cond" assertion from %1;:%2;") \ + ._M_string(__FILE__)._M_integer(__LINE__) \ + ,__file,__line) + +#define PB_DS_CHECK_KEY_EXISTS(_Key) \ + _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);) + +#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key) \ + _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key, \ + __FILE__, __LINE__);) + #define PB_DS_DATA_TRUE_INDICATOR #include #undef PB_DS_DATA_TRUE_INDICATOR @@ -99,6 +115,11 @@ #include #undef PB_DS_DATA_FALSE_INDICATOR +#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST +#undef PB_DS_CHECK_KEY_EXISTS +#undef PB_DS_DEBUG_VERIFY +#undef PB_DS_ASSERT_VALID + namespace __gnu_pbds { namespace detail Index: include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp =================================================================== --- include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp (revision 173552) +++ include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp (working copy) @@ -101,14 +101,6 @@ #define PB_DS_V2S(X) Mapped_Data() #endif -#define PB_DS_CHECK_KEY_EXISTS(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);) - -#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key, \ - __FILE__, __LINE__);) - - // <011i$i0|\|-<|-|4i|\|i|\|g |-|4$|-| 74813. template #include #include @@ -642,10 +625,6 @@ #include #include -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_ASSERT_VALID -#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST -#undef PB_DS_CHECK_KEY_EXISTS #undef PB_DS_CLASS_T_DEC #undef PB_DS_CLASS_C_DEC #undef PB_DS_HASH_EQ_FN_C_DEC Index: include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp =================================================================== --- include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp (revision 173552) +++ include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp (working copy) @@ -495,28 +495,12 @@ size_type m_size; }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - #define PB_DS_ASSERT_NODE_VALID(X) \ _GLIBCXX_DEBUG_ONLY(X->assert_valid(this, __FILE__, __LINE__);) #define PB_DS_RECURSIVE_COUNT_LEAFS(X) \ recursive_count_leafs(X, __FILE__, __LINE__) -#define PB_DS_CHECK_KEY_EXISTS(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);) - -#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key, \ - __FILE__, __LINE__);) - -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -529,12 +513,8 @@ #include #include -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST -#undef PB_DS_CHECK_KEY_EXISTS #undef PB_DS_RECURSIVE_COUNT_LEAFS #undef PB_DS_ASSERT_NODE_VALID -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_T_DEC #undef PB_DS_CLASS_NAME Index: include/ext/pb_ds/detail/pat_trie_/leaf.hpp =================================================================== --- include/ext/pb_ds/detail/pat_trie_/leaf.hpp (revision 173552) +++ include/ext/pb_ds/detail/pat_trie_/leaf.hpp (working copy) @@ -140,12 +140,6 @@ { return m_value; } #ifdef _GLIBCXX_DEBUG -# define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - PB_DS_CLASS_T_DEC typename PB_DS_CLASS_C_DEC::subtree_debug_info PB_DS_CLASS_C_DEC:: @@ -162,7 +156,6 @@ PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: ~pat_trie_leaf() { } -# undef PB_DS_DEBUG_VERIFY #endif #undef PB_DS_CLASS_T_DEC Index: include/ext/pb_ds/detail/pat_trie_/internal_node.hpp =================================================================== --- include/ext/pb_ds/detail/pat_trie_/internal_node.hpp (revision 173552) +++ include/ext/pb_ds/detail/pat_trie_/internal_node.hpp (working copy) @@ -566,12 +566,6 @@ } #ifdef _GLIBCXX_DEBUG -# define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - PB_DS_CLASS_T_DEC typename PB_DS_CLASS_C_DEC::subtree_debug_info PB_DS_CLASS_C_DEC:: @@ -596,7 +590,6 @@ } return std::make_pair(pref_b_it(), pref_e_it()); } -# undef PB_DS_DEBUG_VERIFY #endif #undef PB_DS_CLASS_T_DEC Index: include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp =================================================================== --- include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp (revision 173552) +++ include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp (working copy) @@ -471,28 +471,12 @@ static node_allocator s_node_allocator; }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - #define PB_DS_STRUCT_ONLY_ASSERT_VALID(X) \ _GLIBCXX_DEBUG_ONLY(X.structure_only_assert_valid(__FILE__, __LINE__);) #define PB_DS_ASSERT_NODE_CONSISTENT(_Node) \ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(_Node, __FILE__, __LINE__);) -#define PB_DS_CHECK_KEY_EXISTS(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);) - -#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key, \ - __FILE__, __LINE__);) - -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -504,12 +488,8 @@ #include #include -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST -#undef PB_DS_CHECK_KEY_EXISTS #undef PB_DS_ASSERT_NODE_CONSISTENT #undef PB_DS_STRUCT_ONLY_ASSERT_VALID -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_T_DEC #undef PB_DS_CLASS_NAME Index: include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp =================================================================== --- include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp (revision 173552) +++ include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp (working copy) @@ -98,13 +98,6 @@ #define PB_DS_V2S(X) Mapped() #endif -#define PB_DS_CHECK_KEY_EXISTS(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);) - -#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key, \ - __FILE__, __LINE__);) - template #include #include @@ -678,10 +662,6 @@ #include #include -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_ASSERT_VALID -#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST -#undef PB_DS_CHECK_KEY_EXISTS #undef PB_DS_CLASS_T_DEC #undef PB_DS_CLASS_C_DEC #undef PB_DS_HASH_EQ_FN_C_DEC Index: include/ext/pb_ds/detail/basic_tree_policy/traits.hpp =================================================================== --- include/ext/pb_ds/detail/basic_tree_policy/traits.hpp (revision 173552) +++ include/ext/pb_ds/detail/basic_tree_policy/traits.hpp (working copy) @@ -41,6 +41,12 @@ #ifndef PB_DS_NODE_AND_IT_TRAITS_HPP #define PB_DS_NODE_AND_IT_TRAITS_HPP +#define PB_DS_DEBUG_VERIFY(_Cond) \ + _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ + _M_message(#_Cond" assertion from %1;:%2;") \ + ._M_string(__FILE__)._M_integer(__LINE__) \ + ,__file,__line) + #include #include #include @@ -81,5 +87,6 @@ #include #include #include +#undef PB_DS_DEBUG_VERIFY #endif // #ifndef PB_DS_NODE_AND_IT_TRAITS_HPP Index: include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp =================================================================== --- include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp (revision 173552) +++ include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp (working copy) @@ -335,15 +335,6 @@ entry_pointer m_a_entries; }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -355,8 +346,6 @@ #include #include -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_T_DEC #undef PB_DS_ENTRY_CMP_DEC Index: include/ext/pb_ds/detail/binary_heap_/resize_policy.hpp =================================================================== --- include/ext/pb_ds/detail/binary_heap_/resize_policy.hpp (revision 173552) +++ include/ext/pb_ds/detail/binary_heap_/resize_policy.hpp (working copy) @@ -52,15 +52,6 @@ #define PB_DS_CLASS_C_DEC resize_policy -#define PB_DS_ASSERT_VALID(X)\ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - template class resize_policy { @@ -253,8 +244,6 @@ } #endif -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_T_DEC #undef PB_DS_CLASS_C_DEC Index: include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp =================================================================== --- include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp (revision 173552) +++ include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp (working copy) @@ -41,12 +41,24 @@ #ifndef PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP #define PB_DS_PRIORITY_QUEUE_BASE_DS_DISPATCHER_HPP +#define PB_DS_ASSERT_VALID(X) \ + _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) + +#define PB_DS_DEBUG_VERIFY(_Cond) \ + _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ + _M_message(#_Cond" assertion from %1;:%2;") \ + ._M_string(__FILE__)._M_integer(__LINE__) \ + ,__file,__line) + #include #include #include #include #include +#undef PB_DS_DEBUG_VERIFY +#undef PB_DS_ASSERT_VALID + namespace __gnu_pbds { namespace detail Index: include/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp =================================================================== --- include/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp (revision 173552) +++ include/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp (working copy) @@ -198,19 +198,10 @@ remove_node(node_pointer p_nd); }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - #define PB_DS_ASSERT_NODE_CONSISTENT(_Node, _Bool) \ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(_Node, _Bool, \ __FILE__, __LINE__);) -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -218,9 +209,7 @@ #include #include -#undef PB_DS_DEBUG_VERIFY #undef PB_DS_ASSERT_NODE_CONSISTENT -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_T_DEC #undef PB_DS_BASE_C_DEC Index: include/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp =================================================================== --- include/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp (revision 173552) +++ include/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp (working copy) @@ -104,13 +104,9 @@ #endif }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - #include #include -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_T_DEC Index: include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp =================================================================== --- include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp (revision 173552) +++ include/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp (working copy) @@ -332,15 +332,6 @@ static no_throw_copies_t s_no_throw_copies_ind; }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -350,8 +341,6 @@ #include #include -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_T_DEC Index: include/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp =================================================================== --- include/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp (revision 173552) +++ include/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp (working copy) @@ -334,9 +334,6 @@ /* Pot's good, let's play */ }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - #define PB_DS_ASSERT_NODE_CONSISTENT(_Node, _Bool) \ _GLIBCXX_DEBUG_ONLY(assert_node_consistent(_Node, _Bool, \ __FILE__, __LINE__);) @@ -344,12 +341,6 @@ #define PB_DS_ASSERT_AUX_NULL(X) \ _GLIBCXX_DEBUG_ONLY(X.assert_aux_null(__FILE__, __LINE__);) -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -358,10 +349,8 @@ #include #include -#undef PB_DS_DEBUG_VERIFY #undef PB_DS_ASSERT_AUX_NULL #undef PB_DS_ASSERT_NODE_CONSISTENT -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_T_DEC #undef PB_DS_BASE_C_DEC Index: include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp =================================================================== --- include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp (revision 173552) +++ include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp (working copy) @@ -107,16 +107,10 @@ Cmp_Fn, false, Allocator> #endif -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) +#ifndef PB_DS_CHECK_KEY_EXISTS +# error Missing definition +#endif -#define PB_DS_CHECK_KEY_EXISTS(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);) - -#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key, \ - __FILE__, __LINE__);) - // Ordered-vector tree associative-container. template @@ -502,12 +496,6 @@ size_type m_size; }; -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -517,10 +505,6 @@ #include #include -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST -#undef PB_DS_CHECK_KEY_EXISTS -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_T_DEC #undef PB_DS_OV_TREE_CLASS_NAME Index: include/ext/pb_ds/detail/debug_map_base.hpp =================================================================== --- include/ext/pb_ds/detail/debug_map_base.hpp (revision 173552) +++ include/ext/pb_ds/detail/debug_map_base.hpp (working copy) @@ -51,15 +51,6 @@ #include #include -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - namespace __gnu_pbds { namespace detail @@ -356,8 +347,6 @@ } // namespace detail } // namespace __gnu_pbds -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_ASSERT_VALID #endif Index: include/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp =================================================================== --- include/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp (revision 173552) +++ include/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp (working copy) @@ -136,6 +136,9 @@ { private: typedef PB_DS_BASE_C_DEC base_type; +#ifdef _GLIBCXX_DEBUG + typedef base_type debug_base; +#endif typedef typename base_type::node_pointer node_pointer; public: @@ -277,23 +280,10 @@ erase_node(node_pointer); }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - #define PB_DS_ASSERT_BASE_NODE_CONSISTENT(_Node) \ _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(_Node, \ __FILE__, __LINE__);) -#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key) \ - _GLIBCXX_DEBUG_ONLY(base_type::check_key_does_not_exist(_Key, \ - __FILE__, __LINE__);) - -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -302,10 +292,7 @@ #include #include -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST #undef PB_DS_ASSERT_BASE_NODE_CONSISTENT -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_T_DEC #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_NAME Index: include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp =================================================================== --- include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp (revision 173552) +++ include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp (working copy) @@ -337,22 +337,6 @@ mutable entry_pointer m_p_l; }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - -#define PB_DS_CHECK_KEY_EXISTS(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(_Key, __FILE__, __LINE__);) - -#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key) \ - _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(_Key, \ - __FILE__, __LINE__);) - -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -362,10 +346,6 @@ #include #include -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_CHECK_KEY_DOES_NOT_EXIST -#undef PB_DS_CHECK_KEY_EXISTS -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_T_DEC #undef PB_DS_CLASS_C_DEC #undef PB_DS_TYPES_TRAITS_C_DEC Index: include/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp =================================================================== --- include/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp (revision 173552) +++ include/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp (working copy) @@ -180,15 +180,6 @@ rc_t m_rc; }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -196,8 +187,6 @@ #include #include -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_T_DEC #undef PB_DS_BASE_C_DEC Index: include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp =================================================================== --- include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp (revision 173552) +++ include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp (working copy) @@ -41,15 +41,6 @@ #ifndef PB_DS_RC_HPP #define PB_DS_RC_HPP -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - namespace __gnu_pbds { namespace detail @@ -268,6 +259,4 @@ } // namespace detail } // namespace __gnu_pbds -#undef PB_DS_DEBUG_VERIFY -#undef PB_DS_ASSERT_VALID #endif Index: include/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp =================================================================== --- include/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp (revision 173552) +++ include/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp (working copy) @@ -260,18 +260,9 @@ split_at_node(node_pointer, PB_DS_CLASS_C_DEC&); }; -#define PB_DS_ASSERT_VALID(X) \ - _GLIBCXX_DEBUG_ONLY(X.assert_valid(__FILE__, __LINE__);) - #define PB_DS_STRUCT_ONLY_ASSERT_VALID(X) \ _GLIBCXX_DEBUG_ONLY(X.structure_only_assert_valid(__FILE__, __LINE__);) -#define PB_DS_DEBUG_VERIFY(_Cond) \ - _GLIBCXX_DEBUG_VERIFY_AT(_Cond, \ - _M_message(#_Cond" assertion from %1;:%2;") \ - ._M_string(__FILE__)._M_integer(__LINE__) \ - ,__file,__line) - #include #include #include @@ -279,9 +270,7 @@ #include #include -#undef PB_DS_DEBUG_VERIFY #undef PB_DS_STRUCT_ONLY_ASSERT_VALID -#undef PB_DS_ASSERT_VALID #undef PB_DS_CLASS_T_DEC #undef PB_DS_CLASS_C_DEC #undef PB_DS_CLASS_NAME