mirror of
git://sourceware.org/git/libabigail.git
synced 2025-01-21 16:52:45 +00:00
b6add20f05
To support the duality concrete/abstract instance of static data member variables in DWARF, the reader needed a little bit of an overhaul. That overhaul is necessary to self-compare libLLVM.so, from llvm-libs, in fc37. Note that that self-compare is done using this command: $ fedabipkgdiff -a--self-compare --from fc37 llvm-libs So now, with this patch, the IR of a static data member is constructed only when the concrete instance DIE of the static data member is encountered. The abstract instance DIE is then read first, the IR is built from it, and then the concrete instance DIE is read for additional attributes that might be needed, like the ELF symbol attribute. The patch fixes a number of issues related to static data members representation in the IR, namely, it puts them all in their own array in the class_or_union, just like what is done for non-static data members. The ABIXML writer is updated to emit static data member from their new storage. * include/abg-ir.h (class_or_union::get_static_data_members): Declare new method. * src/abg-dwarf-reader.cc (add_or_update_class_type): Do not create any IR for the /declaration/ of static data member here. Wait for its definition from a concrete instance DIE to create the IR for it. (build_ir_node_from_die): In the DW_TAG_variable case, if we are looking at the concrete instance of a static variable (one that has a DW_AT_abstract_origin pointing to a static data member) then build the IR from it and add it to its class scope. * src/abg-ir-priv.h (class_or_union::priv::static_data_members_): Define new data member. (class_or_union::priv::priv): Stick the static data members that are in class_or_union::priv::data_members_ into class_or_union::priv::static_data_members_. * src/abg-ir.cc (maybe_adjust_canonical_type): Make sure static data members of the canonical type has the same symbols set as the data members of the canonicalized type. (class_or_union::add_data_member): Update the new class_or_union::priv::static_data_members_ when a data member is added. (class_or_union::get_non_static_data_members): Fix comments. (class_or_union::get_static_data_members): Define new member functions. (set_member_is_static): Update the new class_or_union::priv::static_data_members_ when static-ness is changed. * src/abg-writer.cc (write_decl_in_scope): Support writing pure declarations (not types). (write_translation_unit): Don't forget to write remaining global variables. (write_class_decl): Make sure to write static data members first, before writing the non-static data members. * tests/data/test-abidiff-exit/test-ld-2.28-210.so--ld-2.28-211.so.txt: 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/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-diff-dwarf-abixml/PR25409-librte_bus_dpaa.so.20.0.abi: Likewise. * tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Likewise. * tests/data/test-diff-filter/test30-pr18904-rvalueref-report2.txt: 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/test-libandroid.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/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/test22-pr19097-libstdc++.so.6.0.17.so.abi: Likewise. * tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-write/test10.xml: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
data | ||
lib | ||
.gitignore | ||
Makefile.am | ||
mockfedabipkgdiff.in | ||
print-diff-tree.cc | ||
runtestabidb1.sh.in | ||
runtestabidb2.sh.in | ||
runtestcanonicalizetypes.sh.in | ||
runtestdefaultsupprs.py.in | ||
runtestdefaultsupprspy3.sh.in | ||
runtestfedabipkgdiff.py.in | ||
runtestfedabipkgdiffpy3.sh.in | ||
runtestslowselfcompare.sh.in | ||
test-abicompat.cc | ||
test-abidiff-exit.cc | ||
test-abidiff.cc | ||
test-alt-dwarf-file.cc | ||
test-annotate.cc | ||
test-core-diff.cc | ||
test-cxx-compat.cc | ||
test-diff2.cc | ||
test-diff-dwarf-abixml.cc | ||
test-diff-dwarf.cc | ||
test-diff-filter.cc | ||
test-diff-pkg.cc | ||
test-diff-suppr.cc | ||
test-dot.cc | ||
test-elf-helpers.cc | ||
test-ini.cc | ||
test-ir-walker.cc | ||
test-kmi-whitelist.cc | ||
test-lookup-syms.cc | ||
test-read-btf.cc | ||
test-read-common.cc | ||
test-read-common.h | ||
test-read-ctf.cc | ||
test-read-dwarf.cc | ||
test-read-write.cc | ||
test-svg.cc | ||
test-symtab-reader.cc | ||
test-symtab.cc | ||
test-tools-utils.cc | ||
test-types-stability.cc | ||
test-utils.cc | ||
test-utils.h | ||
test-valgrind-suppressions.supp | ||
update-test-output.py |