mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-22 00:37:06 +00:00
The DWARF reader assumes that the DIEs for all member types are seen by build_class_type_and_add_to_ir(), as member type DIEs of the DIE of the class. Well that assumption is not correct because there can be errors in the DWARF we are looking at. One of these errors I stumbled accross is that a DIE for a typedef that should be a member typedef is actually a child of a *function* DIE. And that function DIE is a child of the class. Go figure. In any case, get_scope_for_die() already fixes that up and behaves as if the DIE of the typedef is a child of the DIE of the class. A side effect of this is that when build_class_type_and_add_to_ir() reads the DIE of the class, it never sees the DIE for that typedef. The takeaway of this state of affairs is that we cannot rely on build_class_type_and_add_to_ir() to update the member access specifier for member types because it does not see all member types. Rather build_ir_node_from_die() detects (reliably) that the type is a member type and updates the access specifier there. I also realize that the "is_member_type" flag of build_ir_node_from_die() and friends is useless now because inside build_ir_node_from_die() to know that that the type we are building is a member type, we just need to look at the scope and see if it's a class type. So by doing all this, this patch fixes the fact that some types were not being canonicalized because build_class_type_and_add_to_ir() was not seeing them. Ahhhh, DWARF. * include/abg-fwd.h (is_class(decl_base*)): Return a class_decl* rather than just a bool. * abg-ir.cc (is_class(decl_base*)): Return a class_decl* rather than just a bool. Simplify the implementation. * src/abg-dwarf-reader.cc (maybe_set_member_type_access_specifier): Define new static function. (build_ir_node_from_die): Remove the is_member_type flag. When building member types set their access specifier. Simplify the logic of detecting that a type is a member type; basically delegate taht to the new maybe_set_member_type_access_specifier(). (build_class_type_and_add_to_ir): Do not try to set the member type access specifiers anymore. (build_qualified_type, build_pointer_type, build_reference_type) (build_typedef_type, build_var_decl, build_function_decl): Adjust. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
abg-comp-filter.h | ||
abg-comparison.h | ||
abg-config.h | ||
abg-corpus.h | ||
abg-diff-utils.h | ||
abg-dwarf-reader.h | ||
abg-fwd.h | ||
abg-hash.h | ||
abg-ini.h | ||
abg-ir.h | ||
abg-libxml-utils.h | ||
abg-libzip-utils.h | ||
abg-reader.h | ||
abg-sptr-utils.h | ||
abg-tools-utils.h | ||
abg-traverse.h | ||
abg-version.h.in | ||
abg-viz-common.h | ||
abg-viz-dot.h | ||
abg-viz-svg.h | ||
abg-writer.h | ||
Makefile.am |