libabigail/include
Dodji Seketeli ccdc44b3eb Setup per-corpus type maps indexed by type names
This patch creates per-corpus maps that associate, for a certain kind
of type, the fully qualified name of the type to the type.

So there is a map for class_decl, one for enum_type_decl, one for
type_decl, etc.

These maps are populated when a new type is added to its scope.

The patch defines overloads of the function
maybe_update_types_lookup_map() that update the right map, depending
on the kind of type we are looking at.

Note that there also is a map in each class that associates a
signature string to a member functions.  This is so that member
functions of a given class can be looked up by signature.

This is so that looking up a type becomes now much faster than having
to walk all the translation units of a corpus to find one.

Note that this patch is specifically part of the series of patches
that implements types and declarations de-duplication while reading
DWARF information.

The patch might slightly change the output of abi serialization or
comparison so it needs some adjustments of some test reference files.
That adjustment is not done here.  Rather, it's done at once in
another patch of the set.

	* include/abg-corpus.h (corpus::priv_): Make this public so that
	functions from outside of the class can access it.  These
	functions are meant to be used only by code that is *inside*
	libabigail.so, though.
	* src/abg-corpus-priv.h: New file.
	* src/abg-corpus.cc: Include the new abg-corpus-priv.h file.
	(struct regex_t_deleter): Move this to abg-sptr-utils.h.
	(build_sptr<regex_t>): Move the declaration of this function
	template specialization to abg-sptr-utils.h and its definition to
	abg-sptr-utils.cc.
	(typedef regex_t_sptrs_type, typedef str_var_ptr_map_type)
	(struct corpus::exported_decls_builder::priv, struct
	corpus::priv): Move these declarations to the new
	abg-corpus-priv.h.
	(maybe_update_types_lookup_map): Define overloads of this (one per
	kind of type).
	(lookup_{basic, class, enum, typedef, class_or_typedef,
	class_typedef_or_enum, qualified, pointer, reference, array,
	function}_type): Define new functions.
	* include/abg-ir.h (typedef istring_type_base_wptr_map_type)
	(typedef istring_type_or_decl_base_sptr_map_type): Declare new
	typedefs.
	(class_decl::find_member_function_from_signature): Declare new
	member function.
	* src/abg-ir.cc: Include the new abg-corpus-priv.h file.
	(maybe_update_types_lookup_map): Remove this initial function.
	There are now new overloads in abg-corpus.cc for it.
	(scope_decl::{add_member_decl, insert_member_decl}): Adjust.
	(class_decl::{set_is_declaration_only, find_member_function,
	add_member_function}): Adjust.
	(class_decl::find_member_function_from_signature): Define new
	member function.
	* include/abg-sptr-utils.h (struct regex_t_deleter): Declare new
	type.
	(build_sptr<regex_t>): New build function template
	specializations.
	* src/abg-sptr-utils.cc: New file.
	* src/Makefile.am: Add src/abg-sptr-utils.cc and
	src/abg-corpus-priv.h to the build system.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-11-29 16:16:43 +01:00
..
abg-comp-filter.h Apply harmless and harmful filters in one pass 2016-11-10 14:09:50 +01:00
abg-comparison.h Support union types 2016-11-22 16:22:25 +01:00
abg-config.h Add --version option to several libabigail tools 2015-11-16 12:54:10 +01:00
abg-corpus.h Setup per-corpus type maps indexed by type names 2016-11-29 16:16:43 +01:00
abg-diff-utils.h Constify some diff-utils functor operators 2015-09-21 10:46:06 +02:00
abg-dwarf-reader.h Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00
abg-fwd.h Support union types 2016-11-22 16:22:25 +01:00
abg-hash.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-ini.h Support empty properties in INI files 2016-11-10 14:09:51 +01:00
abg-interned-str.h Cleanup namespace importing in abg-interned-str.h 2016-10-10 12:57:47 +02:00
abg-ir.h Setup per-corpus type maps indexed by type names 2016-11-29 16:16:43 +01: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 Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00
abg-sptr-utils.h Setup per-corpus type maps indexed by type names 2016-11-29 16:16:43 +01:00
abg-suppression.h Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00
abg-tools-utils.h Add ABG_ASSERT_NOT_REACHED macro 2016-07-26 20:04: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 Add --version option to several libabigail tools 2015-11-16 12:54:10 +01: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-workers.h Make API documentation of thread pools visible 2016-04-27 23:58:50 +02:00
abg-writer.h Update copyright years 2015-01-07 17:52:10 +01:00
Makefile.am Split suppression engine off of abg-comparison.{cc,h} 2016-05-08 12:29:57 +02:00