Bug 19023 - Type canonicalization is sensitive to struct-ness
In some debug info of some shared library, the same type can be
present as a struct in some translation units, and as a class in
others. As we are using the "pretty representation" of types to hash
types during type canonicalization, a "class foo" and "struct foo"
are (wrongly) considered different, because those pretty
representations are different.
This patch changes the canonicalization code to make it independent
from the struct-ness of the class being canonicalized.
* include/abg-ir.h (class_decl::is_struct): Declare a setter for the
"is-struct" property.
* src/abg-ir.cc (class_decl::is_struct): And define that setter
here.
(type_base::get_canonical_type_for): Temporarily set the
'is-struct' flag of the class type to 'false' before building its
pretty representation.
* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so:
New test input binary.
* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
New test reference output.
* tests/data/Makefile.am: Add the new test material above to the
source distribution.
* tests/test-read-dwarf.cc (in_out_specs): Add the two new test
inputs to the list of test inputs to consider.
* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>