libabigail/tests/data/test-read-write
Dodji Seketeli 59c0a2ac7c Initial support for Ada ranges
In order for abipkgdiff to handle the gnat sub-packages GCC,
Libabigail needs to understand some Ada-specific constructs.  So far,
the only unsupported construct that was problematic is the Ada Range
type.  This patch thus adds support for that Range type and so makes
it possible to handle the gnat sub-packages of GCC.

In Ada, the range type is emitted as a DW_TAG_subrange_type that is
not necessarily emitted as a property of an array type.  In C and C++
however, that DW_TAG_subrange_type is always a property of an array
type.  So the patch adds support for a so-called "free-form"
DW_TAG_subrange_type.

First, in the IR, the abigail::array_type_def::subrange_types is now a
real full blown type which can have a name and an underlying type.
That type can now be created by the both the DWARF and abixml readers.
It can also be serialized by the abixml writer.

Note that changes in the underlying type and on the name of the range
are not yet reported by the reporting engine.  That would have to be
added in a subsequent patch set.

	* include/abg-ir.h (type_maps::subrange_types): Declare new
	accessors.
	(is_ada_language, is_subrange_type): Declare new functions.
	(class array_type_def::subrange_type): Make this extend type_base
	and decl_base.
	(array_type_def::subrange_type::{get_language, operator==,
	get_pretty_representation, traverse}): Declare new member
	functions.
	(ir_node_visitor::visit_begin): Add new overloads for
	array_type::def::subrange_type.
	* src/abg-dwarf-reader.cc (build_subrange_type): Define new static
	function.
	(build_subranges_from_array_type_die): Cleanup the parameters of
	this function.
	(build_array_type): Adjust.
	(build_ir_node_from_die): Support free-form DW_TAG_subrange_type.
	(read_context::odr_is_relevant): Handle Ada.
	(die_qualified_type_name): Support DW_TAG_subrange_type.
	(die_pretty_print_type): Likewise.  Make the handling of
	DW_TAG_subrange_type use die_qualified_type_name.  Adjust the use
	of build_subranges_from_array_type_die.
	(get_scope_die): a DW_TAG_array_type cannot be a scope.  Rather,
	it's its scope that can be a scope.
	* src/abg-ir.cc (type_maps::priv::subrange_types_): New data
	member.
	(type_maps::empty): Adjust.
	(type_maps::subrange_types): Define new accessors.
	(is_ada_language, is_subrange_type): Define new functions.
	(odr_is_relevant): Support Ada.
	(maybe_update_types_lookup_map): Add an overload for
	array_type_def::subrange_type.  In the decl_base_sptr overload,
	add support for the array_type_def::subrange_type type.
	(struct array_type_def::subrange_type::priv::location_): Remove
	this as it's now carried by the parent decl_base type.
	(array_type_def::subrange_type::subrange_type): Adjust.  Take an
	environement pointer, a name, an underlying type and a language.
	(array_type_def::subrange_type::{g,s}et_underlying_type): Define
	new accessors.
	(array_type_def::subrange_type::{get_language,
	get_pretty_representation, traverse}): Define new member
	functions.
	(array_type_def::subrange_type::as_string): Add a representation
	for Ada.
	(equals): Define new overload for array_type_def::subrange_type.
	(array_type_def::subrange_type::operator==): Define three new
	overloads for decl_base, type_base and subrange_type.
	(array_type_def::subrange_type::operator!=): Define new operator.
	(get_type_representation): In the overload for array_type_def,
	support Ada.
	(array_type_def::get_language): Define new member function.
	(ir_node_visitor::visit_{begin,end}): Define new overloads for
	array_type_def::subrange_type.
	* src/abg-reader.cc (build_subrange_type): Adjust documentation.
	Support the new 'id', 'name', and 'type-id' properties.
	* src/abg-writer.cc (write_array_subrange_type): Define new static
	function.
	(write_array_type_def): Use the new write_array_subrange_type
	function.
	* tests/data/test-abidiff/test-PR18166-libtirpc.so.abi: Adjust.
	* tests/data/test-annotate/libtest23.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns-2.so.abi: Likewise.
	* tests/data/test-annotate/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-annotate/test13-pr18894.so.abi: Likewise.
	* tests/data/test-annotate/test14-pr18893.so.abi: Likewise.
	* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
	* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
	* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise.
	* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
	* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi: Likewise.
	* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
	* tests/data/test-annotate/test7.so.abi: Likewise.
	* tests/data/test-read-dwarf/PR22015-libboost_iostreams.so.abi: Likewise.
	* tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest23.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest24-drop-fns-2.so.abi: Likewise.
	* tests/data/test-read-dwarf/libtest24-drop-fns.so.abi: Likewise.
	* tests/data/test-read-dwarf/test10-pr18818-gcc.so.abi: Likewise.
	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Likewise.
	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise.
	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
	* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi: Likewise.
	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi: Likewise.
	* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.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.
	* tests/data/test-read-dwarf/test7.so.abi: Likewise.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.
	* tests/data/test-read-write/test25.xml: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-02-28 16:24:45 +01:00
..
test0.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test1.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test2.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test3.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test4.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test5.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test6.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test7.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test8.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test9.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test10.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test11.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test12.xml Fix template parameter hashing: make it know about enclosing template 2014-11-07 12:16:34 +01:00
test13.xml Fix template parameter hashing: make it know about enclosing template 2014-11-07 12:16:34 +01:00
test14.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test15.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test16.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test17.xml Adjust many reference output for the non-regression test suite 2015-08-29 16:23:16 +02:00
test18.xml Hash a class declaration the same as its definition 2015-08-21 12:07:19 +02:00
test19.xml Support new 'abi-corpus' native XML format (.abi) 2014-01-07 14:12:26 +01:00
test20.xml Hash a class declaration the same as its definition 2015-08-21 12:07:19 +02:00
test21.xml Hash a class declaration the same as its definition 2015-08-21 12:07:19 +02:00
test22.xml Implement string interning for Libabigail 2016-02-24 15:13:20 +01:00
test23.xml Implement string interning for Libabigail 2016-02-24 15:13:20 +01:00
test24.xml Handle C99 restrict qualifier and DWARFv3 DW_TAG_restrict_type. 2014-06-23 15:55:37 +02:00
test25.xml Initial support for Ada ranges 2018-02-28 16:24:45 +01:00
test26.xml Support ELF symbol visibility property 2017-07-03 17:45:47 +02:00
test27.xml Support ELF symbol visibility property 2017-07-03 17:45:47 +02:00
test28-drop-std-fns.abignore Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00
test28-drop-std-vars.abignore Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00
test28-without-std-fns-ref.xml Support ELF symbol visibility property 2017-07-03 17:45:47 +02:00
test28-without-std-fns.xml Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00
test28-without-std-vars-ref.xml Support ELF symbol visibility property 2017-07-03 17:45:47 +02:00
test28-without-std-vars.xml Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00
test28.xml Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00