mirror of
git://sourceware.org/git/libabigail.git
synced 2025-01-05 16:59:41 +00:00
59c0a2ac7c
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> |
||
---|---|---|
.. | ||
test0.xml | ||
test1.xml | ||
test2.xml | ||
test3.xml | ||
test4.xml | ||
test5.xml | ||
test6.xml | ||
test7.xml | ||
test8.xml | ||
test9.xml | ||
test10.xml | ||
test11.xml | ||
test12.xml | ||
test13.xml | ||
test14.xml | ||
test15.xml | ||
test16.xml | ||
test17.xml | ||
test18.xml | ||
test19.xml | ||
test20.xml | ||
test21.xml | ||
test22.xml | ||
test23.xml | ||
test24.xml | ||
test25.xml | ||
test26.xml | ||
test27.xml | ||
test28-drop-std-fns.abignore | ||
test28-drop-std-vars.abignore | ||
test28-without-std-fns-ref.xml | ||
test28-without-std-fns.xml | ||
test28-without-std-vars-ref.xml | ||
test28-without-std-vars.xml | ||
test28.xml |