diff options
author | Roland McGrath <roland@redhat.com> | 2009-08-25 23:19:28 -0700 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2009-08-25 23:19:28 -0700 |
commit | d9de00a95a6bdeed5a432c4cf045f191c75fa87b (patch) | |
tree | 2b112a505ab506f9214464bb7a141b7553d03f1e | |
parent | 53c2f702277f4c50e663be7a110973779eebe080 (diff) | |
download | elfutils-d9de00a95a6bdeed5a432c4cf045f191c75fa87b.tar.gz |
Use some explicit template instantiations.
-rw-r--r-- | libdw/c++/dwarf_data | 23 | ||||
-rw-r--r-- | libdw/c++/dwarf_edit | 14 | ||||
-rw-r--r-- | libdw/c++/dwarf_output | 19 | ||||
-rw-r--r-- | libdw/c++/edit-values.cc | 8 | ||||
-rw-r--r-- | libdw/c++/output-values.cc | 8 |
5 files changed, 56 insertions, 16 deletions
diff --git a/libdw/c++/dwarf_data b/libdw/c++/dwarf_data index 8ae8453e..134ff8e3 100644 --- a/libdw/c++/dwarf_data +++ b/libdw/c++/dwarf_data @@ -153,12 +153,7 @@ namespace elfutils // Fetch the CU's DW_AT_stmt_list. inline const typename impl::line_info_table &line_info () const { - return this->attributes ()[::DW_AT_stmt_list].line_info (); - } - - inline typename impl::line_info_table &line_info () - { - return this->attributes ()[::DW_AT_stmt_list].line_info (); + return this->attributes ().at (::DW_AT_stmt_list).line_info (); } // Convenience methods for line_info_table sub-containers. @@ -167,20 +162,27 @@ namespace elfutils return line_info ().include_directories (); } - inline typename impl::directory_table &include_directories () + inline const typename impl::line_table &lines () const { - return line_info ().include_directories (); + return line_info ().lines (); } - inline const typename impl::line_table &lines () const +#if 0 // XXX const issues + inline typename impl::line_info_table &line_info () { - return line_info ().lines (); + return this->attributes ()[::DW_AT_stmt_list].line_info (); + } + + inline typename impl::directory_table &include_directories () + { + return line_info ().include_directories (); } inline typename impl::line_table &lines () { return line_info ().lines (); } +#endif }; class source_file @@ -603,6 +605,7 @@ namespace elfutils private: typedef std::pair< ::Dwarf_Word, unsigned int> _base; + protected: inline dwarf_enum () : _base (0, 0) {} diff --git a/libdw/c++/dwarf_edit b/libdw/c++/dwarf_edit index 59a55c2a..38a036e0 100644 --- a/libdw/c++/dwarf_edit +++ b/libdw/c++/dwarf_edit @@ -374,6 +374,20 @@ namespace elfutils std::string to_string<dwarf_edit::attribute> (const dwarf_edit::attribute &); template<> std::string to_string<dwarf_edit::attr_value> (const dwarf_edit::attr_value&); + + template<> + std::string dwarf_edit::line_table::to_string () const; + template<> + std::string dwarf_edit::line_info_table::to_string () const; + + // Explicit instantiations. + extern template class dwarf_data::line_entry<dwarf_edit::source_file>; + extern template class dwarf_data::line_table<dwarf_edit::line_entry>; + extern template class dwarf_data::line_info_table<dwarf_edit::directory_table, + dwarf_edit::line_table>; + extern template class dwarf_data::attr_value<dwarf_edit>; + extern template class dwarf_data::value<dwarf_edit>; + }; #endif // <elfutils/dwarf_edit> diff --git a/libdw/c++/dwarf_output b/libdw/c++/dwarf_output index 46245f9d..ddc6dab7 100644 --- a/libdw/c++/dwarf_output +++ b/libdw/c++/dwarf_output @@ -1041,13 +1041,10 @@ namespace elfutils inline tracker (const tracker &proto, typename _base::reference_match &matched, const typename _base::left_context_type &lhs, - const typename _base::die1 &a, - const typename _base::right_context_type &rhs, - const typename _base::die2 &b) - : _base (proto, matched, lhs, a, b) + const typename _base::right_context_type &rhs) + : _base (proto, matched, lhs, rhs) {} - struct walk { typename tracker1::walk _m_left; @@ -2120,6 +2117,18 @@ namespace elfutils return _m_collector->_m_locations.add (x); } }; + + // Explicit instantiations. + extern template class dwarf_data::value<dwarf_output, false>; + extern template class dwarf_data::attr_value<dwarf_output, + dwarf_output::value>; + 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_output::copier<dwarf>; + extern template class dwarf_output::copier<dwarf_edit>; }; #endif // <elfutils/dwarf_output> diff --git a/libdw/c++/edit-values.cc b/libdw/c++/edit-values.cc index eb26fbb6..976d315e 100644 --- a/libdw/c++/edit-values.cc +++ b/libdw/c++/edit-values.cc @@ -53,7 +53,13 @@ using namespace elfutils; -template dwarf::value_space dwarf_edit::attr_value::what_space () const; +// Explicit instantiations. +template class dwarf_data::line_entry<dwarf_edit::source_file>; +template class dwarf_data::line_table<dwarf_edit::line_entry>; +template class dwarf_data::line_info_table<dwarf_edit::directory_table, + dwarf_edit::line_table>; +template class dwarf_data::attr_value<dwarf_edit>; +template class dwarf_data::value<dwarf_edit>; template<> std::string diff --git a/libdw/c++/output-values.cc b/libdw/c++/output-values.cc index 1114d9b7..044710c9 100644 --- a/libdw/c++/output-values.cc +++ b/libdw/c++/output-values.cc @@ -55,7 +55,15 @@ using namespace elfutils; +// Explicit instantiations. +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_output::copier<dwarf>; +template class dwarf_output::copier<dwarf_edit>; template<> std::string |