From: Dodji Seketeli <dodji@redhat.com>
To: Dodji Seketeli <dodji@redhat.com>
Cc: libabigail@sourceware.org
Subject: [PATCH 14/16] ir: Use non qualified typedef name for type canonicalization
Date: Thu, 07 Sep 2023 16:08:24 +0200 [thread overview]
Message-ID: <87sf7qdqjr.fsf@redhat.com> (raw)
In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200")
[-- Attachment #1: Type: text/plain, Size: 6625 bytes --]
Hello,
While looking into fixing self-comparison errors for the gcc-gnat
package[1], I stumbled upon the fact that a typedef that is defined in
the global scope is different from a typedef defined in a scope, even
if they both point to the same underlying type. This is a spurious
difference that feeds a spurious explosion of the number of canonical
types, for no reason. It can lead to spurious self-comparison errors
down the road. Sadly, fixing this issue is not enough to fix the
self-comparison error in [1].
[1]: The command is:
$ fedabipkgdiff --self-compare -a --from fc37 gcc-gnat
* include/abg-ir.h (reference_type_def::{pointed_to_type_,
is_lvalue_}): Remove these data members.
(reference_type_def::priv_): Add a unique data member.
(typedef_decl::get_qualified_name): Add new virtual member
functions.
* src/abg-ir.cc (get_decl_name_for_comparison): If the decl we are
comparing is a typedef, only consider its non-qualified name.
(get_type_name): For internal purposes, the type name of a typedef
is its non-qualified name.
(pointer_type_def::get_qualified_name): For internal purposes, if
the pointed-to name is a typedef, use the non-qualified name of
the typedef.
(reference_type_def::priv): Define new data type.
(reference_type_def::reference_type_def): Initialize the new
reference_type_def::priv_ data member and adjust to the move of
the reference_type_def::pointed_to_type_ data member to
reference_type_def::priv::pointed_to_type_.
(reference_type_def::{s,g}et_pointed_to_type): Adjust.
(reference_type_def::is_lvalue): Likewise.
(reference_type_def::get_qualified_name): Support caching
qualified names for internal and non-internal purposes.
(typedef_decl::get_pretty_representation): For internal purposes,
use non-qualified typedef name.
(typedef_decl::get_qualified_name): Define the two overloads for
this virtual member function.
(function_decl::get_pretty_representation): Use the
'qualified_name' parameter. Also, rather than systematically
using the qualified name of the return type, use get_type_name
instead that knows when to use qualified names and when not to.
(qualified_name_setter::do_update):
* tests/data/test-abidiff/test-PR18791-report0.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/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/test42-PR21296-clanggcc-report0.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-libaaudio.so.abi: Likewise.
* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
* tests/data/test-read-dwarf/test0.hash.abi: Likewise.
* tests/data/test-read-dwarf/test1.hash.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/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/test28-without-std-fns-ref.xml:
Likewise.
* tests/data/test-read-write/test28-without-std-vars-ref.xml:
Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
include/abg-ir.h | 11 +-
src/abg-ir.cc | 182 +-
.../test-abidiff/test-PR18791-report0.txt | 13 -
tests/data/test-annotate/libtest23.so.abi | 132 +-
.../test-annotate/libtest24-drop-fns-2.so.abi | 598 +-
.../test-annotate/libtest24-drop-fns.so.abi | 598 +-
.../data/test-annotate/test15-pr18892.so.abi | 14124 +++---
.../data/test-annotate/test17-pr19027.so.abi | 1238 +-
...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 4426 +-
...19-pr19023-libtcmalloc_and_profiler.so.abi | 3824 +-
...st20-pr19025-libvtkParallelCore-6.1.so.abi | 6670 ++-
.../test42-PR21296-clanggcc-report0.txt | 14 +-
.../PR22015-libboost_iostreams.so.abi | 2305 +-
.../test-read-dwarf/PR22122-libftdc.so.abi | 14743 +++---
tests/data/test-read-dwarf/libtest23.so.abi | 131 +-
.../libtest24-drop-fns-2.so.abi | 586 +-
.../test-read-dwarf/libtest24-drop-fns.so.abi | 586 +-
.../test-read-dwarf/test-libaaudio.so.abi | 4 +-
.../test-read-dwarf/test-libandroid.so.abi | 10274 ++--
tests/data/test-read-dwarf/test0.hash.abi | 4 +-
tests/data/test-read-dwarf/test1.hash.abi | 10 +-
.../test-read-dwarf/test10-pr18818-gcc.so.abi | 2902 +-
.../test-read-dwarf/test11-pr18828.so.abi | 9501 ++--
.../test-read-dwarf/test12-pr18844.so.abi | 23913 +++++----
.../test-read-dwarf/test15-pr18892.so.abi | 13953 +++---
.../test-read-dwarf/test16-pr18904.so.abi | 13513 +++--
.../test-read-dwarf/test17-pr19027.so.abi | 1248 +-
...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 4403 +-
...19-pr19023-libtcmalloc_and_profiler.so.abi | 3750 +-
...st20-pr19025-libvtkParallelCore-6.1.so.abi | 6651 ++-
.../test22-pr19097-libstdc++.so.6.0.17.so.abi | 41099 ++++++++--------
.../test9-pr18818-clang.so.abi | 2628 +-
.../test28-without-std-fns-ref.xml | 350 +-
.../test28-without-std-vars-ref.xml | 348 +-
34 files changed, 89416 insertions(+), 95316 deletions(-)
The file is too large for the mailing list so I am attaching it gzipped.
[-- Attachment #2: 0014-ir-Use-non-qualified-typedef-name-for-type-canonical.patch.gz --]
[-- Type: application/gzip, Size: 1915057 bytes --]
[-- Attachment #3: Type: text/plain, Size: 13 bytes --]
--
Dodji
next prev parent reply other threads:[~2023-09-07 14:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-07 13:32 [PATCH 00/16] Fixing various issues found while working on PR30309 Dodji Seketeli
2023-09-07 13:34 ` [PATCH 01/16] reader: fix indentation Dodji Seketeli
2023-09-07 13:35 ` [PATCH 02/16] tools-utils: Fix indentation Dodji Seketeli
2023-09-07 13:38 ` [PATCH 03/16] dwarf-reader,ir: Make logging a property of the middle end Dodji Seketeli
2023-09-07 13:39 ` [PATCH 04/16] dwarf-reader: Fix some logging Dodji Seketeli
2023-09-07 13:39 ` [PATCH 05/16] abipkgdiff: Initialize libxml2 to use it in a multi-thread context Dodji Seketeli
2023-09-07 13:40 ` [PATCH 06/16] tools-utils: Avoid endless loop Dodji Seketeli
2023-09-07 13:41 ` [PATCH 07/16] {dwarf,elf}reader: Don't consider no symbol table as an error Dodji Seketeli
2023-09-07 13:41 ` [PATCH 08/16] abipkgdiff: Avoid comparing binaries that are outside of the package Dodji Seketeli
2023-09-07 13:42 ` [PATCH 09/16] ir: Add missing ABG_RETURN in the comparison engine Dodji Seketeli
2023-09-07 14:02 ` [PATCH 10/16] ir: Add fn types to type lookup maps Dodji Seketeli
2023-09-07 14:03 ` [PATCH 11/16] ir: Fix forgetting canonicalizing some function types Dodji Seketeli
2023-09-07 14:05 ` [PATCH 12/16] ir: Avoid forgetting potential seemingly duplicated member functions Dodji Seketeli
2023-09-07 14:07 ` [PATCH 13/16] ir: Really avoid canonicalizing decl-only classes Dodji Seketeli
2023-09-07 14:08 ` Dodji Seketeli [this message]
2023-09-07 14:09 ` [PATCH 15/16] ir: Fix qualification as non-confirmed propagated canonical types Dodji Seketeli
2023-09-07 14:10 ` [PATCH 16/16] dwarf-reader: Do not re-use typedefs in a scope Dodji Seketeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sf7qdqjr.fsf@redhat.com \
--to=dodji@redhat.com \
--cc=libabigail@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).