]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Remove unused try-catch-throw blocks.
authorMark Wielaard <mjw@redhat.com>
Tue, 1 Feb 2011 10:10:09 +0000 (11:10 +0100)
committerMark Wielaard <mjw@redhat.com>
Tue, 1 Feb 2011 10:10:09 +0000 (11:10 +0100)
There isn't any "recatcher" of these throws, so the only thing the
cleanup does is hide the original exception in case of error, making
debugging the root cause harder.

libdw/c++/dwarf_edit
libdw/c++/dwarf_output

index e7ed54e12fe6db7f350621b933d4d60974b119fd..854c2769599abd45a2abef150358e60077063003 100644 (file)
@@ -164,22 +164,11 @@ namespace elfutils
       template<typename die_type, typename arg_type>
       inline void set (const die_type &die, arg_type &arg)
       {
-       try
-         {
-           _m_tag = die.tag ();
-           attributes_type t_attrs (die.attributes (), arg);
-           _m_attributes.swap (t_attrs);
-           children_type t_children (die.children (), arg);
-           _m_children.swap (t_children);
-         }
-       catch (...)
-         {
-           // Never leave a partially-formed DIE.
-           _m_tag = -1;
-           _m_attributes.clear ();
-           _m_children.clear ();
-           throw;
-         };
+       _m_tag = die.tag ();
+       attributes_type t_attrs (die.attributes (), arg);
+       _m_attributes.swap (t_attrs);
+       children_type t_children (die.children (), arg);
+       _m_children.swap (t_children);
       }
 
     public:
index 04ace9646af95653c7521d885be10518728ad091..8b14c6c51cc554ef60fe3bf39f24479e86df5cc9 100644 (file)
@@ -1875,21 +1875,13 @@ namespace elfutils
        assert (_m_in->_m_pending == NULL);
        _m_in->_m_pending = _m_out;
 
-       try
-         {
-           // This calls add_reference for each pending reference.
-           _m_out->_m_attributes.set (in.attributes (), *this);
+       // This calls add_reference for each pending reference.
+       _m_out->_m_attributes.set (in.attributes (), *this);
 
-           for (input_die_ptr i = in.children ().begin ();
-                i != in.children ().end ();
-                ++i)
-             add_child (*i);
-         }
-       catch (...)
-         {
-           _m_in->_m_pending = NULL;
-           throw;
-         }
+       for (input_die_ptr i = in.children ().begin ();
+            i != in.children ().end ();
+            ++i)
+         add_child (*i);
 
        _m_out = NULL;
        _m_in->defined_self (_m_copier);