dwarf-reader: Bug 26908 - don't crash on empty DW_TAG_partial_unit
Sometimes a DW_TAG_partial_unit (imported via a DW_TAG_imported_unit)
has no children node. That means the the DW_TAG_partial_unit has no
sub-tree.
In those cases, the dwarf-reader crashes when
ctxt.build_die_parent_relations_under tries to record the point at
which the sub-tree (which is non-existent here) of the partial unit is
imported by the DW_TAG_imported_unit DIE.
This patch avoids crashing in those cases. As this problem is
reported on libclang-cpp.so (on Fedora 33) which takes "abidw --abidiff"
five hours and ~ 20GB of ram to complete at this point (on a power7 box)
this patch doesn't have a regression test attached.
* src/abg-dwarf-reader.cc (die_has_children): Define new static
function.
(read_context::build_die_parent_relations_under): Do not try to
instantiate an imported_unit_point type for an imported unit with
no children node.
(imported_unit_point::imported_unit_point): Assert that the
imported die has a sub-tree.
(imported_unit_point::imported_unit_point): Remove useless spaces.