Support updating a class in the abixml reader
authorDodji Seketeli <dodji@redhat.com>
Sat, 17 Oct 2015 11:26:41 +0000 (13:26 +0200)
committerDodji Seketeli <dodji@redhat.com>
Sat, 17 Oct 2015 14:09:50 +0000 (16:09 +0200)
commit089b3fc76231723d0d15bbaba9e5f615c6741659
tree1f08713df298fc864a34daf7a25544039cd18627
parent065247c14c6b2371a5b8763e71aa821458378009
Support updating a class in the abixml reader

In DWARF, the same class declaration can be present several times but
with different "views", that is, it can be present in a first
translation unit, but without any member type; then in a subsequent
translation unit, its member types are defined.  In another, it'll be
completely defined, with all its data members and base classes.  The
DWARF reader knows how to amend the class to add new members to it, as
they show up in the debug information.

This patch adds the same functionality to the abixml reader.  The
writer has already started to write class declarations with different
"views" too, since it's started to avoid duplicating full class
definitions in every translation unit that uses them.

Without this patch, abixml misses some class members, and that is a
bug.

* include/abg-ir.h (class_decl::{find_base_class,
find_member_type, find_data_member}): Declare new member functions ..
* src/abg-ir.cc (class_decl::{find_base_class,
find_member_type, find_data_member}): ... and define them.
* src/abg-reader.cc (build_class_decl): Add the ability to update
a class to add new data members, member types and base classes to
it, if necessary.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-ir.h
src/abg-ir.cc
src/abg-reader.cc