]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Rename class [raw_]compile_units to [raw_]compile_units_type.
authorMark Wielaard <mjw@redhat.com>
Thu, 25 Nov 2010 12:34:46 +0000 (13:34 +0100)
committerMark Wielaard <mjw@redhat.com>
Thu, 25 Nov 2010 12:37:50 +0000 (13:37 +0100)
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.

13 files changed:
dwarflint/all-dies-it.hh
dwarflint/check_expected_trees.cc
dwarflint/check_range_out_of_scope.cc
libdw/c++/dwarf
libdw/c++/dwarf_comparator
libdw/c++/dwarf_data
libdw/c++/dwarf_edit
libdw/c++/dwarf_output
libdw/c++/dwarf_tracker
libdw/c++/output-values.cc
src/dwarfcmp.cc
tests/dwarf_edit_output.cc
tests/print-die.cc

index 10619e6ad598aee387bc68b3a2432e1d381735f3..57257e3eada1c552f0b47d119b4ddab608454cf5 100644 (file)
@@ -36,7 +36,7 @@ class all_dies_iterator
   typedef typename T::debug_info_entry::children_type::const_iterator die_it_t;
   typedef std::vector <std::pair <die_it_t, die_it_t> > 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;
index 26f0375c1fa0cea077eee64b726ea491e07eb39c..9c9329c1aa735cc704efe87a21b4e83aeea1b7f4 100644 (file)
@@ -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);
     }
index 64fc3ce6cf9e6891a32acdeb0b400c3024da21c7..0495d40512de13f57c05f6d4729bb1e44948e7b6 100644 (file)
@@ -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);
     }
index c698c1e714173f202180238941aee067627d01b3..975c1545f44e5abf9a3201c8d7491d840244c61e 100644 (file)
@@ -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<compile_unit>.
-    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<std::input_iterator_tag, compile_unit>
       {
-       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<class raw_compile_units,
+    typedef skipping_wrapper<class raw_compile_units_type,
                             compile_unit, compile_unit,
                             skip_partial_unit> 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<compile_unit>.
-    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<typename units>
       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:
index fa167e5201b262cb143f2761a64b17bb777c3dc0..af0964b9c136db5db379f655504dcbff1c6f7611 100644 (file)
@@ -59,8 +59,8 @@ namespace elfutils
   template<class dwarf1, class dwarf2>
   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));
index 4a334b4cfe39e7845d35b8994c5b21f43c841cc1..ebf5b0e4d9f4c2414c9bb4f4ace1687d8ea6c55e 100644 (file)
@@ -70,7 +70,7 @@ namespace elfutils
 
     // Main container anchoring all the output.
     template<class impl>
