30 #ifndef _GLIBCXX_PROFILE_PROFILER_LIST_TO_SLIST_H
31 #define _GLIBCXX_PROFILE_PROFILER_LIST_TO_SLIST_H 1
37 namespace __gnu_profile
39 class __list2slist_info
40 :
public __object_info_base
44 : _M_rewind(false), _M_operations(0) { }
46 __list2slist_info(__stack_t __stack)
47 : __object_info_base(__stack), _M_rewind(false), _M_operations(0) { }
49 virtual ~__list2slist_info() { }
51 __list2slist_info(
const __list2slist_info& __o)
52 : __object_info_base(__o), _M_rewind(__o._M_rewind),
53 _M_operations(__o._M_operations) { }
73 __merge(
const __list2slist_info&) { }
76 __write(FILE* __f)
const
77 { std::fprintf(__f,
"%s\n", _M_rewind ?
"invalid" :
"valid"); }
81 {
return "change std::list to std::forward_list"; }
100 std::size_t _M_operations;
103 class __list2slist_stack_info
104 :
public __list2slist_info
107 __list2slist_stack_info(
const __list2slist_info& __o)
108 : __list2slist_info(__o) { }
111 class __trace_list_to_slist
112 :
public __trace_base<__list2slist_info, __list2slist_stack_info>
115 ~__trace_list_to_slist() { }
117 __trace_list_to_slist()
118 : __trace_base<__list2slist_info, __list2slist_stack_info>()
119 { __id =
"list-to-slist"; }
122 __opr_rewind(
const void* __obj)
124 __list2slist_info* __res = __get_object_info(__obj);
126 __res->__opr_rewind();
130 __record_operation(
const void* __obj)
132 __list2slist_info* __res = __get_object_info(__obj);
134 __res->__record_operation();
138 __insert(
const __object_t __obj, __stack_t __stack)
139 { __add_object(__obj, __list2slist_info(__stack)); }
142 __destruct(
const void* __obj)
147 __list2slist_info* __res = __get_object_info(__obj);
151 __retire_object(__obj);
157 __trace_list_to_slist_init()
158 { _GLIBCXX_PROFILE_DATA(_S_list_to_slist) =
new __trace_list_to_slist(); }
161 __trace_list_to_slist_report(FILE* __f, __warning_vector_t& __warnings)
163 if (_GLIBCXX_PROFILE_DATA(_S_list_to_slist))
165 _GLIBCXX_PROFILE_DATA(_S_list_to_slist)->
166 __collect_warnings(__warnings);
167 _GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__write(__f);
172 __trace_list_to_slist_rewind(
const void* __obj)
177 _GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__opr_rewind(__obj);
181 __trace_list_to_slist_operation(
const void* __obj)
186 _GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__record_operation(__obj);
190 __trace_list_to_slist_construct(
const void* __obj)
195 _GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__insert(__obj, __get_stack());
199 __trace_list_to_slist_destruct(
const void* __obj)
204 _GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__destruct(__obj);