Fix internal name for pointers, typedefs and arrays
authorDodji Seketeli <dodji@redhat.com>
Tue, 8 Dec 2015 11:19:57 +0000 (12:19 +0100)
committerDodji Seketeli <dodji@redhat.com>
Tue, 8 Dec 2015 13:14:09 +0000 (14:14 +0100)
commit2eda63d0f24ba85bf525628ac832472e6e4c6e70
tree3ff526c03a9bf23e4c10cdc656bb80486b79281e
parentcda1cf407f8d794185df94bd02bf10c3d649dcc9
Fix internal name for pointers, typedefs and arrays

Internal names (and pretty representation) of types are used for type
canonicalization.  These were not being correctly computed for
pointers typedefs and arrays because we were forgetting sometimes to
use internal names of the underlying types, especially because of caching issues.

This patch addresses that.

Note that I noticed this while comparing the two versions of
libgromacs_d.so.0.0.0 involved in the comparison referenced by bug
https://bugzilla.redhat.com/show_bug.cgi?id=1283906.  But then that
library is too big (and takes too much time) to be included as a non
regression test :(

* include/abg-ir.h (pointer_type_def::priv_): New data structure.
The type is now pimpled.
(typedef_decl::priv_): Likewise.
* src/abg-ir.cc (struct pointer_type_def::priv): New struct.
(pointer_type_def::pointer_type_def): Adjust.
(pointer_type_def::get_pointed_to_type): Likewise.
(pointer_type_def::get_qualified_name): Store temporary/internal
names into different caches.
(array_type_def::priv::{temp_internal_qualified_name_,
internal_qualified_name_}): New data members.
(get_type_representation): In the overload for array_type_def,
take requests for internal names into account.
(array_type_def::get_qualified_name): Take requests for internal
names into account.  Store temporary/internal names into different
caches.
(typedef_decl::priv): New struct.
(typedef_decl::typedef_decl): Adjust.
(typedef_decl::get_underlying_type): Likewise.

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