]> sourceware.org Git - libabigail.git/commit
Canonicalize types non tied to any DWARF DIE
authorDodji Seketeli <dodji@redhat.com>
Wed, 24 Apr 2019 13:52:04 +0000 (15:52 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 24 Apr 2019 14:28:42 +0000 (16:28 +0200)
commit451d34d1ada2cf9bb49bfe05c625b816473f4f8b
treed6f6a3ae63efa40d71bd8c8bb4272a5871684408
parentfb6b2a5f4ce592bdcc3388908f21709236dd9c01
Canonicalize types non tied to any DWARF DIE

During DWARF reading, it can happen that some types are created that
are not tied to a given DIE.  This happens for instance when editing
the internal representation of types to better reflect the intent of
the code rather than the letter of the code; more precisely this
happens when a qualified array is edited to represent an array of
qualified elements, for instance.  In that case, the qualified element
type is created by the DWARF analyser.  And in the present incarnation
of the code, we forget to canonicalize that type.

The fact that that type is not canonicalized leads to cases where two
equivalent types can still be present in a translation unit in the
resulting abixml representation, without the abixml writer noticing
it.  That duplication can lead to unnecessary cycles in the type graph
where passes can either take one side or the other of the cycle; and
that leads to subtle heisen-changes in the emitted abixml representation.

This patch thus canonicalizes those newly created types.

* src/abg-dwarf-reader.cc
(read_context::extra_types_to_canonicalize_): Add new data member.
(read_context::{initialize, clear_types_to_canonicalize}): Adjust.
(read_context::extra_types_to_canonicalize): Create new accessor.
(read_context::schedule_type_for_late_canonicalization): Add new
overload for type_base_sptr.
(read_context::perform_late_type_canonicalizing): Perform the
canonicalization of the types created by the DWARF analyzer, but
that are not tied to any DIE.
(maybe_strip_qualification): Take a read_context&.  Schedule newly
created types (during type edition) for late canonicalization.
(build_ir_node_from_die): Adjust the call to
maybe_strip_qualification to pass a read_context.
* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
* tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise.
* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc
tests/data/test-annotate/test15-pr18892.so.abi
tests/data/test-annotate/test17-pr19027.so.abi
tests/data/test-annotate/test21-pr19092.so.abi
tests/data/test-read-dwarf/PR22122-libftdc.so.abi
tests/data/test-read-dwarf/test12-pr18844.so.abi
tests/data/test-read-dwarf/test15-pr18892.so.abi
tests/data/test-read-dwarf/test17-pr19027.so.abi
tests/data/test-read-dwarf/test21-pr19092.so.abi
tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi
This page took 0.040951 seconds and 5 git commands to generate.