-    class compile_units : public std::list<typename impl::compile_unit>
+    class compile_units_type : public std::list<typename impl::compile_unit>
     {
       friend class subr::create_container;
 
@@ -79,16 +79,16 @@ namespace elfutils
 
       // Constructor copying CUs from input container.
       template<typename input, typename arg_type>
-      inline compile_units (const input &other, arg_type &arg)
-       : _base (subr::argify<input, compile_units, arg_type &>
+      inline compile_units_type (const input &other, arg_type &arg)
+       : _base (subr::argify<input, compile_units_type, arg_type &>
                 (other.begin (), arg),
-                subr::argify<input, compile_units, arg_type &>
+                subr::argify<input, compile_units_type, arg_type &>
                 (other.end (), arg))
       {}
 
     public:
       // Default constructor: an empty container, no CUs.
-      inline compile_units () {}
+      inline compile_units_type () {}
 
       template<typename other_children>
       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<typename input>
index 9b093697868768ffa13c3cd7e31abf551df8d5cb..705a5ee300abf02417d52b512957638a52515fb6 100644 (file)
@@ -269,14 +269,14 @@ namespace elfutils
     typedef dwarf_data::compile_unit<dwarf_edit> compile_unit;
 
     // Main container anchoring all the output.
-    class compile_units
-      : public dwarf_data::compile_units<dwarf_edit>
+    class compile_units_type
+      : public dwarf_data::compile_units_type<dwarf_edit>
     {
       friend class dwarf_edit;
 
     private:
-      inline compile_units (const compile_units &)
-       : dwarf_data::compile_units<dwarf_edit> ()
+      inline compile_units_type (const compile_units_type &)
+       : dwarf_data::compile_units_type<dwarf_edit> ()
       {
        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<typename input, typename tracker>
-      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<dwarf_edit, dwarf_edit> 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;
     }
index 13e02cf2dbd664a6258aeebef3cc9448d377dfca..53decf49304f9aab09796e0b9f6b7012e1cb453a 100644 (file)
@@ -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<dwarf_output>
+    class compile_units_type
+      : public dwarf_data::compile_units_type<dwarf_output>
     {
       friend class dwarf_output;
 
     private:
-      inline compile_units (const compile_units &)
-       : dwarf_data::compile_units<dwarf_output> ()
+      inline compile_units_type (const compile_units_type &)
+       : dwarf_data::compile_units_type<dwarf_output> ()
       {
        never_copy ();
       }
@@ -513,25 +513,25 @@ namespace elfutils
 
       // Constructor copying CUs from input container.
       template<typename input, typename copier>
-      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<input, copier>);
       }
 
     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<input> 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<typename file>
@@ -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<class dwarf_output::compile_units,
-                                           pending_cu> compile_units;
+      typedef subr::wrapped_input_container<class dwarf_output::compile_units_type,
+                                           pending_cu> compile_units_type;
 
       class debug_info_entry
       {
@@ -2787,7 +2787,7 @@ namespace elfutils
   extern template class dwarf_data::attributes_type<dwarf_output,
                                                    dwarf_output::value>;
   extern template class dwarf_data::compile_unit<dwarf_output>;
-  extern template class dwarf_data::compile_units<dwarf_output>;
+  extern template class dwarf_data::compile_units_type<dwarf_output>;
 
   extern template class dwarf_output::copier<dwarf>;
   extern template class dwarf_output::copier<dwarf_edit>;
index cbd253e86fc96ccd9d629f910d70995f18669c79..1281d9b4dcb83c475129d71f7f4778f54f0cc4c9 100644 (file)
@@ -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
index 044710c9e3b5ff2d626dd49ec950e47f2de138e3..f360e006f538d251ed88fc55a4b6fbba39027029 100644 (file)
@@ -60,7 +60,7 @@ template class dwarf_data::value<dwarf_output, false>;
 template class dwarf_data::attr_value<dwarf_output, dwarf_output::value>;
 template class dwarf_data::attributes_type<dwarf_output, dwarf_output::value>;
 template class dwarf_data::compile_unit<dwarf_output>;
-template class dwarf_data::compile_units<dwarf_output>;
+template class dwarf_data::compile_units_type<dwarf_output>;
 
 template class dwarf_output::copier<dwarf>;
 template class dwarf_output::copier<dwarf_edit>;
index a853284153b7ef80985d3f99241a0c4294b445da..1e086ab06779f5d2ccf4e34d321270c776e5b1e6 100644 (file)
@@ -473,12 +473,12 @@ struct talker : public dwarf_ref_tracker<dwarf1, dwarf2>
 };
 
 template<class dw>
-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)
index 5a9ab495d3a3410acfeb616cba408103d525ce1a..b1483d190345b01e7c9defe02a461f15797a2f97 100644 (file)
@@ -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<ci, ci, bool>
 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();
index 4007a092fdebf4e8d100c60dadd70c166093c415..8a7f770ce99120d161ed7ff53dd2aa0a8942b145 100644 (file)
@@ -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<file> (*i, limit, refs_shared_file ? common_refs : file_refs);