gcc/libstdc++-v3/include/profile/set.h

630 lines
18 KiB
C
Raw Normal View History

// Profiling set implementation -*- C++ -*-
// Copyright (C) 2009-2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file profile/set.h
* This file is a GNU profile extension to the Standard C++ Library.
*/
#ifndef _GLIBCXX_PROFILE_SET_H
#define _GLIBCXX_PROFILE_SET_H 1
#include <profile/base.h>
#include <profile/ordered_base.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace __profile
{
/// Class std::set wrapper with performance instrumentation.
template<typename _Key, typename _Compare = std::less<_Key>,
typename _Allocator = std::allocator<_Key> >
class set
: public _GLIBCXX_STD_C::set<_Key,_Compare,_Allocator>,
public _Ordered_profile<set<_Key, _Compare, _Allocator> >
{
PR libstdc++/36104 part four 2011-01-30 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/36104 part four * include/bits/c++config (_GLIBCXX_STD): Remove. (_GLIBCXX_STD_D, _GLIBCXX_PR): Now _GLIBCXX_STD_C. (_GLIBCXX_P): Now _GLIBCXX_STD_A. (_GLIBCXX_NAMESPACE_DEBUG, _GLIBCXX_NAMESPACE_PARALLEL, _GLIBCXX_NAMESPACE_PROFILE, _GLIBCXX_NAMESPACE_VERSION): Remove. (_GLIBCXX_INLINE_DEBUG, _GLIBCXX_INLINE_PARALLEL, _GLIBCXX_INLINE_PROFILE): Remove. (_GLIBCXX_BEGIN_NAMESPACE(X)): Remove. (_GLIBCXX_END_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NESTED_NAMESPACE(X, Y)): Remove. (_GLIBCXX_END_NESTED_NAMESPACE): Remove. (_GLIBCXX_BEGIN_NAMESPACE_ALGO): Add. (_GLIBCXX_END_NAMESPACE_ALGO): Add. (_GLIBCXX_BEGIN_NAMESPACE_CONTAINER): Add. (_GLIBCXX_END_NAMESPACE_CONTAINER): Add. (_GLIBCXX_BEGIN_NAMESPACE_VERSION): Add. (_GLIBCXX_END_NAMESPACE_VERSION): Add. (_GLIBCXX_BEGIN_LDBL_NAMESPACE): To _GLIBCXX_BEGIN_NAMESPACE_LDBL. (_GLIBCXX_END_LDBL_NAMESPACE): To _GLIBCXX_END_NAMESPACE_LDBL. (_GLIBCXX_VISIBILITY_ATTR): Revert to _GLIBCXX_VISIBILITY. * include/*: Use new macros for namespace scope. * config/*: Same. * src/*: Same. * src/Makefile.am (sources): Remove debug_list.cc, add compatibility-debug_list-2.cc. (parallel_sources): Remove parallel_list.cc, add compatibility-parallel_list-2.cc. (compatibility-parallel_list-2.[o,lo]): New rule. * src/Makefile.in: Regenerate. * src/debug_list.cc: Remove. * src/parallel_list.cc: Remove. * src/compatibility-list-2.cc: New. * src/compatibility-debug_list-2.cc: New. * src/compatibility-parallel_list-2.cc: New. * doc/doxygen/user.cfg.in: Adjust macros. * testsuite/20_util/auto_ptr/assign_neg.cc: Adjust line numbers, macros. * testsuite/20_util/declval/requirements/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/forward/c_neg.cc: Same. * testsuite/20_util/forward/f_neg.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Same. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/forward_list/capacity/1.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ assign_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/forward_list/requirements/dr438/ insert_neg.cc: Same. * testsuite/23_containers/list/capacity/29134.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/bool/capacity/29134.cc: Same. * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/25_algorithms/sort/35588.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/ext/profile/mutex_extensions_neg.cc: Same. * testsuite/ext/profile/profiler_algos.cc: Same. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Same. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Same. From-SVN: r169421
2011-01-30 23:39:36 +01:00
typedef _GLIBCXX_STD_C::set<_Key, _Compare, _Allocator> _Base;
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
typedef typename _Base::iterator _Base_iterator;
typedef typename _Base::const_iterator _Base_const_iterator;
public:
// types:
typedef _Key key_type;
typedef _Key value_type;
typedef _Compare key_compare;
typedef _Compare value_compare;
typedef typename _Base::reference reference;
typedef typename _Base::const_reference const_reference;
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
typedef __iterator_tracker<_Base_iterator, set> iterator;
typedef __iterator_tracker<_Base_const_iterator,
set> const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename _Base::size_type size_type;
typedef typename _Base::difference_type difference_type;
// 23.3.3.1 construct/copy/destroy:
#if __cplusplus < 201103L
re PR libstdc++/58764 ([lwg/2193] error: converting to ‘const std::vector<std::basic_string<char> >’ from initializer list would use explicit constructor) PR libstdc++/58764 * include/bits/stl_deque.h (deque::deque(const allocator_type&): Split into separate default constructor and constructor taking allocator. * include/bits/stl_list.h (list::list(const allocator_type&): Likewise. * include/bits/stl_vector.h (vector::vector(const allocator_type&): Likewise. * include/debug/deque (deque::deque(const allocator_type&)): Likewise. * include/debug/list (list::list(const _Allocator&)): Likewise. * include/debug/map.h (map::map(const _Compare&, const _Allocator&)): Likewise. * include/debug/multimap.h (multimap::multimap(const _Compare&, const _Allocator&)): Likewise. * include/debug/set.h (set::set(const _Compare&, const _Allocator&)): Likewise. * include/debug/multiset.h (multiset::multiset(const _Compare&, const _Allocator&)): Likewise. * include/debug/vector (vector::vector(const allocator_type&)): Likewise. * include/profile/deque (deque::deque(const _Allocator&)): Likewise. * include/profile/list (list::list(const _Allocator&)): Likewise. * include/profile/map.h (map::map(const _Compare&, const _Allocator&)): Likewise. * include/profile/multimap.h (multimap::multimap(const _Compare&, const _Allocator&)): Likewise. * include/profile/set.h (set::set(const _Compare&, const _Allocator&)): Likewise. * include/profile/multiset.h (multiset::multiset(const _Compare&, const _Allocator&)): Likewise. * include/profile/vector (vector::vector(const _Allocator&)): Likewise. * testsuite/23_containers/deque/58764.cc: New. * testsuite/23_containers/list/58764.cc: New. * testsuite/23_containers/map/58764.cc: New. * testsuite/23_containers/multimap/58764.cc: New. * testsuite/23_containers/set/58764.cc: New. * testsuite/23_containers/multiset/58764.cc: New. * testsuite/23_containers/vector/58764.cc: New. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r206939
2014-01-22 20:46:44 +01:00
set()
: _Base() { }
set(const set& __x)
: _Base(__x) { }
~set() { }
#else
set() = default;
set(const set&) = default;
set(set&&) = default;
~set() = default;
#endif
re PR libstdc++/58764 ([lwg/2193] error: converting to ‘const std::vector<std::basic_string<char> >’ from initializer list would use explicit constructor) PR libstdc++/58764 * include/bits/stl_deque.h (deque::deque(const allocator_type&): Split into separate default constructor and constructor taking allocator. * include/bits/stl_list.h (list::list(const allocator_type&): Likewise. * include/bits/stl_vector.h (vector::vector(const allocator_type&): Likewise. * include/debug/deque (deque::deque(const allocator_type&)): Likewise. * include/debug/list (list::list(const _Allocator&)): Likewise. * include/debug/map.h (map::map(const _Compare&, const _Allocator&)): Likewise. * include/debug/multimap.h (multimap::multimap(const _Compare&, const _Allocator&)): Likewise. * include/debug/set.h (set::set(const _Compare&, const _Allocator&)): Likewise. * include/debug/multiset.h (multiset::multiset(const _Compare&, const _Allocator&)): Likewise. * include/debug/vector (vector::vector(const allocator_type&)): Likewise. * include/profile/deque (deque::deque(const _Allocator&)): Likewise. * include/profile/list (list::list(const _Allocator&)): Likewise. * include/profile/map.h (map::map(const _Compare&, const _Allocator&)): Likewise. * include/profile/multimap.h (multimap::multimap(const _Compare&, const _Allocator&)): Likewise. * include/profile/set.h (set::set(const _Compare&, const _Allocator&)): Likewise. * include/profile/multiset.h (multiset::multiset(const _Compare&, const _Allocator&)): Likewise. * include/profile/vector (vector::vector(const _Allocator&)): Likewise. * testsuite/23_containers/deque/58764.cc: New. * testsuite/23_containers/list/58764.cc: New. * testsuite/23_containers/map/58764.cc: New. * testsuite/23_containers/multimap/58764.cc: New. * testsuite/23_containers/set/58764.cc: New. * testsuite/23_containers/multiset/58764.cc: New. * testsuite/23_containers/vector/58764.cc: New. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r206939
2014-01-22 20:46:44 +01:00
explicit set(const _Compare& __comp,
const _Allocator& __a = _Allocator())
: _Base(__comp, __a) { }
#if __cplusplus >= 201103L
template<typename _InputIterator,
typename = std::_RequireInputIter<_InputIterator>>
#else
template<typename _InputIterator>
#endif
set(_InputIterator __first, _InputIterator __last,
const _Compare& __comp = _Compare(),
const _Allocator& __a = _Allocator())
: _Base(__first, __last, __comp, __a) { }
#if __cplusplus >= 201103L
set(initializer_list<value_type> __l,
const _Compare& __comp = _Compare(),
const _Allocator& __a = _Allocator())
: _Base(__l, __comp, __a) { }
explicit
set(const _Allocator& __a)
: _Base(__a) { }
set(const set& __x, const _Allocator& __a)
: _Base(__x, __a) { }
set(set&& __x, const _Allocator& __a)
noexcept( noexcept(_Base(std::move(__x), __a)) )
: _Base(std::move(__x), __a) { }
set(initializer_list<value_type> __l, const _Allocator& __a)
: _Base(__l, __a) { }
template<typename _InputIterator>
set(_InputIterator __first, _InputIterator __last,
const _Allocator& __a)
: _Base(__first, __last, __a) { }
#endif
set(const _Base& __x)
: _Base(__x) { }
#if __cplusplus < 201103L
set&
operator=(const set& __x)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_destruct();
_M_base() = __x;
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_construct();
return *this;
}
#else
set&
operator=(const set&) = default;
set&
operator=(set&&) = default;
set&
operator=(initializer_list<value_type> __l)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_destruct();
_M_base() = __l;
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
this->_M_profile_construct();
return *this;
}
#endif
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
// iterators
iterator
begin() _GLIBCXX_NOEXCEPT
{ return iterator(_Base::begin(), this); }
const_iterator
begin() const _GLIBCXX_NOEXCEPT
{ return const_iterator(_Base::begin(), this); }
iterator
end() _GLIBCXX_NOEXCEPT
{ return iterator(_Base::end(), this); }
const_iterator
end() const _GLIBCXX_NOEXCEPT
{ return const_iterator(_Base::end(), this); }
#if __cplusplus >= 201103L
const_iterator
cbegin() const noexcept
{ return const_iterator(_Base::cbegin(), this); }
const_iterator
cend() const noexcept
{ return const_iterator(_Base::cend(), this); }
#endif
reverse_iterator
rbegin() _GLIBCXX_NOEXCEPT
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return reverse_iterator(end());
}
const_reverse_iterator
rbegin() const _GLIBCXX_NOEXCEPT
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return const_reverse_iterator(end());
}
reverse_iterator
rend() _GLIBCXX_NOEXCEPT
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return reverse_iterator(begin());
}
const_reverse_iterator
rend() const _GLIBCXX_NOEXCEPT
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return const_reverse_iterator(begin());
}
#if __cplusplus >= 201103L
const_reverse_iterator
crbegin() const noexcept
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return const_reverse_iterator(cend());
}
const_reverse_iterator
crend() const noexcept
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return const_reverse_iterator(cbegin());
}
#endif
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
void
swap(set& __x)
#if __cplusplus >= 201103L
noexcept( noexcept(declval<_Base>().swap(__x)) )
#endif
{
_Base::swap(__x);
this->_M_swap(__x);
}
// modifiers:
#if __cplusplus >= 201103L
re PR libstdc++/44436 ([C++0x] Implement emplace* in associative containers) 2012-09-24 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/44436 * include/bits/stl_tree.h (_Rb_tree<>::_M_insert_): Take _Base_ptr rather than _Const_Base_ptr. (_Rb_tree<>::_M_insert_node): New. (_Rb_tree<>::_M_get_insert_unique_pos): New, search code of _M_insert_unique method. (_Rb_tree<>::_M_insert_unique): Use latter. (_Rb_tree<>::_M_emplace_unique): New, likewise. (_Rb_tree<>::_M_get_insert_equal_pos): New, search code of _M_insert_equal method. (_Rb_tree<>::_M_insert_equal): Use latter. (_Rb_tree<>::_M_emplace_equal): New, likewise. (_Rb_tree<>::_M_get_insert_hint_unique_pos): New, search code of _M_insert_unique_ method. (_Rb_tree<>::_M_insert_unique_): Use latter. (_Rb_tree<>::_M_emplace_hint_unique): New, likewise. (_Rb_tree<>::_M_get_insert_hint_equal_pos): New, search code of _M_insert_equal_ method. (_Rb_tree<>::_M_insert_equal_): Use latter. (_Rb_tree<>::_M_emplace_hint_equal): New, likewise. (_Rb_tree<>::_M_insert_lower): Remove first _Base_ptr parameter, useless as always null. * include/bits/stl_map.h: Include <tuple> in C++11. (map<>::operator[](const key_type&)): Use _Rb_tree<>::_M_emplace_hint_unique in C++11. (map<>::operator[](key_type&&)): Likewise. (map<>::emplace): New. (map<>::emplace_hint): New. * include/bits/stl_multimap.h (multimap<>::emplace): New. (multimap<>::emplace_hint): New. * include/bits/stl_set.h (set<>::emplace): New. (set<>::emplace_hint): New. * include/bits/stl_multiset.h (multiset<>::emplace): New. (multiset<>::emplace_hint): New. * include/debug/map.h (std::__debug::map<>::emplace): New. (std::__debug::map<>::emplace_hint): New. * include/debug/multimap.h (std::__debug::multimap<>::emplace): New. (std::__debug::multimap<>::emplace_hint): New. * include/debug/set.h (std::__debug::set<>::emplace): New. (std::__debug::set<>::emplace_hint): New. * include/debug/multiset.h (std::__debug::multiset<>::emplace): New. (std::__debug::multiset<>::emplace_hint): New. * include/profile/map.h (std::__profile::map<>::emplace): New. (std::__profile::map<>::emplace_hint): New. * include/profile/multimap.h (std::__profile::multimap<>::emplace): New. (std::__profile::multimap<>::emplace_hint): New. * include/profile/set.h (std::__profile::set<>::emplace): New. (std::__profile::set<>::emplace_hint): New. * include/profile/multiset.h (std::__profile::multiset<>::emplace): New. (std::__profile::multiset<>::emplace_hint): New. * testsuite/util/testsuite_container_traits.h: Signal that emplace and emplace_hint are available on std::map, std::multimap, std::set and std::multiset in C++11. * testsuite/23_containers/map/operators/2.cc: New. * testsuite/23_containers/map/modifiers/emplace/1.cc: New. * testsuite/23_containers/multimap/modifiers/emplace/1.cc: New. * testsuite/23_containers/set/modifiers/emplace/1.cc: New. * testsuite/23_containers/multiset/modifiers/emplace/1.cc: New. From-SVN: r191679
2012-09-24 21:53:36 +02:00
template<typename... _Args>
std::pair<iterator, bool>
emplace(_Args&&... __args)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_insert(this->_M_map2umap_info, this->size(), 1);
auto __base_ret = _Base::emplace(std::forward<_Args>(__args)...);
return std::make_pair(iterator(__base_ret.first, this),
__base_ret.second);
re PR libstdc++/44436 ([C++0x] Implement emplace* in associative containers) 2012-09-24 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/44436 * include/bits/stl_tree.h (_Rb_tree<>::_M_insert_): Take _Base_ptr rather than _Const_Base_ptr. (_Rb_tree<>::_M_insert_node): New. (_Rb_tree<>::_M_get_insert_unique_pos): New, search code of _M_insert_unique method. (_Rb_tree<>::_M_insert_unique): Use latter. (_Rb_tree<>::_M_emplace_unique): New, likewise. (_Rb_tree<>::_M_get_insert_equal_pos): New, search code of _M_insert_equal method. (_Rb_tree<>::_M_insert_equal): Use latter. (_Rb_tree<>::_M_emplace_equal): New, likewise. (_Rb_tree<>::_M_get_insert_hint_unique_pos): New, search code of _M_insert_unique_ method. (_Rb_tree<>::_M_insert_unique_): Use latter. (_Rb_tree<>::_M_emplace_hint_unique): New, likewise. (_Rb_tree<>::_M_get_insert_hint_equal_pos): New, search code of _M_insert_equal_ method. (_Rb_tree<>::_M_insert_equal_): Use latter. (_Rb_tree<>::_M_emplace_hint_equal): New, likewise. (_Rb_tree<>::_M_insert_lower): Remove first _Base_ptr parameter, useless as always null. * include/bits/stl_map.h: Include <tuple> in C++11. (map<>::operator[](const key_type&)): Use _Rb_tree<>::_M_emplace_hint_unique in C++11. (map<>::operator[](key_type&&)): Likewise. (map<>::emplace): New. (map<>::emplace_hint): New. * include/bits/stl_multimap.h (multimap<>::emplace): New. (multimap<>::emplace_hint): New. * include/bits/stl_set.h (set<>::emplace): New. (set<>::emplace_hint): New. * include/bits/stl_multiset.h (multiset<>::emplace): New. (multiset<>::emplace_hint): New. * include/debug/map.h (std::__debug::map<>::emplace): New. (std::__debug::map<>::emplace_hint): New. * include/debug/multimap.h (std::__debug::multimap<>::emplace): New. (std::__debug::multimap<>::emplace_hint): New. * include/debug/set.h (std::__debug::set<>::emplace): New. (std::__debug::set<>::emplace_hint): New. * include/debug/multiset.h (std::__debug::multiset<>::emplace): New. (std::__debug::multiset<>::emplace_hint): New. * include/profile/map.h (std::__profile::map<>::emplace): New. (std::__profile::map<>::emplace_hint): New. * include/profile/multimap.h (std::__profile::multimap<>::emplace): New. (std::__profile::multimap<>::emplace_hint): New. * include/profile/set.h (std::__profile::set<>::emplace): New. (std::__profile::set<>::emplace_hint): New. * include/profile/multiset.h (std::__profile::multiset<>::emplace): New. (std::__profile::multiset<>::emplace_hint): New. * testsuite/util/testsuite_container_traits.h: Signal that emplace and emplace_hint are available on std::map, std::multimap, std::set and std::multiset in C++11. * testsuite/23_containers/map/operators/2.cc: New. * testsuite/23_containers/map/modifiers/emplace/1.cc: New. * testsuite/23_containers/multimap/modifiers/emplace/1.cc: New. * testsuite/23_containers/set/modifiers/emplace/1.cc: New. * testsuite/23_containers/multiset/modifiers/emplace/1.cc: New. From-SVN: r191679
2012-09-24 21:53:36 +02:00
}
template<typename... _Args>
iterator
emplace_hint(const_iterator __pos, _Args&&... __args)
{
auto size_before = this->size();
auto __res
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
= _Base::emplace_hint(__pos.base(), std::forward<_Args>(__args)...);
__profcxx_map2umap_insert(this->_M_map2umap_info,
size_before, _M_hint_used(__pos.base(), __res) ? 0 : 1);
return iterator(__res, this);
re PR libstdc++/44436 ([C++0x] Implement emplace* in associative containers) 2012-09-24 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/44436 * include/bits/stl_tree.h (_Rb_tree<>::_M_insert_): Take _Base_ptr rather than _Const_Base_ptr. (_Rb_tree<>::_M_insert_node): New. (_Rb_tree<>::_M_get_insert_unique_pos): New, search code of _M_insert_unique method. (_Rb_tree<>::_M_insert_unique): Use latter. (_Rb_tree<>::_M_emplace_unique): New, likewise. (_Rb_tree<>::_M_get_insert_equal_pos): New, search code of _M_insert_equal method. (_Rb_tree<>::_M_insert_equal): Use latter. (_Rb_tree<>::_M_emplace_equal): New, likewise. (_Rb_tree<>::_M_get_insert_hint_unique_pos): New, search code of _M_insert_unique_ method. (_Rb_tree<>::_M_insert_unique_): Use latter. (_Rb_tree<>::_M_emplace_hint_unique): New, likewise. (_Rb_tree<>::_M_get_insert_hint_equal_pos): New, search code of _M_insert_equal_ method. (_Rb_tree<>::_M_insert_equal_): Use latter. (_Rb_tree<>::_M_emplace_hint_equal): New, likewise. (_Rb_tree<>::_M_insert_lower): Remove first _Base_ptr parameter, useless as always null. * include/bits/stl_map.h: Include <tuple> in C++11. (map<>::operator[](const key_type&)): Use _Rb_tree<>::_M_emplace_hint_unique in C++11. (map<>::operator[](key_type&&)): Likewise. (map<>::emplace): New. (map<>::emplace_hint): New. * include/bits/stl_multimap.h (multimap<>::emplace): New. (multimap<>::emplace_hint): New. * include/bits/stl_set.h (set<>::emplace): New. (set<>::emplace_hint): New. * include/bits/stl_multiset.h (multiset<>::emplace): New. (multiset<>::emplace_hint): New. * include/debug/map.h (std::__debug::map<>::emplace): New. (std::__debug::map<>::emplace_hint): New. * include/debug/multimap.h (std::__debug::multimap<>::emplace): New. (std::__debug::multimap<>::emplace_hint): New. * include/debug/set.h (std::__debug::set<>::emplace): New. (std::__debug::set<>::emplace_hint): New. * include/debug/multiset.h (std::__debug::multiset<>::emplace): New. (std::__debug::multiset<>::emplace_hint): New. * include/profile/map.h (std::__profile::map<>::emplace): New. (std::__profile::map<>::emplace_hint): New. * include/profile/multimap.h (std::__profile::multimap<>::emplace): New. (std::__profile::multimap<>::emplace_hint): New. * include/profile/set.h (std::__profile::set<>::emplace): New. (std::__profile::set<>::emplace_hint): New. * include/profile/multiset.h (std::__profile::multiset<>::emplace): New. (std::__profile::multiset<>::emplace_hint): New. * testsuite/util/testsuite_container_traits.h: Signal that emplace and emplace_hint are available on std::map, std::multimap, std::set and std::multiset in C++11. * testsuite/23_containers/map/operators/2.cc: New. * testsuite/23_containers/map/modifiers/emplace/1.cc: New. * testsuite/23_containers/multimap/modifiers/emplace/1.cc: New. * testsuite/23_containers/set/modifiers/emplace/1.cc: New. * testsuite/23_containers/multiset/modifiers/emplace/1.cc: New. From-SVN: r191679
2012-09-24 21:53:36 +02:00
}
#endif
std::pair<iterator, bool>
insert(const value_type& __x)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_insert(this->_M_map2umap_info, this->size(), 1);
std::pair<_Base_iterator, bool> __base_ret = _Base::insert(__x);
return std::make_pair(iterator(__base_ret.first, this),
__base_ret.second);
}
#if __cplusplus >= 201103L
PR libstdc++/44436 (partial) 2010-11-10 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/44436 (partial) PR libstdc++/46148 * include/bits/stl_tree.h (_Rb_tree<>::_M_insert_, _M_insert_lower, _M_insert_equal_lower, _M_insert_unique, _M_insert_equal, _M_insert_unique_, _M_insert_equal_): Templatize in C++0x mode, use _GLIBCXX_FORWARD throughout. * include/bits/stl_map.h (map<>::insert(_Pair&&), insert(const_iterator, _Pair&&), operator[](key_type&&): Add. * include/bits/stl_set.h (set<>::insert(value_type&&), insert(const_iterator, value_type&&)): Likewise. * include/bits/stl_multimap.h (multimap<>::insert(_Pair&&), insert(const_iterator, _Pair&&)): Likewise. * include/bits/stl_multiset.h (multiset<>::insert(value_type&&), insert(const_iterator, value_type&&)): Likewise. * include/debug/set.h: Adjust. * include/debug/multiset.h: Likewise. * include/debug/map.h: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/multiset.h: Likewise. * include/profile/map.h: Likewise. * include/profile/multimap.h: Likewise. * testsuite/23_containers/multimap/modifiers/insert/1.cc: New. * testsuite/23_containers/multimap/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/multimap/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multimap/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/set/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/set/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multiset/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multiset/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/5.cc: Likewise. * testsuite/23_containers/map/element_access/2.cc: Likewise. * testsuite/23_containers/map/element_access/46148.cc: Likewise. * include/bits/hashtable.h: Trivial naming changes. From-SVN: r166551
2010-11-10 20:08:49 +01:00
std::pair<iterator, bool>
insert(value_type&& __x)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_insert(this->_M_map2umap_info, this->size(), 1);
std::pair<_Base_iterator, bool> __base_ret
= _Base::insert(std::move(__x));
return std::make_pair(iterator(__base_ret.first, this),
__base_ret.second);
PR libstdc++/44436 (partial) 2010-11-10 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/44436 (partial) PR libstdc++/46148 * include/bits/stl_tree.h (_Rb_tree<>::_M_insert_, _M_insert_lower, _M_insert_equal_lower, _M_insert_unique, _M_insert_equal, _M_insert_unique_, _M_insert_equal_): Templatize in C++0x mode, use _GLIBCXX_FORWARD throughout. * include/bits/stl_map.h (map<>::insert(_Pair&&), insert(const_iterator, _Pair&&), operator[](key_type&&): Add. * include/bits/stl_set.h (set<>::insert(value_type&&), insert(const_iterator, value_type&&)): Likewise. * include/bits/stl_multimap.h (multimap<>::insert(_Pair&&), insert(const_iterator, _Pair&&)): Likewise. * include/bits/stl_multiset.h (multiset<>::insert(value_type&&), insert(const_iterator, value_type&&)): Likewise. * include/debug/set.h: Adjust. * include/debug/multiset.h: Likewise. * include/debug/map.h: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/multiset.h: Likewise. * include/profile/map.h: Likewise. * include/profile/multimap.h: Likewise. * testsuite/23_containers/multimap/modifiers/insert/1.cc: New. * testsuite/23_containers/multimap/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/multimap/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multimap/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/set/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/set/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multiset/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multiset/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/5.cc: Likewise. * testsuite/23_containers/map/element_access/2.cc: Likewise. * testsuite/23_containers/map/element_access/46148.cc: Likewise. * include/bits/hashtable.h: Trivial naming changes. From-SVN: r166551
2010-11-10 20:08:49 +01:00
}
#endif
iterator
insert(const_iterator __pos, const value_type& __x)
{
size_type size_before = this->size();
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
_Base_iterator __res = _Base::insert(__pos.base(), __x);
__profcxx_map2umap_insert(this->_M_map2umap_info,
size_before, _M_hint_used(__pos.base(), __res) ? 0 : 1);
return iterator(__res, this);
}
#if __cplusplus >= 201103L
PR libstdc++/44436 (partial) 2010-11-10 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/44436 (partial) PR libstdc++/46148 * include/bits/stl_tree.h (_Rb_tree<>::_M_insert_, _M_insert_lower, _M_insert_equal_lower, _M_insert_unique, _M_insert_equal, _M_insert_unique_, _M_insert_equal_): Templatize in C++0x mode, use _GLIBCXX_FORWARD throughout. * include/bits/stl_map.h (map<>::insert(_Pair&&), insert(const_iterator, _Pair&&), operator[](key_type&&): Add. * include/bits/stl_set.h (set<>::insert(value_type&&), insert(const_iterator, value_type&&)): Likewise. * include/bits/stl_multimap.h (multimap<>::insert(_Pair&&), insert(const_iterator, _Pair&&)): Likewise. * include/bits/stl_multiset.h (multiset<>::insert(value_type&&), insert(const_iterator, value_type&&)): Likewise. * include/debug/set.h: Adjust. * include/debug/multiset.h: Likewise. * include/debug/map.h: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/multiset.h: Likewise. * include/profile/map.h: Likewise. * include/profile/multimap.h: Likewise. * testsuite/23_containers/multimap/modifiers/insert/1.cc: New. * testsuite/23_containers/multimap/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/multimap/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multimap/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/set/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/set/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multiset/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multiset/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/5.cc: Likewise. * testsuite/23_containers/map/element_access/2.cc: Likewise. * testsuite/23_containers/map/element_access/46148.cc: Likewise. * include/bits/hashtable.h: Trivial naming changes. From-SVN: r166551
2010-11-10 20:08:49 +01:00
iterator
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
insert(const_iterator __pos, value_type&& __x)
{ return iterator(_Base::insert(__pos.base(), std::move(__x)), this); }
PR libstdc++/44436 (partial) 2010-11-10 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/44436 (partial) PR libstdc++/46148 * include/bits/stl_tree.h (_Rb_tree<>::_M_insert_, _M_insert_lower, _M_insert_equal_lower, _M_insert_unique, _M_insert_equal, _M_insert_unique_, _M_insert_equal_): Templatize in C++0x mode, use _GLIBCXX_FORWARD throughout. * include/bits/stl_map.h (map<>::insert(_Pair&&), insert(const_iterator, _Pair&&), operator[](key_type&&): Add. * include/bits/stl_set.h (set<>::insert(value_type&&), insert(const_iterator, value_type&&)): Likewise. * include/bits/stl_multimap.h (multimap<>::insert(_Pair&&), insert(const_iterator, _Pair&&)): Likewise. * include/bits/stl_multiset.h (multiset<>::insert(value_type&&), insert(const_iterator, value_type&&)): Likewise. * include/debug/set.h: Adjust. * include/debug/multiset.h: Likewise. * include/debug/map.h: Likewise. * include/debug/multimap.h: Likewise. * include/profile/set.h: Likewise. * include/profile/multiset.h: Likewise. * include/profile/map.h: Likewise. * include/profile/multimap.h: Likewise. * testsuite/23_containers/multimap/modifiers/insert/1.cc: New. * testsuite/23_containers/multimap/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/multimap/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multimap/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/set/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/set/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multiset/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/multiset/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/2.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/3.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/4.cc: Likewise. * testsuite/23_containers/map/modifiers/insert/5.cc: Likewise. * testsuite/23_containers/map/element_access/2.cc: Likewise. * testsuite/23_containers/map/element_access/46148.cc: Likewise. * include/bits/hashtable.h: Trivial naming changes. From-SVN: r166551
2010-11-10 20:08:49 +01:00
#endif
template<typename _InputIterator>
void
insert(_InputIterator __first, _InputIterator __last)
{
for (; __first != __last; ++__first)
insert(*__first);
}
#if __cplusplus >= 201103L
void
insert(initializer_list<value_type> __l)
{ insert(__l.begin(), __l.end()); }
#endif
#if __cplusplus >= 201103L
iterator
erase(const_iterator __pos)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_erase(this->_M_map2umap_info, this->size(), 1);
return iterator(_Base::erase(__pos.base()), this);
}
#else
void
erase(iterator __pos)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_erase(this->_M_map2umap_info, this->size(), 1);
_Base::erase(__pos.base());
}
#endif
size_type
erase(const key_type& __x)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_erase(this->_M_map2umap_info, this->size(), 1);
return _Base::erase(__x);
}
#if __cplusplus >= 201103L
iterator
erase(const_iterator __first, const_iterator __last)
{
if (__first != __last)
{
iterator __ret;
for (; __first != __last;)
__ret = erase(__first++);
return __ret;
}
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
return iterator(_Base::erase(__first.base(), __last.base()), this);
}
#else
void
erase(iterator __first, iterator __last)
{
for (; __first != __last;)
erase(__first++);
}
#endif
void
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
clear() _GLIBCXX_NOEXCEPT
{
this->_M_profile_destruct();
_Base::clear();
this->_M_profile_construct();
}
size_type
count(const key_type& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return _Base::count(__x);
}
stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... 2015-06-07 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... (std::__hash_is_transparent<>): ... this. * include/debug/stl_map.h (map::find<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): New member function templates to perform heterogeneous lookup. * include/debug/stl_multimap.h (multimap::find<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/debug/stl_multiset.h (multiset::find<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/debug/stl_set.h (set::find<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * include/profile/stl_map.h (map::find<>, map::count<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): Likewise. * include/profile/stl_multimap.h (multimap::find<>, multimap::count<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/profile/stl_multiset.h (multiset::find<>, multiset::count<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/profile/stl_set.h (set::find<>, set::count<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * testsuite/23_containers/map/operations/1.cc: Check const variants. * testsuite/23_containers/multimap/operations/1.cc: Likewise. * testsuite/23_containers/multiset/operations/1.cc: Likewise. * testsuite/23_containers/set/operations/1.cc: Likewise. From-SVN: r224200
2015-06-07 22:45:57 +02:00
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
size_type
count(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return _Base::count(__x);
}
#endif
// set operations:
iterator
find(const key_type& __x)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return iterator(_Base::find(__x), this);
}
const_iterator
find(const key_type& __x) const
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return const_iterator(_Base::find(__x), this);
}
stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... 2015-06-07 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... (std::__hash_is_transparent<>): ... this. * include/debug/stl_map.h (map::find<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): New member function templates to perform heterogeneous lookup. * include/debug/stl_multimap.h (multimap::find<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/debug/stl_multiset.h (multiset::find<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/debug/stl_set.h (set::find<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * include/profile/stl_map.h (map::find<>, map::count<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): Likewise. * include/profile/stl_multimap.h (multimap::find<>, multimap::count<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/profile/stl_multiset.h (multiset::find<>, multiset::count<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/profile/stl_set.h (set::find<>, set::count<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * testsuite/23_containers/map/operations/1.cc: Check const variants. * testsuite/23_containers/multimap/operations/1.cc: Likewise. * testsuite/23_containers/multiset/operations/1.cc: Likewise. * testsuite/23_containers/set/operations/1.cc: Likewise. From-SVN: r224200
2015-06-07 22:45:57 +02:00
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
find(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return { _Base::find(__x), this };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
find(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
return { _Base::find(__x), this };
}
#endif
iterator
lower_bound(const key_type& __x)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return iterator(_Base::lower_bound(__x), this);
}
const_iterator
lower_bound(const key_type& __x) const
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return const_iterator(_Base::lower_bound(__x), this);
}
stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... 2015-06-07 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... (std::__hash_is_transparent<>): ... this. * include/debug/stl_map.h (map::find<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): New member function templates to perform heterogeneous lookup. * include/debug/stl_multimap.h (multimap::find<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/debug/stl_multiset.h (multiset::find<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/debug/stl_set.h (set::find<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * include/profile/stl_map.h (map::find<>, map::count<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): Likewise. * include/profile/stl_multimap.h (multimap::find<>, multimap::count<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/profile/stl_multiset.h (multiset::find<>, multiset::count<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/profile/stl_set.h (set::find<>, set::count<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * testsuite/23_containers/map/operations/1.cc: Check const variants. * testsuite/23_containers/multimap/operations/1.cc: Likewise. * testsuite/23_containers/multiset/operations/1.cc: Likewise. * testsuite/23_containers/set/operations/1.cc: Likewise. From-SVN: r224200
2015-06-07 22:45:57 +02:00
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
lower_bound(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::lower_bound(__x), this };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
lower_bound(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::lower_bound(__x), this };
}
#endif
iterator
upper_bound(const key_type& __x)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return iterator(_Base::upper_bound(__x), this);
}
const_iterator
upper_bound(const key_type& __x) const
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return const_iterator(_Base::upper_bound(__x), this);
}
stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... 2015-06-07 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... (std::__hash_is_transparent<>): ... this. * include/debug/stl_map.h (map::find<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): New member function templates to perform heterogeneous lookup. * include/debug/stl_multimap.h (multimap::find<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/debug/stl_multiset.h (multiset::find<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/debug/stl_set.h (set::find<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * include/profile/stl_map.h (map::find<>, map::count<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): Likewise. * include/profile/stl_multimap.h (multimap::find<>, multimap::count<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/profile/stl_multiset.h (multiset::find<>, multiset::count<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/profile/stl_set.h (set::find<>, set::count<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * testsuite/23_containers/map/operations/1.cc: Check const variants. * testsuite/23_containers/multimap/operations/1.cc: Likewise. * testsuite/23_containers/multiset/operations/1.cc: Likewise. * testsuite/23_containers/set/operations/1.cc: Likewise. From-SVN: r224200
2015-06-07 22:45:57 +02:00
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
iterator
upper_bound(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::upper_bound(__x), this };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
const_iterator
upper_bound(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
__profcxx_map2umap_invalidate(this->_M_map2umap_info);
return { _Base::upper_bound(__x), this };
}
#endif
std::pair<iterator, iterator>
equal_range(const key_type& __x)
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
std::pair<_Base_iterator, _Base_iterator> __base_ret
= _Base::equal_range(__x);
return std::make_pair(iterator(__base_ret.first, this),
iterator(__base_ret.second, this));
}
std::pair<const_iterator, const_iterator>
equal_range(const key_type& __x) const
{
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
std::pair<_Base_const_iterator, _Base_const_iterator> __base_ret
= _Base::equal_range(__x);
return std::make_pair(const_iterator(__base_ret.first, this),
const_iterator(__base_ret.second, this));
}
stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... 2015-06-07 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... (std::__hash_is_transparent<>): ... this. * include/debug/stl_map.h (map::find<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): New member function templates to perform heterogeneous lookup. * include/debug/stl_multimap.h (multimap::find<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/debug/stl_multiset.h (multiset::find<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/debug/stl_set.h (set::find<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * include/profile/stl_map.h (map::find<>, map::count<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): Likewise. * include/profile/stl_multimap.h (multimap::find<>, multimap::count<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/profile/stl_multiset.h (multiset::find<>, multiset::count<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/profile/stl_set.h (set::find<>, set::count<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * testsuite/23_containers/map/operations/1.cc: Check const variants. * testsuite/23_containers/multimap/operations/1.cc: Likewise. * testsuite/23_containers/multiset/operations/1.cc: Likewise. * testsuite/23_containers/set/operations/1.cc: Likewise. From-SVN: r224200
2015-06-07 22:45:57 +02:00
#if __cplusplus > 201103L
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<iterator, iterator>
equal_range(const _Kt& __x)
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
template<typename _Kt,
typename _Req =
typename __has_is_transparent<_Compare, _Kt>::type>
std::pair<const_iterator, const_iterator>
equal_range(const _Kt& __x) const
{
__profcxx_map2umap_find(this->_M_map2umap_info, this->size());
auto __res = _Base::equal_range(__x);
return { { __res.first, this }, { __res.second, this } };
}
#endif
_Base&
_M_base() _GLIBCXX_NOEXCEPT { return *this; }
const _Base&
_M_base() const _GLIBCXX_NOEXCEPT { return *this; }
private:
/** If hint is used we consider that the map and unordered_map
* operations have equivalent insertion cost so we do not update metrics
* about it.
* Note that to find out if hint has been used is libstdc++
* implementation dependent.
*/
bool
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
_M_hint_used(_Base_const_iterator __hint, _Base_iterator __res)
{
return (__hint == __res
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
|| (__hint == _M_base().end() && ++__res == _M_base().end())
|| (__hint != _M_base().end() && (++__hint == __res
|| ++__res == --__hint)));
}
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
template<typename _K1, typename _C1, typename _A1>
friend bool
operator==(const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&);
template<typename _K1, typename _C1, typename _A1>
friend bool
operator<(const set<_K1, _C1, _A1>&, const set<_K1, _C1, _A1>&);
};
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
operator==(const set<_Key, _Compare, _Allocator>& __lhs,
const set<_Key, _Compare, _Allocator>& __rhs)
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
{
__profcxx_map2umap_invalidate(__lhs._M_map2umap_info);
__profcxx_map2umap_invalidate(__rhs._M_map2umap_info);
return __lhs._M_base() == __rhs._M_base();
}
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
operator<(const set<_Key, _Compare, _Allocator>& __lhs,
const set<_Key, _Compare, _Allocator>& __rhs)
{
__profcxx_map2umap_invalidate(__lhs._M_map2umap_info);
__profcxx_map2umap_invalidate(__rhs._M_map2umap_info);
return __lhs._M_base() < __rhs._M_base();
}
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
operator!=(const set<_Key, _Compare, _Allocator>& __lhs,
const set<_Key, _Compare, _Allocator>& __rhs)
{ return !(__lhs == __rhs); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
operator<=(const set<_Key, _Compare, _Allocator>& __lhs,
const set<_Key, _Compare, _Allocator>& __rhs)
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
{ return !(__rhs < __lhs); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
operator>=(const set<_Key, _Compare, _Allocator>& __lhs,
const set<_Key, _Compare, _Allocator>& __rhs)
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
{ return !(__lhs < __rhs); }
template<typename _Key, typename _Compare, typename _Allocator>
inline bool
operator>(const set<_Key, _Compare, _Allocator>& __lhs,
const set<_Key, _Compare, _Allocator>& __rhs)
Major maintenance patch of the profile mode. 2014-11-10 François Dumont <fdumont@gcc.gnu.org> Major maintenance patch of the profile mode. * include/profile/impl/profiler_container_size.h (__container_size_info()): Delete. (__container_size_info(const __container_size_info&)): Delete. (virtual ~__container_size_info()): Delete. (__container_size_info(__stack_t, size_t)): Delete. (__container_size_info(__stack_t)): New. (__container_size_info::__init(size_t)): New. (__container_size_info::__merge): Call __object_info_base::__merge. (__trace_container_size::__construct): Delete declaration. (__trace_container_size::__insert): Return __container_size_info*, call __init. * include/profile/impl/profiler_hash_func.h (__hashfunc_into()): Delete. (__hashfunc_info(const __hashfunc_info&)): Delete. (virtual ~__hashfunc_info()): Delete. (__hashfunc_info::__merge): Call __object_info_base::__merge. (__trace_hash_func::__insert): Delete. (__trace_hash_func_free): New. (__trace_hash_func_report): Call __trace_report. (__trace_hash_func_construct): Return __hashfunc_info*. Add check for reentrancy. * include/profile/impl/profiler_hashtable_size.h (__trace_hashtable_size_free): New. (__trace_hashtable_size_report): Call __trace_report. (__trace_hashtable_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_slist.h (__list2slist_info()): Delete. (__list2slist_info(const __list2slist_info&)): Delete. (virtual ~__list2slist_info()): Delete. (__trace_list_to_slist::__merge(const __list2slist_info&)): Delete. (__trace_list_to_slist::__opr_rewind(const void*)): Delete. (__trace_list_to_slist::__record_operation(const void*)): Delete. (__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete. (__trace_list_to_slist::__destruct): Only call __retire_object. (__trace_list_to_slist_free()): New. (__trace_list_to_slist_report): Call __trace_report. (__trace_list_to_slist_construct): Return __list2slist_info*. Add check for reentrancy. * include/profile/impl/profiler_list_to_vector.h (__list2vector_info()): Delete. (__list2vector_info(const __list2vector_info&)): Delete. (virtual ~__list2vector_info()): Delete. (_list2vector_info::__is_valid): Delete. (_list2vector_info::__set_invalid): Delete. (_list2vector_info::__opr_iterate): Use atomic operation. (_list2vector_info::_M_valid): Delete. (__trace_list_to_vector::__insert): Delete. (__trace_list_to_vector::__find): Delete. (__trace_list_to_vector::__opr_insert): Delete. (__trace_list_to_vector::__opr_iterate): Delete. (__trace_list_to_vector::__invalid_operator): Delete. (__trace_list_to_vector::__resize): Delete. (__trace_list_to_vector_free): New. (__trace_list_to_vector_report): Call __trace_report. (__trace_list_to_vector_construct): Return __list2vector_info*. Add check for reentrancy. * include/profile/impl/profiler_map_to_unordered_map.h (__map2umap_info()): Delete. (__map2umap_info(const __map2umap_info&)): Delete. (virtual ~__map2umap_info()): Delete. (__map2umap_info::__record_iterate): Use atomic operation. (__map2umap_info::__set_iterate_costs): New. (__map2umap_info::__record_invalidate): Delete. (__map2umap_info::_M_valid): Delete. (__trace_map2umap::__destruct): New. (__trace_map_to_unordered_map_free): New. (__trace_map_to_unordered_map_report): Call __trace_report. (__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add check for reentrancy. * include/profile/impl/profiler_node.h (__object_t): Delete typedef. (__get_stack): Return null stack trace in case of (bad_alloc) exception. (__object_info_base()): Delete. (__object_info_base(const __object_info_base&)): Delete. (virtual ~__object_info_base()): Delete. (__object_info_base::__set_invalid): New. (__object_info_base::__merge): New. (virtual void __write(FILE*)): Delete. (class __stack_info_base): Delete. * include/profile/impl/profiler_trace.h (__global_lock): Rename into __global_mutex. (__trace_vector_size_free): New declaration. (__trace_hashtable_size_free): Likewise. (__trace_hash_func_free): Likewise. (__trace_vector_to_list_free): Likewise. (__trace_list_to_slist_free): Likewise. (__trace_list_to_vector_free): Likewise. (__trace_map_to_unordered_map_free): Likewise. (__trace_base::~__trace_base()): Not virtual anymore. Delete stored backtrace information. (__trace_base::__add_object): Return __object_info*, take only a stack trace. (__trace_base::__get_object_info): Delete. (__trace_base::__retire_object): Take __object_info* instead of __object_t. (__trace_base::__object_table_lock): Delete. (__trace_base::__stack_table_lock): Delete. (__trace_base::__object_table_t): Delete typedef. (__trace_base::__object_table): Delete. (__trace_base::__trace_mutex): New. (__trace_base::__object_byte_size): New. (__trace_report): New. (__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex rather than explicitely calling lock() method, exception safe. (__report_and_free): New. Call __report and free all profile mode resources. (__profcxx_init_unconditional): Use __scoped_lock. Register __report_and_free with atexit. * include/profile/impl/profiler_vector_size.h (__trace_vector_size_free): New. (__trace_vector_size_report): Call __trace_report. (__trace_vector_size_construct): Return __container_size_info*. Add check for reentrancy. * include/profile/impl/profiler_vector_to_list.h (__vector2list_info()): Delete. (virtual ~__vector2list_info()): Delete. (__vector2list_info(const __vector2list_info&)): Delete. (__vector2list_info::__merge): Call __object_info_base::__merge. (__vector2list_info::__is_valid): Delete. (__vector2list_info::__set_valid): Delete. (__vector2list_info::__opr_find): Delete. (__vector2list_info::_M_valid): Delete. (__trace_vector_to_list::__insert): Delete. (__trace_vector_to_list::__find): Delete. (__trace_vector_to_list::__opr_insert): Delete. (__trace_vector_to_list::__opr_iterate): Delete. (__trace_vector_to_list::__invalid_operator): Delete. (__trace_vector_to_list::__resize): Delete. (__trace_vector_to_list::__opr_find): Delete. (__trace_vector_to_list_free): New. (__trace_vector_to_list_report): Call __trace_report. (__trace_vector_to_list_construct): Return __vector2list_info*. Add check for reentrancy. * include/profile/iterator_tracker.h (__iterator_tracker<>::operator=): Add missing _M_ds assignment. (__iterator_tracker<>::_M_find): Delete. * include/profile/impl/profiler.h ([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete. (__container_size_info): Add class declaration. (__hashfunc_info): Likewise. (__map2umap_info): Likewise. (__vector2list_info): Likewise. (__list2slist_info): Likewise. (__list2vector_info): Likewise. (__trace_list_to_set_destruct): Delete declaration. (__trace_list_to_set_construct): Likewise. (__trace_list_to_set_insert): Likewise. (__trace_list_to_set_iterate): Likewise. (__trace_list_to_set_invalid_operator): Likewise. (__trace_list_to_set_find): Likewise. ([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_turn_on]): Likewise. ([__profcxx_turn_off]): Likewise. ([__profcxx_is_invalid]): Likewise. ([__profcxx_is_on]): Likewise. ([__profcxx_is_off]): Likewise. ([__profcxx_hashtable_resize]): Likewise. ([__profcxx_hashtable_destruct]): Likewise. ([__profcxx_hashtable_construct]): Likewise. ([__profcxx_vector_size_construct]): Likewise. ([__profcxx_vector_size_resize]): Likewise. ([__profcxx_vector_size_destruct]): Likewise. ([__profcxx_inefficient_hash_is_on]): Delete. ([__profcxx_hash_func_construct]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_hash_func_destruct]): Likewise. ([__profcxx_vector_construct2]): Rename into... ([__profcxx_vector2list_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_insert]): Rename into... ([__profcxx_vector2list_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_iterate]): Rename into... ([__profcxx_vector2list_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_invalid_operator]): Rename into... ([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_resize2]): Rename into... ([__profcxx_vector2list_resize]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_destruct2]): Rename into... ([__profcxx_vector2list_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_vector_find]): Delete. ([__profcxx_list_construct2]): Rename into... ([__profcxx_list2vector_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_insert]): Rename into... ([__profcxx_list2vector_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_iterate]): Rename into... ([__profcxx_list2vector_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([_profcxx_list_invalid_operator]): Rename into... ([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct2]): Rename into... ([__profcxx_list2vector_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_construct]): Rename into... ([__profcxx_list2slist_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_rewind]): Rename into... ([__profcxx_list2slist_rewind]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_operation]): Rename into... ([__profcxx_list2slist_operation]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_list_destruct]): Rename into... ([__profcxx_list2slist_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_construct]): Rename into... ([__profcxx_map2umap_construct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_insert]): Rename into... ([__profcxx_map2umap_insert]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_erase]): Rename into... ([__profcxx_map2umap_erase]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_iterate]): Rename into... ([__profcxx_map2umap_iterate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_invalidate]): Rename into... ([__profcxx_map2umap_invalidate]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_find]): Rename into... ([__profcxx_map2umap_find]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. ([__profcxx_map_to_unordered_map_destruct]): Rename into... ([__profcxx_map2umap_destruct]): ... this. Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD. * include/profile/list (_List_profile): Adapt. (_List_profile::_M_profile_construct): New. (_List_profile()): Call latter. (_List_profile::_M_profile_destruct): New. (~_List_profile()): Call latter. (_List_profile::_M_swap): New. (_List_profile(_List_profile&&)): Call latter. (_List_profile::operator=(const _List_profile&)): Reinit profile structures. (_List_profile::operator=(_List_profile&&)): Move profile struct and re-init profile structures on moved instance. (std::__profile::list<>): Adapt. * include/profile/ordered_base.h (_Ordered_profile::_M_profile_iterate): New. (_Ordered_profile::_M_profile_construct): New. (_Ordered_profile()): Call latter. (_Ordered_profile::_M_swap): New. (_Ordered_profile(_Ordered_profile&&)): Call latter. (_Ordered_profile::operator=(const _Ordered_profile&)): Reinit profiling. (_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit profiling on the moved instance. (_Ordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/map.h (std::__profile::map<>): Add profiling on iterators. Adapt. * include/profile/multimap.h (std::__profile::multimap<>): Likewise. * include/profile/set.h (std::__profile::set<>): Likewise. * include/profile/multiset.h (std::__profile::multiset<>): Likewise. * include/profile/unordered_base.h (_Unordered_profile::_M_profile_construct): New. (_Unordered_profile()): Call latter. (_Unordered_profile::_M_swap): New. (_Unordered_profile(_Unordered_profile&&)): Call latter. (_Unordered_profile::operator=(const _Unordered_profile&)): Reinit profiling. (_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit profiling on the moved instance. (_Unordered_profile::_M_profile_destruct): New. (~_Ordered_profile()): Call latter. * include/profile/unordered_map (std::__profile::unordered_map<>): Adapt. (std::__profile::unordered_multimap<>): Adapt. * include/profile/unordered_set (std::__profile::unordered_set<>): Adapt. (std::__profile::unordered_multiset<>): Adapt. * include/profile/vector (_Vector_profile_pre::_M_profile_destruct): Move... (_Vector_profile_post::_M_profile_destruct): ...here. (_Vector_profile_post::_M_profile_construct): New. (_Vector_profile_post()): Call latter. (std::__profile::vector<>): Adapt. * testsuite/ext/profile/mh.cc: Rename into... * testsuite/ext/profile/replace_new.cc: ... this and fix test. From-SVN: r217321
2014-11-10 22:51:58 +01:00
{ return __rhs < __lhs; }
template<typename _Key, typename _Compare, typename _Allocator>
void
swap(set<_Key, _Compare, _Allocator>& __x,
set<_Key, _Compare, _Allocator>& __y)
{ return __x.swap(__y); }
} // namespace __profile
} // namespace std
#endif