libabigail/include
Dodji Seketeli bd161caa52 Make type_has_non_canonicalized_subtype() tighter
type_has_non_canonicalized_subtype() gives up too quickly.

For instance, suppose it's looking a type 'foo'.  If foo has no
canonicalized type yet and has a data member which type is foo* (for
instance), then type_has_non_canonicalized_subtype() just sees that
type 'foo*' has no canonicalized type, and so it returns, saying that
he found a non-canonicalized subtype for foo.

In that case though, what type_has_non_canonicalized_subtype() should
do is detect that foo* is a pointer to foo itself, so it shouldn't
count as a non-canonicalized sub-type.  It should keep going and look
for other meaningful non-canonicalized sub-types.

And this what this patch does.  It changes the sub-type walker that
type_has_non_canonicalized_subtype() uses, so that

   - it doesn't flag sub-types that refer to the type we are looking
     at as non-canonicalized sub-types.  This is for sub-types that
     are combinations of pointers, references and typedefs.

   - it doesn't consider sub-types of member functions of the type we
     are looking at, unless that member function is virtual.

The result is that more types are canonicalized early during DWARF
reading, and so there are less types to store on the side for late
canonicalization.  This can have a big impact on, e.g, C++ libraries
with tens of thousands of types.

	* include/abg-fwd.h (is_typedef, is_pointer_type)
	(is_reference_type): Declare new overloads.
	(peel_typedef_type): Renamed get_typedef_underlying_type into
	this.
	(peel_pointer_type, peel_reference_type)
	(peel_typedef_pointer_or_reference_type): Declare new functions.
	* src/abg-ir.cc (peel_typedef_type): Renamed
	get_typedef_underlying_type into this.
	(is_typedef, is_pointer_type, is_reference_type): Define new
	overloads.
	(peel_pointer_type, peel_reference_type)
	(peel_typedef_pointer_or_reference_type): Define new functions.
	(non_canonicalized_subtype_detector::has_non_canonical_type_):
	Make the type of this data member be a type_base*, not a bool.
	This is so that we can return the first non-canonicalized subtype
	of the type we are looking at.
	(non_canonicalized_subtype_detector::non_canonicalized_subtype_detector):
	Adjust the data member initialization.
	(non_canonicalized_subtype_detector::visit_begin): Add an overload
	for function_decl*, to avoid looking into non-virtual member
	functions.
	In the overload for type_base*, peel typedefs, pointers and
	reference of each sub-type that has no canonical type, to see if
	refers to the type we are actually walking.  If yes, then keep
	going.
	(type_has_non_canonicalized_subtype): Return the non-canonicalized
	sub-type found.
	* src/abg-comparison.cc (type_suppression::suppresses_diff):
	Adjust for the get_typedef_underlying_type -> peel_typedef_type
	renaming.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-08-19 18:12:27 +02:00
..
abg-comp-filter.h Bug 17649 Avoid endless looping on diff graph with cycles 2015-02-21 15:16:48 +01:00
abg-comparison.h Update diff stats when added symbols are removed from change report 2015-08-06 15:15:41 +02:00
abg-config.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-corpus.h Consider default symbol versions when computing added/removed fns/vars 2015-07-24 14:04:11 +02:00
abg-diff-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-dwarf-reader.h Remove the last direct fiddling with ELF from abipkgdiff.cc 2015-07-17 10:09:57 +02:00
abg-fwd.h Make type_has_non_canonicalized_subtype() tighter 2015-08-19 18:12:27 +02:00
abg-hash.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-ini.h Support specifying data member insertion in suppressions 2015-05-24 23:43:02 +02:00
abg-ir.h Make decl_base::get_qualified_name() work when decl context changes 2015-08-19 18:09:29 +02:00
abg-libxml-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-libzip-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-reader.h Handle the life time of the map of canonical types 2015-07-09 11:12:40 +02:00
abg-sptr-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-tools-utils.h Add support for .deb files to abipkgdiff 2015-08-14 13:36:23 +02:00
abg-traverse.h Canonicalize types either early or late after TU reading 2015-02-18 21:32:37 +01:00
abg-version.h.in Collapse subdir of include to include. 2013-08-14 15:07:18 +02:00
abg-viz-common.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-viz-dot.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-viz-svg.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-writer.h Update copyright years 2015-01-07 17:52:10 +01:00
Makefile.am Expose a new libabigail::tools_utils namespace 2015-01-08 12:28:14 +01:00