From 20b2968716828bf4f08545f6eb3772c213d68da7 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 1 Jul 2009 18:06:37 -0700 Subject: [PATCH] convenience --- libdw/c++/dwarf_edit | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/libdw/c++/dwarf_edit b/libdw/c++/dwarf_edit index a4ff1570e..d936f1c88 100644 --- a/libdw/c++/dwarf_edit +++ b/libdw/c++/dwarf_edit @@ -115,6 +115,12 @@ namespace elfutils public: typedef debug_info_entry value_type; + + inline debug_info_entry &add_entry (int tag) + { + push_back (debug_info_entry (tag)); + return back (); + } }; class attributes_type @@ -203,6 +209,12 @@ namespace elfutils { return identity (); } + + // Convenience entry points. + inline debug_info_entry &add_entry (int child_tag) + { + return children ().add_entry (child_tag); + } }; typedef debug_info_entry::attributes_type::value_type attribute; @@ -248,10 +260,9 @@ namespace elfutils typedef _base::iterator iterator; typedef _base::const_iterator const_iterator; - inline compile_unit &new_unit () + inline compile_unit &add_unit () { - compile_unit nu; - push_back (nu); + push_back (compile_unit ()); return back (); } @@ -281,9 +292,9 @@ namespace elfutils } // Convenience entry point. - inline compile_unit &new_unit () + inline compile_unit &add_unit () { - return compile_units ().new_unit (); + return compile_units ().add_unit (); } public: -- 2.47.2