From: Mark Wielaard Date: Thu, 25 Nov 2010 12:34:46 +0000 (+0100) Subject: Rename class [raw_]compile_units to [raw_]compile_units_type. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5cc7a097676055853e162689df3770007e3867b7;p=thirdparty%2Felfutils.git Rename class [raw_]compile_units to [raw_]compile_units_type. We have both functions and classes named compile_units. This can be confusing to (newer) g++ compilers. Keep the function names the same, but rename the the classes to compile_units_type. --- diff --git a/dwarflint/all-dies-it.hh b/dwarflint/all-dies-it.hh index 10619e6ad..57257e3ea 100644 --- a/dwarflint/all-dies-it.hh +++ b/dwarflint/all-dies-it.hh @@ -36,7 +36,7 @@ class all_dies_iterator typedef typename T::debug_info_entry::children_type::const_iterator die_it_t; typedef std::vector > die_it_stack_t; - typename T::compile_units::const_iterator _m_cu_it, _m_cu_it_end; + typename T::compile_units_type::const_iterator _m_cu_it, _m_cu_it_end; die_it_t _m_die_it, _m_die_it_end; die_it_stack_t _m_die_it_stack; bool _m_atend; diff --git a/dwarflint/check_expected_trees.cc b/dwarflint/check_expected_trees.cc index 26f0375c1..9c9329c1a 100644 --- a/dwarflint/check_expected_trees.cc +++ b/dwarflint/check_expected_trees.cc @@ -193,8 +193,8 @@ check_expected_trees::check_expected_trees (checkstack &stack, dwarflint &lint) } } recursively_validate; - class dwarf::compile_units const &cus = dw.compile_units (); - for (dwarf::compile_units::const_iterator it = cus.begin (); + class dwarf::compile_units_type const &cus = dw.compile_units (); + for (dwarf::compile_units_type::const_iterator it = cus.begin (); it != cus.end (); ++it) recursively_validate (*it, *it); } diff --git a/dwarflint/check_range_out_of_scope.cc b/dwarflint/check_range_out_of_scope.cc index 64fc3ce6c..0495d4051 100644 --- a/dwarflint/check_range_out_of_scope.cc +++ b/dwarflint/check_range_out_of_scope.cc @@ -71,11 +71,11 @@ check_range_out_of_scope::check_range_out_of_scope (checkstack &stack, dwarflint { try { - class dwarf::compile_units const &cus = dw.compile_units (); + class dwarf::compile_units_type const &cus = dw.compile_units (); ranges_t r; r.push_back (std::make_pair (0, -1)); where wh = WHERE (sec_info, NULL); - for (dwarf::compile_units::const_iterator it = cus.begin (); + for (dwarf::compile_units_type::const_iterator it = cus.begin (); it != cus.end (); ++it) recursively_validate (*it, *it, r, wh); } diff --git a/libdw/c++/dwarf b/libdw/c++/dwarf index c698c1e71..975c1545f 100644 --- a/libdw/c++/dwarf +++ b/libdw/c++/dwarf @@ -2154,24 +2154,24 @@ namespace elfutils // Container for raw CUs in file order, intended to be compatible // with a read-only subset of std::list. - class raw_compile_units + class raw_compile_units_type { friend class dwarf; private: const dwarf &_m_file; - raw_compile_units (const dwarf &file) : _m_file (file) {} + raw_compile_units_type (const dwarf &file) : _m_file (file) {} public: typedef compile_unit value_type; - inline raw_compile_units (const raw_compile_units &u) + inline raw_compile_units_type (const raw_compile_units_type &u) : _m_file (u._m_file) {} class const_iterator : public std::iterator { - friend class raw_compile_units; + friend class raw_compile_units_type; private: debug_info_entry _m_die; const dwarf *_m_file; // XXX @@ -2244,9 +2244,9 @@ namespace elfutils return const_iterator (); } }; - inline raw_compile_units raw_compile_units () const + inline raw_compile_units_type raw_compile_units () const { - return raw_compile_units::raw_compile_units (*this); + return raw_compile_units_type::raw_compile_units_type (*this); } private: @@ -2263,7 +2263,7 @@ namespace elfutils } } - typedef skipping_wrapper compile_units_base; @@ -2271,16 +2271,16 @@ namespace elfutils // Container for logical CUs in file order, intended to be compatible // with a read-only subset of std::list. - class compile_units : public compile_units_base + class compile_units_type : public compile_units_base { friend class dwarf; private: - compile_units (class raw_compile_units raw) : compile_units_base (raw) {} + compile_units_type (class raw_compile_units_type raw) : compile_units_base (raw) {} public: typedef compile_unit value_type; - compile_units (const compile_units &u) : compile_units_base (u) {} + compile_units_type (const compile_units_type &u) : compile_units_base (u) {} template bool operator== (const units &other) const @@ -2293,9 +2293,9 @@ namespace elfutils return !(*this == other); } }; - inline class compile_units compile_units () const + inline class compile_units_type compile_units () const { - return compile_units::compile_units (raw_compile_units ()); + return compile_units_type::compile_units_type (raw_compile_units ()); } private: diff --git a/libdw/c++/dwarf_comparator b/libdw/c++/dwarf_comparator index fa167e520..af0964b9c 100644 --- a/libdw/c++/dwarf_comparator +++ b/libdw/c++/dwarf_comparator @@ -59,8 +59,8 @@ namespace elfutils template struct dwarf_tracker_base { - typedef typename dwarf1::compile_units::const_iterator cu1; - typedef typename dwarf2::compile_units::const_iterator cu2; + typedef typename dwarf1::compile_units_type::const_iterator cu1; + typedef typename dwarf2::compile_units_type::const_iterator cu2; typedef typename dwarf1::debug_info_entry dwarf1_die; typedef typename dwarf2::debug_info_entry dwarf2_die; typedef typename dwarf1_die::children_type::const_iterator die1; @@ -229,10 +229,10 @@ namespace elfutils return match (a.compile_units (), b.compile_units ()); } - typedef typename dwarf1::compile_units compile_units1; - typedef typename dwarf2::compile_units compile_units2; - typedef typename dwarf1::compile_units::const_iterator cu1_it; - typedef typename dwarf2::compile_units::const_iterator cu2_it; + typedef typename dwarf1::compile_units_type compile_units1; + typedef typename dwarf2::compile_units_type compile_units2; + typedef typename dwarf1::compile_units_type::const_iterator cu1_it; + typedef typename dwarf2::compile_units_type::const_iterator cu2_it; inline bool match (const compile_units1 &a, const compile_units2 &b) { cu1_it it1 = a.begin (); @@ -242,7 +242,7 @@ namespace elfutils do { if (subr::container_equal - (it1, end1, it2, end2, MATCHER (compile_units))) + (it1, end1, it2, end2, MATCHER (compile_units_type))) return true; } while (_m_tracker.mismatch (it1, end1, it2, end2)); diff --git a/libdw/c++/dwarf_data b/libdw/c++/dwarf_data index 4a334b4cf..ebf5b0e4d 100644 --- a/libdw/c++/dwarf_data +++ b/libdw/c++/dwarf_data @@ -70,7 +70,7 @@ namespace elfutils // Main container anchoring all the output. template - class compile_units : public std::list + class compile_units_type : public std::list { friend class subr::create_container; @@ -79,16 +79,16 @@ namespace elfutils // Constructor copying CUs from input container. template - inline compile_units (const input &other, arg_type &arg) - : _base (subr::argify + inline compile_units_type (const input &other, arg_type &arg) + : _base (subr::argify (other.begin (), arg), - subr::argify + subr::argify (other.end (), arg)) {} public: // Default constructor: an empty container, no CUs. - inline compile_units () {} + inline compile_units_type () {} template bool operator== (const other_children &other) const @@ -106,7 +106,7 @@ namespace elfutils class compile_unit : public impl::debug_info_entry { friend class subr::create_container; - friend class impl::compile_units; + friend class impl::compile_units_type; protected: template diff --git a/libdw/c++/dwarf_edit b/libdw/c++/dwarf_edit index 9b0936978..705a5ee30 100644 --- a/libdw/c++/dwarf_edit +++ b/libdw/c++/dwarf_edit @@ -269,14 +269,14 @@ namespace elfutils typedef dwarf_data::compile_unit compile_unit; // Main container anchoring all the output. - class compile_units - : public dwarf_data::compile_units + class compile_units_type + : public dwarf_data::compile_units_type { friend class dwarf_edit; private: - inline compile_units (const compile_units &) - : dwarf_data::compile_units () + inline compile_units_type (const compile_units_type &) + : dwarf_data::compile_units_type () { throw std::logic_error ("must copy-construct top-level dwarf_edit object instead"); @@ -284,14 +284,14 @@ namespace elfutils // Constructor copying CUs from input container. template - inline compile_units (const input &other, tracker &t) + inline compile_units_type (const input &other, tracker &t) { subr::create_container (this, other, t); } public: // Default constructor: an empty container, no CUs. - inline compile_units () {} + inline compile_units_type () {} inline compile_unit &add_unit () { @@ -301,16 +301,16 @@ namespace elfutils }; private: - compile_units _m_units; + compile_units_type _m_units; typedef dwarf_ref_maker edit_ref_maker; public: - class compile_units &compile_units () + class compile_units_type &compile_units () { return _m_units; } - const class compile_units &compile_units () const + const class compile_units_type &compile_units () const { return _m_units; } diff --git a/libdw/c++/dwarf_output b/libdw/c++/dwarf_output index 13e02cf2d..53decf493 100644 --- a/libdw/c++/dwarf_output +++ b/libdw/c++/dwarf_output @@ -96,7 +96,7 @@ namespace elfutils typedef dwarf_data::range_list range_list; typedef dwarf_data::location_attr location_attr; - class compile_units; + class compile_units_type; class debug_info_entry; class attr_value; @@ -489,14 +489,14 @@ namespace elfutils and construct a new dwarf_output object by copying using that collector (or, equivalently, call o.compile_units ().recollect (C) on the new collector C). */ - class compile_units - : public dwarf_data::compile_units + class compile_units_type + : public dwarf_data::compile_units_type { friend class dwarf_output; private: - inline compile_units (const compile_units &) - : dwarf_data::compile_units () + inline compile_units_type (const compile_units_type &) + : dwarf_data::compile_units_type () { never_copy (); } @@ -513,25 +513,25 @@ namespace elfutils // Constructor copying CUs from input container. template - inline compile_units (const input &other, copier &c) + inline compile_units_type (const input &other, copier &c) { subr::create_container (this, other, c, cu_maker); } public: // Default constructor: an empty container, no CUs. - inline compile_units () {} + inline compile_units_type () {} }; private: - compile_units _m_units; + compile_units_type _m_units; public: - class compile_units &compile_units () + class compile_units_type &compile_units () { return _m_units; } - const class compile_units &compile_units () const + const class compile_units_type &compile_units () const { return _m_units; } @@ -561,7 +561,7 @@ namespace elfutils inline dwarf_output (const input &dw, dwarf_output_collector &c) { copier maker (c); - _m_units.swap (compile_units::compile_units (dw.compile_units (), maker)); + _m_units.swap (compile_units_type::compile_units_type (dw.compile_units (), maker)); } template @@ -1914,8 +1914,8 @@ namespace elfutils // Create a whole CU in the output. inline void - make_unit (const typename dw::compile_units::const_iterator &in, - const compile_units::iterator &out) + make_unit (const typename dw::compile_units_type::const_iterator &in, + const compile_units_type::iterator &out) { die_info_pair *cu = unit_copier (this, *in).final_unit (); @@ -1980,8 +1980,8 @@ namespace elfutils public: // Not really used so far, just for completeness. - typedef subr::wrapped_input_container compile_units; + typedef subr::wrapped_input_container compile_units_type; class debug_info_entry { @@ -2787,7 +2787,7 @@ namespace elfutils extern template class dwarf_data::attributes_type; extern template class dwarf_data::compile_unit; - extern template class dwarf_data::compile_units; + extern template class dwarf_data::compile_units_type; extern template class dwarf_output::copier; extern template class dwarf_output::copier; diff --git a/libdw/c++/dwarf_tracker b/libdw/c++/dwarf_tracker index cbd253e86..1281d9b4d 100644 --- a/libdw/c++/dwarf_tracker +++ b/libdw/c++/dwarf_tracker @@ -63,7 +63,7 @@ namespace elfutils class dwarf_path_finder { public: - typedef typename dw::compile_units::const_iterator cu; + typedef typename dw::compile_units_type::const_iterator cu; typedef typename dw::debug_info_entry::children_type::const_iterator die; /* We maintain the current path down the logical DIE tree from the CU diff --git a/libdw/c++/output-values.cc b/libdw/c++/output-values.cc index 044710c9e..f360e006f 100644 --- a/libdw/c++/output-values.cc +++ b/libdw/c++/output-values.cc @@ -60,7 +60,7 @@ template class dwarf_data::value; template class dwarf_data::attr_value; template class dwarf_data::attributes_type; template class dwarf_data::compile_unit; -template class dwarf_data::compile_units; +template class dwarf_data::compile_units_type; template class dwarf_output::copier; template class dwarf_output::copier; diff --git a/src/dwarfcmp.cc b/src/dwarfcmp.cc index a85328415..1e086ab06 100644 --- a/src/dwarfcmp.cc +++ b/src/dwarfcmp.cc @@ -473,12 +473,12 @@ struct talker : public dwarf_ref_tracker }; template -static inline typename dw::compile_units::const_iterator +static inline typename dw::compile_units_type::const_iterator find_cu (const dw &file, const typename dw::debug_info_entry &entry) { dwarf::debug_info_entry::identity_type id = entry.compile_unit ().identity (); - for (typename dw::compile_units::const_iterator cu + for (typename dw::compile_units_type::const_iterator cu = file.compile_units ().begin (); cu != file.compile_units ().end (); ++cu) diff --git a/tests/dwarf_edit_output.cc b/tests/dwarf_edit_output.cc index 5a9ab495d..b1483d190 100644 --- a/tests/dwarf_edit_output.cc +++ b/tests/dwarf_edit_output.cc @@ -68,7 +68,7 @@ struct cmp const dwarf_edit::debug_info_entry &b, const dwarf_edit &dw) { - dwarf_edit::compile_units::const_iterator cu1, cu2; + dwarf_edit::compile_units_type::const_iterator cu1, cu2; cu1 = dw.compile_units ().begin (); cu2 = dw.compile_units ().begin (); cu2++; @@ -82,7 +82,7 @@ struct cmp bool compare_first_two_cus (const dwarf_edit &dw) { - dwarf_edit::compile_units::const_iterator cu1, cu2; + dwarf_edit::compile_units_type::const_iterator cu1, cu2; cu1 = dw.compile_units ().begin (); cu2 = dw.compile_units ().begin (); cu2++; @@ -486,7 +486,7 @@ void test_last_two_dies (dwarf_edit &in, dwarf_output &out, int tag, bool same, int n, const char *name) { - dwarf_edit::compile_units::const_iterator cu_in; + dwarf_edit::compile_units_type::const_iterator cu_in; dwarf_edit::debug_info_entry::children_type::const_iterator it_in; const dwarf_edit::debug_info_entry *die1 = NULL; const dwarf_edit::debug_info_entry *die2 = NULL; @@ -523,7 +523,7 @@ test_last_two_dies (dwarf_edit &in, dwarf_output &out, int tag, bool same, dwarf_tag_string (tag), n, name); } - dwarf_output::compile_units::const_iterator cu; + dwarf_output::compile_units_type::const_iterator cu; dwarf_output::debug_info_entry::children_type::const_iterator it; ::Dwarf_Off off1 = 0; ::Dwarf_Off off2 = 0; @@ -575,7 +575,7 @@ struct match_offset : public std::binary_function bool test_first_two_cus (dwarf_output &out) { - dwarf_output::compile_units::const_iterator cu; + dwarf_output::compile_units_type::const_iterator cu; cu = out.compile_units ().begin (); ci children1 = (*cu).children ().begin (); ci end1 = (*cu).children ().end(); diff --git a/tests/print-die.cc b/tests/print-die.cc index 4007a092f..8a7f770ce 100644 --- a/tests/print-die.cc +++ b/tests/print-die.cc @@ -315,7 +315,7 @@ print_file (const file &dw, const unsigned int limit) static refs_map common_refs; refs_map file_refs; - for (typename file::compile_units::const_iterator i + for (typename file::compile_units_type::const_iterator i = dw.compile_units ().begin (); i != dw.compile_units ().end (); ++i) if (refs_shared_cu) print_cu (*i, limit, refs_shared_file ? common_refs : file_refs);