mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-16 23:14:36 +00:00
The Git repository of the Libabigail Project
a07fce3669
There are two views for internal pretty representation of anonymous classes. 1/ When we look at the anonymous class itself, we use its 'flat representation' i.e: 'class {int blah; char bleh;}' 2/ When we look at a pointer or a reference to the anonymous class we use its generic anonymous internal name, i.e: '__anonymous_struct__*' As a general rule, libabigail always use the keyword 'class' to prefix the name of classes for internal purposes, independent from the fact that the type is a struct or a class. That is a pre-requisite to be able to canonicalize classes and structs together. In other words, if a class and a struct are structurally equal, they are going to be considered equivalent by the canonicalization process. Currently however, in the view 1/ of the pretty representation of anonymous classes, a struct and a class will have different representations. For instance, and empty anonymous struct would be represented as 'struct {}', whereas an empty anonymous class would be represented as 'class {}'. This prevents these two be considered equivalent by the canonicalization process. This leads to spurious change reports later down the road. In the view 2/ we have a similar but different problem: the qualified names of the anonymous classes are not taken into account when representing pointer or references to said anonymous classes. Only their unqualified generic anonymous internal names are taken into account in the representation. This leads to pointers/references to anonymous classes being wrongly considered equivalent even when they belong to different namespaces. This patch corrects the issues related to both views 1/ and 2/. It should make libabigail correctly consider some anonymous classes as equivalent (view 1) and correctly consider pointers/references to anonymous classes as different when they belong to different namespaces (view 2). A number of reference tests are adjusted accordingly. * include/abg-fwd.h (get_class_or_union_flat_representation): Introduce an "internal" parameter. * src/abg-ir.cc (get_class_or_union_flat_representation): Introduce an "internal" parameter. In the flat representation of a class for internal purposes, always use the prefix "class" even if this is a struct. (get_type_name): To build an internal name for a reference or pointer to an anonymous type, consider the namespace name of said type. (equals): In the overload for decl_base, take the namespace name of anonymous decls into account when comparing them. ({var_decl, union_decl}::get_pretty_representation): Adjust calls to get_class_or_union_flat_representation to pass a proper "internal" argument. * src/abg-default-reporter.cc (default_reporter::report): Adjust the call to get_class_or_union_flat_representation to pass an "internal" argument set to 'false'. * tests/data/test-annotate/libtest23.so.abi: Adjust. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Likewise. * tests/data/test-read-dwarf/libtest23.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/test9-pr18818-clang.so.abi: Likewise. * tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
autoconf-archive | ||
bash-completion | ||
doc | ||
include | ||
m4 | ||
scripts | ||
src | ||
tests | ||
tools | ||
.clang-format | ||
.gitignore | ||
abigail.m4 | ||
AUTHORS | ||
ChangeLog | ||
COMMIT-LOG-GUIDELINES | ||
COMPILING | ||
configure.ac | ||
CONTRIBUTING | ||
COPYING | ||
COPYING-GPLV3 | ||
COPYING-LGPLV2 | ||
COPYING-LGPLV3 | ||
default.abignore | ||
gen-changelog.py | ||
install-sh | ||
libabigail.pc.in | ||
ltmain.sh | ||
Makefile.am | ||
NEWS | ||
README | ||
release-text-template.txt | ||
update-copyright.sh | ||
VISIBILITY |
This is the Application Binary Interface Generic Analysis and Instrumentation Library. It aims at constructing, manipulating, serializing and de-serializing ABI-relevant artifacts. The set of artifacts that we are intersted is made of quantities like types, variable, fonctions and declarations of a given library or program. For a given library or program this set of quantities is called an ABI corpus. This library aims at (among other things) providing a way to compare two ABI Corpora (apparently the plural of corpus is copora, heh, that's cool), provide detailed information about their differences, and help build tools to infer interesting conclusions about these differences. You are welcome to contribute to this project after reading the files CONTRIBUTING and COMMIT-LOG-GUIDELINES files in the source tree. Communicating with the maintainers of this project -- including sending patches to be include to the source code -- happens via email at libabigail@sourceware.org.