From patchwork Fri Dec 3 11:46:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Matthias_M=C3=A4nnich?= X-Patchwork-Id: 48461 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BD8C73858012 for ; Fri, 3 Dec 2021 12:09:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD8C73858012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638533352; bh=1XWGRXqZ2+pcRfDDa8D4tHKgHeIyWg+R7vLOyfeTGsA=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=gPxnPH2rm3F3L7bA4CTK5wWxMaU0+2AynGkZXsVZpQJR3RhMrOXsvQvK1GoRDFUJf 1m51x36dG17yvVuI1xhn2iNW40cwgTmeCA3EaIQ96En/qiGnarKI2eiHKv/1xvUx9U 8pfmHfs9j5e22JuAYRpL0JLzNT2AyXtWwYwhmpPY= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-ed1-x54a.google.com (mail-ed1-x54a.google.com [IPv6:2a00:1450:4864:20::54a]) by sourceware.org (Postfix) with ESMTPS id 919BC3858D39 for ; Fri, 3 Dec 2021 12:09:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 919BC3858D39 Received: by mail-ed1-x54a.google.com with SMTP id b15-20020aa7c6cf000000b003e7cf0f73daso2343157eds.22 for ; Fri, 03 Dec 2021 04:09:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=1XWGRXqZ2+pcRfDDa8D4tHKgHeIyWg+R7vLOyfeTGsA=; b=6ja+1qZ28yxcOCCvah7thcPgqUpGuIeQkJyZzMOOU6dUJ/Kmghl7oCCi7ozzMnKwkp gtAXEDpnLtz2inJJbCXSxIBrmN3IoGCGMiw7mZR08oD3j71FYes/vNM+0yhGe6wg1NSZ tZv08ziPW103xe4u6fHAH5255pYw1U2PXWFqzwkIZkexLagesbeGQRnVyNietxsyRb6o RHKC7jB9eOBZK4qgTVuBUzYtCle0OJcva3OiFTgMg1sekgJw7rlnqVMKC1/2uR65QED3 9FHOFmmonO6pXK0THFL5LKXLYKSm2l9VLU7MpWUCR7jdFMxHbCNYcmv2FlvSKy79atUF 9HXQ== X-Gm-Message-State: AOAM530C311JqxGGlR7L8f2v3uhqY9bfINcfjnKEKWSCnBvBaGXig3Yp EbxIf1MqCgGtwDmD7BRtMh4QNS0cfiVwxpMwYQFsfNOX/0C8i3sfqLa9aTPpTQD7Dq1DK2Oz7Jz YKZ5jC+7PRsvXXadej9UuDSdFT7WGYYtLQ0BOt7cWoIJbJmewvDwUjQhMmrbORPtcP/6eV8Y= X-Google-Smtp-Source: ABdhPJxv1NLQ0+erDaEvteuZ4k73L1HTLL4iJMtymDaDQLhCMo6O2qX0i/XsYKAMgj+CZ0vzoOLW6x4AAhgl9A== X-Received: from lux.lon.corp.google.com ([2a00:79e0:d:210:47e9:78df:690b:201]) (user=maennich job=sendgmr) by 2002:a17:906:52d8:: with SMTP id w24mr23886120ejn.296.1638533346640; Fri, 03 Dec 2021 04:09:06 -0800 (PST) Date: Fri, 3 Dec 2021 11:46:19 +0000 In-Reply-To: <20211203114622.2944173-1-maennich@google.com> Message-Id: <20211203114622.2944173-2-maennich@google.com> Mime-Version: 1.0 References: <20211203114622.2944173-1-maennich@google.com> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH 1/5] XML writer: use consistent type pointers for type ids and emission tracking To: libabigail@sourceware.org X-Spam-Status: No, score=-21.6 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matthias Maennich via Libabigail From: =?utf-8?q?Matthias_M=C3=A4nnich?= Reply-To: Matthias Maennich Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Insertion resolves the canonical type, if available, but look-up did not. Given that type id insertion and look-up also resolve canonical types, it makes sense to adjust the remaining code accordingly. Neither decl_only_type_is_emitted nor record_decl_only_type_as_emitted do the check, but very few types end up being recorded this way. The functions write_class_decl and write_union_decl (but not write_class_decl_opening_tag and write_union_decl_opening_tag which can be called in other contexts) resolve declaration-only types to a definition where possible. To ensure type ids consistently refer to the same resolved type we should resolve canonical types and definitions-of-declarations more consistently. This change introduces get_preferred_type to return the exemplar type that should be used for type id and emitted checks. However, it does not also change all the write functions to write out the exemplar types. * src/abg-writer.cc (get_preferred_type): new function. (type_has_existing_id): use get_preferred_type for resolution. (get_id_for_type): Likewise. (record_type_as_emitted): Likewise. (type_is_emitted): Likewise. Reviewed-by: Giuliano Procida Signed-off-by: Matthias Maennich Reviewed-by: Giuliano Procida Signed-off-by: Matthias Maennich Signed-off-by: Dodji Seketeli --- src/abg-writer.cc | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/abg-writer.cc b/src/abg-writer.cc index 21b79e888f31..9c3ae6f8d5b4 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -390,14 +390,25 @@ public: type_has_existing_id(type_base_sptr type) const {return type_has_existing_id(type.get());} + type_base* + get_preferred_type(const type_base* type) const + { + // declaration -> definition -> canonical is possible + if (decl_base* decl = look_through_decl_only(is_decl(type))) + { + type = is_type(decl); + ABG_ASSERT(type); + } + type_base* canonical = type->get_naked_canonical_type(); + return canonical ? canonical : const_cast(type); + } + /// @return true iff type has already been assigned an ID. bool type_has_existing_id(type_base* type) const { - type_base *c = type->get_naked_canonical_type(); - if (c == 0) - c = const_cast(type); - return (m_type_id_map.find(c) != m_type_id_map.end()); + type = get_preferred_type(type); + return m_type_id_map.find(type) != m_type_id_map.end(); } /// Associate a unique id to a given type. For that, put the type @@ -413,11 +424,9 @@ public: /// associated to it, create a new one and return it. Otherwise, /// return the existing id for that type. interned_string - get_id_for_type(const type_base* t) const + get_id_for_type(type_base* type) const { - type_base *c = t->get_naked_canonical_type(); - if (c == 0) - c = const_cast(t); + type_base* c = get_preferred_type(type); type_ptr_map::const_iterator it = m_type_id_map.find(c); if (it != m_type_id_map.end()) @@ -715,11 +724,9 @@ public: /// /// @param t the type to flag. void - record_type_as_emitted(const type_base *t) + record_type_as_emitted(const type_base* t) { - type_base *c = t->get_naked_canonical_type(); - if (c == 0) - c = const_cast(t); + type_base* c = get_preferred_type(t); m_emitted_type_set.insert(c); } @@ -730,9 +737,10 @@ public: /// @return true if the type has already been emitted, false /// otherwise. bool - type_is_emitted(const type_base *t) const + type_is_emitted(const type_base* t) const { - return m_emitted_type_set.find(t) != m_emitted_type_set.end(); + type_base* c = get_preferred_type(t); + return m_emitted_type_set.find(c) != m_emitted_type_set.end(); } /// Test if a given type has been written out to the XML output. From patchwork Fri Dec 3 11:46:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Matthias_M=C3=A4nnich?= X-Patchwork-Id: 48463 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DED2E385802A for ; Fri, 3 Dec 2021 12:09:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DED2E385802A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638533359; bh=hZ37SVMVlXFg5RqCmJteZ5FFc+kB4czgPWOpTqXnPc0=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=umjxXp9636gbvKVLhN4sIJYahgparyka12sQhpyfrMSOljkYtlkGQtyOo+oj4kNJ0 TcK35++IuSvcZgZHKIRKkp+sxlB0ObPGVhJD74adps3o1v+umdUepyukD0ykCzCYqq 8fbx6VUzcaQt7l15cXqBg2EsCvdts+16F12m8m0Y= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) by sourceware.org (Postfix) with ESMTPS id 0181D3858018 for ; Fri, 3 Dec 2021 12:09:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0181D3858018 Received: by mail-wm1-x34a.google.com with SMTP id k25-20020a05600c1c9900b00332f798ba1dso3349591wms.4 for ; Fri, 03 Dec 2021 04:09:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc:content-transfer-encoding; bh=hZ37SVMVlXFg5RqCmJteZ5FFc+kB4czgPWOpTqXnPc0=; b=7nS6C/lUipVMBCC1yPpnT9NaGMFrSRWyngdCHHwnVP2WWxPDcYnYh3l/gjx/6NWtUP zZ7PGKkuEKI7vFpuG63i5G6zt7qOjror5XnplhQfr8Qm9lDT0LcKH905za/wIS9E34rd zdR8VRjSKM23k13WoYBr9ydSpCyUV5KaBN881NTuEtKn+WmBtceMz26uQ5kaL5OOrKy0 WecgrZV04/cz+8DQ2qU0dIVmClCQjILeBr8tyDqr1ZKWrZMlhkMVaCGJTtd+mToMgUBU SHptSk9LK5jQQkQbuE5B/6SPMvoGEXcJkkw+PWYlUYKWceSxBrA7xbNeSofhojnOMwpi Jbcg== X-Gm-Message-State: AOAM530y9TFqPUJQoBWJQZmIUHcSGKuSHqX+s7OBEwvw+5z+GwCYhz4s GM8AzkETMUpZI6GVmKHHJXT4tTA9OfH75IZuSESyVjg6ZX12xGzAFblwcH0bmQXdqWXgU7eVPao VxLBi3Tachdx7j+KP8GJhSgSRo4O6hcCZ9ifYOv0cU+nXG6R2hO9E0C2ZhY/Ni3r19EVgM7I= X-Google-Smtp-Source: ABdhPJy+g97I+EqG3SGDjMMJs2DXzmIwWTO16qslfEiaoZKRzR4TODEtqXdn9Dh8qXrTKmtyxvkjsIZTkpEn/Q== X-Received: from lux.lon.corp.google.com ([2a00:79e0:d:210:47e9:78df:690b:201]) (user=maennich job=sendgmr) by 2002:a05:600c:4f44:: with SMTP id m4mr14837178wmq.95.1638533348861; Fri, 03 Dec 2021 04:09:08 -0800 (PST) Date: Fri, 3 Dec 2021 11:46:20 +0000 In-Reply-To: <20211203114622.2944173-1-maennich@google.com> Message-Id: <20211203114622.2944173-3-maennich@google.com> Mime-Version: 1.0 References: <20211203114622.2944173-1-maennich@google.com> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH 2/5] XML writer: use exemplar types for tracking referenced types To: libabigail@sourceware.org X-Spam-Status: No, score=-22.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matthias Maennich via Libabigail From: =?utf-8?q?Matthias_M=C3=A4nnich?= Reply-To: Matthias Maennich Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" The emitted type sets are used with some referenced type sets (which use bare type pointers). To keep consistency between what is being recorded in each set, switch to storing exemplar type pointers in the referenced type sets. This change results in the omission of a small number of duplicate types from various test cases. In each case the duplicates were previously caused by a referenced type being emitted for one translation unit and then the same type being emitted as a canonical type for a later translation unit. It also causes the movement of some function types in some test cases. Some of those types are now considered referenced and appear earlier as a result. * src/abg-writer.cc (record_type_as_referenced): Use preferred type with referenced type sets. (type_is_referenced): Likewise. (tests/data/test-annotate/test14-pr18893.so.abi): Duplicate type(s) removed, as described above. (tests/data/test-read-dwarf/test14-pr18893.so.abi): Likewise. (tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi): Likewise. (tests/data/test-read-dwarf/test16-pr18904.so.abi): Likewise. (tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi): Likewise. (tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi): Likewise. (tests/data/test-read-dwarf/PR25007-sdhci.ko.abi): Some function type(s) reordered, as described above. (tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi): Likewise. (tests/data/test-annotate/test15-pr18892.so.abi):: Duplicate type(s) removed and some function type(s) reordered, as described above. (tests/data/test-read-dwarf/test15-pr18892.so.abi): Likewise. (tests/data/test-annotate/test21-pr19092.so.abi): Likewise. (tests/data/test-read-dwarf/test21-pr19092.so.abi): Likewise Reviewed-by: Giuliano Procida Signed-off-by: Matthias Maennich --- src/abg-writer.cc | 19 +- .../data/test-annotate/test14-pr18893.so.abi | 2 - .../data/test-annotate/test15-pr18892.so.abi | 44 +- ...19-pr19023-libtcmalloc_and_profiler.so.abi | 4 - .../data/test-annotate/test21-pr19092.so.abi | 26 +- .../data/test-read-dwarf/PR25007-sdhci.ko.abi | 434 +++++++++--------- .../PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi | 2 +- .../test-read-dwarf/test14-pr18893.so.abi | 1 - .../test-read-dwarf/test15-pr18892.so.abi | 28 +- .../test-read-dwarf/test16-pr18904.so.abi | 2 - ...19-pr19023-libtcmalloc_and_profiler.so.abi | 2 - .../test-read-dwarf/test21-pr19092.so.abi | 16 +- .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 1 - 13 files changed, 279 insertions(+), 302 deletions(-) diff --git a/src/abg-writer.cc b/src/abg-writer.cc index 9c3ae6f8d5b4..4cf2a7fb16af 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -542,18 +542,19 @@ public: /// /// @param t a shared pointer to a type void - record_type_as_referenced(const type_base_sptr& t) + record_type_as_referenced(const type_base_sptr& type) { + type_base* t = get_preferred_type(type.get()); // If the type is a function type, record it in a dedicated data // structure. - if (function_type* f = is_function_type(t.get())) + if (function_type* f = is_function_type(t)) m_referenced_fn_types_set.insert(f); else if (!t->get_naked_canonical_type()) // If the type doesn't have a canonical type, record it in a // dedicated data structure. - m_referenced_non_canonical_types_set.insert(t.get()); + m_referenced_non_canonical_types_set.insert(t); else - m_referenced_types_set.insert(t.get()); + m_referenced_types_set.insert(t); } /// Test if a given type has been referenced by a pointer, a @@ -564,17 +565,17 @@ public: /// @return true if the type has been referenced, false /// otherwise. bool - type_is_referenced(const type_base_sptr& t) + type_is_referenced(const type_base_sptr& type) { - if (function_type *f = is_function_type(t.get())) + type_base* t = get_preferred_type(type.get()); + if (function_type* f = is_function_type(t)) return (m_referenced_fn_types_set.find(f) != m_referenced_fn_types_set.end()); else if (!t->get_naked_canonical_type()) - return (m_referenced_non_canonical_types_set.find(t.get()) + return (m_referenced_non_canonical_types_set.find(t) != m_referenced_non_canonical_types_set.end()); else - return m_referenced_types_set.find - (t.get()) != m_referenced_types_set.end(); + return m_referenced_types_set.find(t) != m_referenced_types_set.end(); } /// A comparison functor to compare pointers to @ref type_base. diff --git a/tests/data/test-annotate/test14-pr18893.so.abi b/tests/data/test-annotate/test14-pr18893.so.abi index a5c30fb5b37d..2bcb3c519e20 100644 --- a/tests/data/test-annotate/test14-pr18893.so.abi +++ b/tests/data/test-annotate/test14-pr18893.so.abi @@ -965,8 +965,6 @@ - - diff --git a/tests/data/test-annotate/test15-pr18892.so.abi b/tests/data/test-annotate/test15-pr18892.so.abi index fbfa1da1a48a..582951a9f325 100644 --- a/tests/data/test-annotate/test15-pr18892.so.abi +++ b/tests/data/test-annotate/test15-pr18892.so.abi @@ -3302,42 +3302,38 @@ - - - - + + - + - - + + - - + + - + - - + + - - - + @@ -3352,7 +3348,7 @@ - + @@ -3417,7 +3413,7 @@ - + @@ -3432,7 +3428,7 @@ - + @@ -4802,8 +4798,6 @@ - - @@ -5704,8 +5698,6 @@ - - @@ -7568,15 +7560,15 @@ - + - + - + @@ -10061,7 +10053,7 @@ - + diff --git a/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi b/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi index c756cca7a542..18a4964be69c 100644 --- a/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi +++ b/tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi @@ -2160,10 +2160,6 @@ - - - - diff --git a/tests/data/test-annotate/test21-pr19092.so.abi b/tests/data/test-annotate/test21-pr19092.so.abi index 5b17d83e7448..e009a191a42e 100644 --- a/tests/data/test-annotate/test21-pr19092.so.abi +++ b/tests/data/test-annotate/test21-pr19092.so.abi @@ -2537,11 +2537,6 @@ - - - - - @@ -2569,13 +2564,6 @@ - - - - - - - @@ -2594,6 +2582,18 @@ + + + + + + + + + + + + @@ -10843,7 +10843,7 @@ - + diff --git a/tests/data/test-read-dwarf/PR25007-sdhci.ko.abi b/tests/data/test-read-dwarf/PR25007-sdhci.ko.abi index b23715233e02..f3e2e259b803 100644 --- a/tests/data/test-read-dwarf/PR25007-sdhci.ko.abi +++ b/tests/data/test-read-dwarf/PR25007-sdhci.ko.abi @@ -10107,19 +10107,10 @@ - - - - - - - - - @@ -10147,10 +10138,6 @@ - - - - @@ -10177,9 +10164,6 @@ - - - @@ -10197,16 +10181,6 @@ - - - - - - - - - - @@ -10396,13 +10370,6 @@ - - - - - - - @@ -10552,31 +10519,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - @@ -10589,17 +10531,6 @@ - - - - - - - - - - - @@ -10660,10 +10591,6 @@ - - - - @@ -10704,22 +10631,6 @@ - - - - - - - - - - - - - - - - @@ -10835,10 +10746,6 @@ - - - - @@ -10863,14 +10770,6 @@ - - - - - - - - @@ -10916,9 +10815,6 @@ - - - @@ -10963,15 +10859,6 @@ - - - - - - - - - @@ -10998,44 +10885,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -11069,18 +10923,6 @@ - - - - - - - - - - - - @@ -11094,14 +10936,6 @@ - - - - - - - - @@ -11115,13 +10949,6 @@ - - - - - - - @@ -11248,26 +11075,12 @@ - - - - - - - - - - - - - - @@ -11311,15 +11124,6 @@ - - - - - - - - - @@ -11388,19 +11192,10 @@ - - - - - - - - - @@ -11415,10 +11210,6 @@ - - - - @@ -11433,9 +11224,6 @@ - - - @@ -11453,6 +11241,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -11472,11 +11477,6 @@ - - - - - diff --git a/tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi b/tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi index 0e6e8af45fc0..4a84fe97a226 100644 --- a/tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi +++ b/tests/data/test-read-dwarf/PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi @@ -476,11 +476,11 @@ + - diff --git a/tests/data/test-read-dwarf/test14-pr18893.so.abi b/tests/data/test-read-dwarf/test14-pr18893.so.abi index cad90c1c61cc..4ed7a8cdcb42 100644 --- a/tests/data/test-read-dwarf/test14-pr18893.so.abi +++ b/tests/data/test-read-dwarf/test14-pr18893.so.abi @@ -604,7 +604,6 @@ - diff --git a/tests/data/test-read-dwarf/test15-pr18892.so.abi b/tests/data/test-read-dwarf/test15-pr18892.so.abi index a4f0b7fa2815..7f885838c344 100644 --- a/tests/data/test-read-dwarf/test15-pr18892.so.abi +++ b/tests/data/test-read-dwarf/test15-pr18892.so.abi @@ -1683,25 +1683,23 @@ - - + - + - + - + - - + @@ -1709,7 +1707,7 @@ - + @@ -1746,7 +1744,7 @@ - + @@ -1754,7 +1752,7 @@ - + @@ -2653,7 +2651,6 @@ - @@ -3228,7 +3225,6 @@ - @@ -4268,11 +4264,11 @@ - - + + - + @@ -5729,7 +5725,7 @@ - + diff --git a/tests/data/test-read-dwarf/test16-pr18904.so.abi b/tests/data/test-read-dwarf/test16-pr18904.so.abi index ed1f9b07403b..b4dd1ee75cc8 100644 --- a/tests/data/test-read-dwarf/test16-pr18904.so.abi +++ b/tests/data/test-read-dwarf/test16-pr18904.so.abi @@ -2160,8 +2160,6 @@ - - diff --git a/tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi b/tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi index 6def22d56114..da5bb27f4c51 100644 --- a/tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi +++ b/tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi @@ -1185,8 +1185,6 @@ - - diff --git a/tests/data/test-read-dwarf/test21-pr19092.so.abi b/tests/data/test-read-dwarf/test21-pr19092.so.abi index c32385188030..c10916fa7484 100644 --- a/tests/data/test-read-dwarf/test21-pr19092.so.abi +++ b/tests/data/test-read-dwarf/test21-pr19092.so.abi @@ -1516,9 +1516,6 @@ - - - @@ -1534,10 +1531,6 @@ - - - - @@ -1548,6 +1541,13 @@ + + + + + + + @@ -7000,7 +7000,7 @@ - + diff --git a/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi b/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi index 288abf42f36a..46952f55eeb9 100644 --- a/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi +++ b/tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi @@ -4356,7 +4356,6 @@ - From patchwork Fri Dec 3 11:46:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Matthias_M=C3=A4nnich?= X-Patchwork-Id: 48462 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B331C3858001 for ; Fri, 3 Dec 2021 12:09:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B331C3858001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638533356; bh=MQgzZiea8hoG3Vxy854j46b/3JOrXpF0ygXNMV3TFTU=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=UTgux0ocUscqYs3LhoKai7B230kK8h3tvTf+QAMYv/I4fVatThR7lrb/qmyzBkVMn j2pw4YVHKH0wYB/eU2CLloghsWp7uz9WSU7TsaTxyZDPua/Fk4xJK3gFo9Res3l6iN 8+74sxx8e8q1N5jKXiexvLV4X6oZsFIWrLCZQK58= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) by sourceware.org (Postfix) with ESMTPS id 4C0003858022 for ; Fri, 3 Dec 2021 12:09:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C0003858022 Received: by mail-wm1-x34a.google.com with SMTP id z138-20020a1c7e90000000b003319c5f9164so3348760wmc.7 for ; Fri, 03 Dec 2021 04:09:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=MQgzZiea8hoG3Vxy854j46b/3JOrXpF0ygXNMV3TFTU=; b=sE+OeDt+P33qcQMyv2qTxEejN6sd7AmzZbGoMsUOJT2CswplYgBtJ87IYCFz1SP3UE OeD/CbIiEjdvG6dcHRxAY9kUCRjVx1N8NkLH8iKPuFyb0HtUpX83tMx+CP9MEjxDl8SR RLTtp37t3HxYbhtq5kClnwoxVIxrdvpWRmh2LlVnAQGIHLaJo4Ow7hYyb6h/Jnh4+V18 gBdZk5fNCQqXnUGQ5+ARhrCFEXlBj1fKxvIa3+QukraI724kwXfXr2hQAVcqy15OU7sw XEh8POXNQ75JtysX7BznX6gRsM9hNA9jjGjI77c5PE99E/RuJrBC2mIYYO2U5SHwnxVb RHVQ== X-Gm-Message-State: AOAM532oMm6sYzcPQhOQKMKOQup8O04fUBOFCQLzj+V9UAHFn+flVgSL PbB7baRxPYKXtgdjVHnjxEpKOeB5EH9iWsLdSSQQccRra4eUEp+sd4Chid2Opdb261upnunnp7E 6e7IyOU5N1vbEXrdJoudLJP5VRL7bSPlNhu5qar5oqSZHfY5ATAvT+1RMEHRSVyAM5QCm6k4= X-Google-Smtp-Source: ABdhPJzR3TsrtUPGvjvt9lzVnRm69S/0p7NZGWIWDniyaSjBZYT35qggk3iEE0mCb+HVL2ew6YkTGHTSievRKA== X-Received: from lux.lon.corp.google.com ([2a00:79e0:d:210:47e9:78df:690b:201]) (user=maennich job=sendgmr) by 2002:a7b:ce83:: with SMTP id q3mr14473491wmj.37.1638533351314; Fri, 03 Dec 2021 04:09:11 -0800 (PST) Date: Fri, 3 Dec 2021 11:46:21 +0000 In-Reply-To: <20211203114622.2944173-1-maennich@google.com> Message-Id: <20211203114622.2944173-4-maennich@google.com> Mime-Version: 1.0 References: <20211203114622.2944173-1-maennich@google.com> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH 3/5] XML writer: track emitted types by bare pointer To: libabigail@sourceware.org X-Spam-Status: No, score=-22.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matthias Maennich via Libabigail From: =?utf-8?q?Matthias_M=C3=A4nnich?= Reply-To: Matthias Maennich Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" This is a performance and safety improvement made possible by the previous changes which ensure that the same pointers are inserted and looked up. This essentially removes the now unnecessary deep comparison. * src/abg-writer.cc (type_ptr_set_type): Change typedef container type to use default equality and hashing for pointer keys. (fn_type_ptr_set_type): Likewise. Reviewed-by: Giuliano Procida Signed-off-by: Matthias Maennich --- src/abg-writer.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/abg-writer.cc b/src/abg-writer.cc index 4cf2a7fb16af..d2ef19eb7095 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -123,14 +123,10 @@ typedef unordered_map type_ptr_map; // A convenience typedef for a set of type_base*. -typedef unordered_set -type_ptr_set_type; +typedef std::unordered_set type_ptr_set_type; /// A convenience typedef for a set of function type*. -typedef unordered_set -fn_type_ptr_set_type; +typedef std::unordered_set fn_type_ptr_set_type; typedef unordered_map, string, From patchwork Fri Dec 3 11:46:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Matthias_M=C3=A4nnich?= X-Patchwork-Id: 48465 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 64B123858C2C for ; Fri, 3 Dec 2021 12:09:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64B123858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638533374; bh=xDl68fnqBwqSOBQ5CHvs61vIF8Z6PkE9jRbufTqAYxs=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ybb89+eadZdr+6vPHFGk0lxwo8AgS4Y7RwD3TDZStTIhyaQksbKXa3qyTr2+u988e Y0LlPMPD9JfC5xrRXQz+Iwd8x2767eavjXqYwxqvjjbRf72BKDU7YMuhdi4/1Yo2r5 7xKhdYSd19KUr5y27wxxqilEaeR6Y6/st9oCduA0= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wr1-x449.google.com (mail-wr1-x449.google.com [IPv6:2a00:1450:4864:20::449]) by sourceware.org (Postfix) with ESMTPS id 1D8FF385841A for ; Fri, 3 Dec 2021 12:09:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1D8FF385841A Received: by mail-wr1-x449.google.com with SMTP id d7-20020a5d6447000000b00186a113463dso567973wrw.10 for ; Fri, 03 Dec 2021 04:09:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc:content-transfer-encoding; bh=xDl68fnqBwqSOBQ5CHvs61vIF8Z6PkE9jRbufTqAYxs=; b=DHrEpfRSxqqxEkQt2m/zEO45Q6M9sG55KkTKp5rbHxvSpaT1dDsn/B6Q3fnN//LkWw OqsQ9gSx/pVJPCuK/YeT2xrR+8pukOWyLXsgm/RMeqMLLZpQKkO7oeoOIaf6WDelzNpN fg6TVt0DMqv1m+7zMeuRskOozCECaqfoIJ114DdjvI2owTzvBLh9sKmeb2RZ8q5roQWs edzjBNjAurIc7CgKE+Pb3i/zQsXqQ/Q/LREnvJNb1qcv4lb8Ixl/a0WVWsVJogXFrN9J FmRl9GraEA5uhcmB5wrdjN1IRcfAa6tUPcx/i4V5PgRLPr1oAIR0AoMXtff1G1+q816v w8sw== X-Gm-Message-State: AOAM532T9B5BoIb8vGTEDbT3K7rN9Y6xVUmJ24wkwudskmGaW9b3sDjN h/+ZXgUYU3HarYtTIKMRSoGUhJNm20A+0kgDN/0lHVjjef8c+vZqKDdgbYF0Gf0XjvZ/8ODNgNG odBnguSjrXJgVNerPJDogYZF8x1mFtuojdpVMx3eqQ40ZktDJSxZlz4AvIuYcvw9R2+ya4bQ= X-Google-Smtp-Source: ABdhPJxoSmvO9La/r+KDG/Oy/xgfQCzT4fn0b0OrW4I4tTdtYCCkFnwAzI/3I5LOtbSrh3XlrwCKeMm05RW6qA== X-Received: from lux.lon.corp.google.com ([2a00:79e0:d:210:47e9:78df:690b:201]) (user=maennich job=sendgmr) by 2002:a05:600c:35c8:: with SMTP id r8mr14522902wmq.8.1638533353666; Fri, 03 Dec 2021 04:09:13 -0800 (PST) Date: Fri, 3 Dec 2021 11:46:22 +0000 In-Reply-To: <20211203114622.2944173-1-maennich@google.com> Message-Id: <20211203114622.2944173-5-maennich@google.com> Mime-Version: 1.0 References: <20211203114622.2944173-1-maennich@google.com> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH 4/5] XML writer: map type ids by bare pointer To: libabigail@sourceware.org X-Spam-Status: No, score=-22.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matthias Maennich via Libabigail From: =?utf-8?q?Matthias_M=C3=A4nnich?= Reply-To: Matthias Maennich Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" This is a performance and safety improvement made possible by previous changes which ensure that the same pointers are used for insertion and look-up. This change affects two test cases. In more detail: The test case test-read-dwarf/PR22122-libftdc.so.abi has many duplicate type-id-60 which appear to all be types defined with a DWARF DW_AT_signature attribute. These are made into separate types by this change, but remain incomplete. The test case test-read-dwarf/PR25007-sdhci.ko.abi has duplicate declarations and these get split into duplicate declarations with new type ids following this change. The test suite runs with an implicit --no-linux-kernel-mode so the duplicates are treated separately. They presumably had the same type ids before this change due to deep equality considering them equal. * src/abg-writer.cc (type_ptr_map): use default equality on type_base pointer. * tests/data/test-read-dwarf/PR22122-libftdc.so.abi: Refresh test case, as described above. * tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Likewise. Reviewed-by: Giuliano Procida Signed-off-by: Matthias Maennich --- src/abg-writer.cc | 5 +- .../test-read-dwarf/PR22122-libftdc.so.abi | 6242 ++++++++--------- .../data/test-read-dwarf/PR25007-sdhci.ko.abi | 80 +- 3 files changed, 3162 insertions(+), 3165 deletions(-) diff --git a/src/abg-writer.cc b/src/abg-writer.cc index d2ef19eb7095..76e60eb92347 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -31,7 +31,6 @@ ABG_BEGIN_EXPORT_DECLARATIONS #include "abg-config.h" #include "abg-corpus.h" -#include "abg-diff-utils.h" #include "abg-hash.h" #include "abg-sptr-utils.h" @@ -118,9 +117,7 @@ struct type_hasher /// A convenience typedef for a map that associates a pointer to type /// to a string. The pointer to type is hashed as fast as possible. typedef unordered_map type_ptr_map; + interned_string> type_ptr_map; // A convenience typedef for a set of type_base*. typedef std::unordered_set type_ptr_set_type; diff --git a/tests/data/test-read-dwarf/PR22122-libftdc.so.abi b/tests/data/test-read-dwarf/PR22122-libftdc.so.abi index 16e867efd49a..15271b3eb29b 100644 --- a/tests/data/test-read-dwarf/PR22122-libftdc.so.abi +++ b/tests/data/test-read-dwarf/PR22122-libftdc.so.abi @@ -303,708 +303,708 @@ - - - - - + + + - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + - - + - - - - - - - + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + - + - + - + - + - + - - + + - + - + - + - + - - + + - - - + + + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - - - + + + - - - - + + + + - - - + + + - + - + - - - + + + - + - + - + - + - - - - + + + + - + - - - - + + + + - - + + - + - - + + - - + + - - - + + + - + - + - - + + - + - - + + - + - - + + - - + + - + - - + + - + - + - + - + - + - + - - - - + + + + - + - + - + - - + + - - + + - - + + - + - - + + - - + + - - - + + + - - + + - - + + - + - - - + + + - - - + + + - - + + - - + + - - - + + + - - - - + + + + - - - - - + + + + + - - - + + + - - + + - - - + + + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - - - - + + + + - - + + - + - - + + - - + + - + - + - + - + - + - + - - + + - - + + - + - + - + - + - + @@ -1072,52 +1072,52 @@ - - + + - - + + - - + + - - + + - - + + - + - + - - + + - - + + @@ -1128,103 +1128,103 @@ - - + + - - + + - - + + - + - + - + - - + + - - + + + + - - - + - + - + - - + + - + - + - - + + - - + + - - + + - - - + + + @@ -1246,18 +1246,18 @@ - + - + - + - + @@ -1266,14 +1266,14 @@ - + - + @@ -1291,21 +1291,21 @@ - + - + - + - + @@ -1316,58 +1316,58 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + @@ -1375,63 +1375,63 @@ - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + @@ -1461,279 +1461,279 @@ - + - - + + - + - - + + - - + + - - + + - + - - + + - + - + - + - - + + - + - + - - - + + + - - + + - + - - - + + + - - + + - + - - + + - - + + - - + + - - + + - + - + - + - + - - + + - - + + - - - + + + - - - + + + - - - + + + - + - + - - - + + + - - + + - + - - - + + + - - + + - + - - + + - - + + - - + + - - + + - + - + - + - + - - + + - - + + - - - + + + - - - + + + - - - - + + + + - + - + - + - - + + - - + + - + - - + + - + - + - + - + - - + + - + - + - + @@ -1745,61 +1745,61 @@ - + - + - - + + - + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -1810,72 +1810,72 @@ - + - + - + - + - - + + - - + + - + - - + + - + - + - - + + - - + + - - + + - - - + + + @@ -1904,13 +1904,13 @@ - + - + - + @@ -1920,10 +1920,10 @@ - + - - + + @@ -1975,7 +1975,7 @@ - + @@ -1992,7 +1992,7 @@ - + @@ -2083,7 +2083,7 @@ - + @@ -2101,7 +2101,7 @@ - + @@ -2233,15 +2233,15 @@ - + - + - + @@ -2430,19 +2430,19 @@ - + - + - + @@ -2557,8 +2557,8 @@ - - + + @@ -2569,15 +2569,15 @@ - - + + - + - + @@ -2585,29 +2585,29 @@ - - + + - - + + - - + + - - + + @@ -2615,82 +2615,82 @@ - + - - - + + + - - - - + + + + - + - - - - - + + + + + - - + + - - + + - - + + - + - + - + - + - + - - + + - + - - + + - + @@ -2698,1200 +2698,1200 @@ - - + + - + - + - + - - + + - + - + - + - + - - - + + + - - - + + + - - - + + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - - + + + - - + + - - + + - + - + - + - + - - - + + + - - + + - + - - + + - + - - - + + + - - - + + + - + - - + + - + - + - - - + + + - - + + - + - + - - + + - + - - + + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - - - + + + - + - - + + - - - + + + - - - + + + - + - + - - - + + + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - - - + + + - - + + - + - - + + - - + + - - - + + + - + - + - + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + + - - + - + - - - + + + - + - - - - + + + + - + - - - + + + - + - - - - + + + + - + - - + + - + - - - - + + + + - - + + - + - - + + - + - + - + - + - + - - - + + + - + - + - + - - - + + + - + - - + + - + - - - - + + + + - + - - - + + + - + - - - - + + + + - - - + + + - - - + + + - + - - - - + + + + - + - + - + - - - + + + - + - + - + - + - + - + + - - + - - - - + + + + - - - + + + - - + + - + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - - + + + - - - + + + - + - - + + - - - + + + - - - + + + - - - + + + - + - + - - + + - - + + - - + + - + - + - - - + + + - - + + - - + + - + - + - + - - + + - + - - + + - + - - - + + + - - + + - + - + - - - + + + - - + + - - - + + + - + - - + + - - + + - - + + - + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + - + - - + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - + - - + + - + - + - - - + + + - - - + + + - - + + @@ -3899,1055 +3899,1055 @@ - - - - - - - - - - - + + + + + + + + + + + - - - + + + - + - + - + - - - + + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - - + + - + - - + + - - - + + + - + - - + + - + - + - + - + - + - + - - - + + + - + - - - + + + - + - + - + - - - + + + - - + + - - - + + + - - + + - + - - + + - + - + - + - - - - + + + + - + - - - - + + + + - - + + - - + + - + - + - + - + - + - - - + + + - - + + - + - + - + - - + + - + - + - - + + - + - + - - + + - - - + + + - - - + + + - - + + - + - - + + - - + + - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - - + + - - - + + + - + - - - + + + - - - + + + - - + + - + - + - - - + + + - + - + - - + + - + - - + + - - + + - + - + - - - + + + - - + + - + - + - + - + - + - - - - - + + + + + - + - - - - - + + + + + - - - + + + - + - + - - - + + + - - + + - + - - + + - - + + - - - + + + - + - - + + - - + + - - - + + + - + - + - + - + - - - + + + - - - - - - - + + + + + + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + - - + + - - + + - - + + + + - - - + - + - + - - + + - + - - - + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - + - - - + + + - + - + - - - + + + - - - + + + - - - + + + - - + + - + - + - - + + - - - - - + + + + + - + - + - + - + - + - - - + + + - - + + - - - + + + - + - - - - - + + + + + - + - - + + - - + + - - - - + + + + - - - + + + - - - - + + + + - - + + - - - - + + + + - - - + + + - + - - - + + + - + - - - + + + - + - - + + - - + + - + - - + + - + - - + + - - + + - + - + - - + + - + - - + + - + - - - + + + - - + + - + @@ -4955,251 +4955,251 @@ - - + + - + - - - + + + - - - + + + - + - - - + + + - + - - - + + + - + - - - - - + + + + + - + - + - - - - + + + + - - + + - - - + + + - + - + - - + + - - - + + + - + - - - + + + - + - + + - - + - - - + + + - + - - + + - + - + - - - + + + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - + - + - - + + - - + + - + - + - + - + - - - + + + - + + - - + - - - + + + - + - - + + - - + + - - + + @@ -5207,207 +5207,207 @@ - - + + - + - - + + - - + + - + - + - + - - - - - - - + + + + + + + - - - + + + - - + + - - - - - + + + + + - + - + - - - + + + - - - + + + - - - + + + - + - + - + - + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - + - - - + + + - + - - - + + + - - + + @@ -5415,584 +5415,584 @@ - - + + - + - + - - + + - - + + - - - - + + + + - - + + - - + + - - - + + + - - - + + + - - + + - - - + + + - - + + - + - + - + - + - - - + + + - + - + - - - + + + - + - + - - + + - - + + - + - + - - + + - - + + - + - - + + - - - + + + - - + + - + - + - + - + - + + - - + - - + + - + - - - + + + - + - + - + - - - + + + - + - - + + - + - + - + - - - + + + - + - + - - + + - - - - + + + + - - - - + + + + - + - - - + + + - + - + - + - - + + - + - - + + - + + - - + - - + + - + - + - + - - - + + + - - - + + + - - + + - - + + - - - + + + - - - + + + - - + + - + - + - - + + - - - + + + - - - - + + + + - + - - + + - - - + + + - + - + - + - + - + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - + - + - - + + - - - + + + - - + + - - - + + + - + - + - - - + + + - - - - + + + + - + - - - - - + + + + + - - + + - + - + - - - - - - + + + + + + - - - + + + - + - + - + - - + + - - - - - + + + + + - + - + - - - - - - - - + + + + + + + + - + - - + + - - + + - - + + - - + + @@ -6000,496 +6000,496 @@ - - + + - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - + + - + - - - + + + - - + + - + - + - + - - - + + + - - - + + + - + - + - + - + - + + - - + - + - - - + + + - + - + - + - - - + + + - - + + - - - + + + - + - + - + - + - + + - - + - - - - + + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - + - - - - + + + + - + - - - - + + + + - + - + - + - - - + + + - + - + - + - - - - + + + + - - - + + + - - - + + + - - - + + + - + - - - - - - + + + + + + - + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - - - - + + + + - - + + - + - - + + - - - - + + + + - - + + - - - + + + - - - - - - + + + + + + - - - + + + - - - - + + + + - - + + - - + + - + - - - + + + - - - - + + + + - + - + - - - + + + - - - + + + - - - + + + - - + + - + - + - - - + + + - + - + - + - + - + + - - + - + - + + - - + - + - + - - + + - + - - + + - + - + - + - - - + + + - + - + - + - + - - + + @@ -6499,11 +6499,11 @@ - + - - + + @@ -6511,880 +6511,880 @@ - + - - - - - + + + + + - - + + - - + + - - - - - + + + + + - - + + - - + + - - - - + + + + - - - - - + + + + + - + - + - - - + + + - - - - - + + + + + - - - - + + + + - + - + - - + + - - + + - + - + - - + + - - - + + + - - - + + + - + - - + + - + - - - - - - + + + + + + - - + + - - + + - - + + - + - - - + + + - + - - + + - + - + - - - - + + + + - + - - - + + + - - + + - + - + - + - + - - - + + + - - + + - - - + + + - - - + + + - - + + - - + + - + - + - - + + - + - - + + - - - + + + - - + + - - + + - - + + - + - - + + - - - + + + - + - - + + - - - + + + - + - - + + - - + + - - - + + + - + - - - + + + - - + + - + - + - + - - + + - + - + - - - + + + - - - - - - + + + + + + - - - + + + - - - - + + + + - + - + - + - - + + - - + + - - + + - + - - - - + + + + - - + + - - + + - - - + + + - + - + - - + + - - + + - - + + - + - - + + - - + + - - + + - + - - - + + + - - - + + + - - + + - + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - + - + - - - - + + + + - - + + - - + + - + - - - + + + - - + + - - - - + + + + - - - + + + - - - - - - + + + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - + + + - + - + - + - - + + - + - + - - + + - + - + - + - + - - - + + + - + - + - + - - - - + + + + - + - - - - + + + + - - + + - + - + - - + + - + - - - - + + + + - - + + - + - + - + - + - + - - - + + + - + - + - - - + + + - - - + + + - + - + - - + + - + - + - + - - + + - - + + - - + + @@ -7392,204 +7392,204 @@ - + - + - - - - - - + + + + + + - - + + - - + + - - + + - - + + - - - + + + - + - + - + - + - + - - + + - - + + - - - - - - - - + + + + + + + + - + - + - + - + - - + + - - + + - + - + - + - - - - + + + + - - - - - - - + + + + + + + - + - + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + - - + + - - + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + - + - - + + - + - + - + - - + + @@ -7597,376 +7597,376 @@ - + - + - - + + - - + + - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - - - + + + - + - - - - - - + + + + + + - + - + - - - + + + - + - + - - + + - + - + - + - + - + - - - + + + - - - + + + - - - - - + + + + + - + - + - - - + + + - - - + + + - - - + + + - + - + - - - - - + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - + - - - + + + - - - + + + - - - + + + - + - + - - - + + + - - - + + + - - - + + + - + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - + - - - - - - + + + + + + - + - + - + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + - - + + - - + + @@ -7974,679 +7974,679 @@ - + - + - - - - - - - - - - + + + + + + + + + + - + - + - - - + + + - + - + - + - + - + - - - - + + + + - - - - + + + + - + - + - - - - + + + + - + - + - - - - + + + + - + - + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - - + + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - - + + - - - + + + - + - - + + - - + + - + - - + + - + - + - - + + - + - - + + - - + + - - + + - - - + + + - + - + - + - + - - + + - + - - - + + + - - + + - + - - - + + + - + - + - + - + - + - + - - + + - + - + - + - + - - - + + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - + - - + + - + - - - + + + - + - + - - + + - - + + - + - + - - - - - - - - - - + + + + + + + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - - + + + - - + + - - + + - - + + - + - + - - - - - - + + + + + + - + - - - + + + - + - - + + - - - - - - - - - + + + + + + + + + - - + + - + - - + + - - - + + + - + - - + + diff --git a/tests/data/test-read-dwarf/PR25007-sdhci.ko.abi b/tests/data/test-read-dwarf/PR25007-sdhci.ko.abi index f3e2e259b803..5d16731e4409 100644 --- a/tests/data/test-read-dwarf/PR25007-sdhci.ko.abi +++ b/tests/data/test-read-dwarf/PR25007-sdhci.ko.abi @@ -11479,46 +11479,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From patchwork Fri Dec 3 11:46:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Matthias_M=C3=A4nnich?= X-Patchwork-Id: 48464 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 172A63858017 for ; Fri, 3 Dec 2021 12:09:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 172A63858017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638533363; bh=DbWThjuXKM/ZTQyNuPMQBROc9d9YARIyTTf/OIgGEQg=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=XKax0Hl3uWQRDwVFbVis+r9qQI/iHQnVUkh7PG5XAHiEqEywQSHH1rMC31/n3QLbv lY3bcmwEQY/z9cg3JrtGc9TLmz9EpeeSU98BElLmSALP/4Ni2fs0kPK/sUDimRHNLf 57HoRh8g430Ir7em7XJWkzHi8HsrJaJFX3RE7CEE= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) by sourceware.org (Postfix) with ESMTPS id 30C8B3858015 for ; Fri, 3 Dec 2021 12:09:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 30C8B3858015 Received: by mail-wm1-x34a.google.com with SMTP id y141-20020a1c7d93000000b0033c2ae3583fso1450775wmc.5 for ; Fri, 03 Dec 2021 04:09:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=DbWThjuXKM/ZTQyNuPMQBROc9d9YARIyTTf/OIgGEQg=; b=yosR/Rq1fxUfWgNpgr8i2WzTN4EygS7Y+roFJqiEHM6qehePN+1YRkzctYtkAcHffT IuYnneOQSKBgHHTt0iyb28AIilMzLjQKi2+SqrifDPkN/akb1o2DxcEvZT4e8d74bvme lEiwm6dMEPhCQoT+zdTE0K8U7JWlVJbtqOQsy7ZudFqy7E7uWoHu/QcWN3ZlZ7q0J/MX MXePBXOhtcJJZiUw3gQdMoTMOfGEV5Q4AfKVmKJ1RpiitGSTAT2tesWOi3NGrImus/Co cryhKnSczOLPrbzXx1oN291a3IyLTRPffGHCD6S3nO8+ZCpcjSXpvu1SH0UWwxSnT+FS apKg== X-Gm-Message-State: AOAM532ygB1UT+uQ8rgUdNgb18Lgy8FjdH+NCZGWyRRe5UELbvb0gC1Q 8mximppJ25nF+kJaf/G/XUngPMSfEzMaNR5Uf6pmjPq7LSDqNPV8WKQggs13Nhhojg1PEZ4gbRS zE5HUOcIs9YyqKoeBShexMok84FYymDlQhKuJmUy0BisyoRPXYk4k/gfCpoN2Vh8V0rx/r1s= X-Google-Smtp-Source: ABdhPJweATvSXdxI5Q8MXU8GipmnstsefRCbLeN8CgrWq/FwVkTrMX2lb1ph8A63fJZYeoY5gUAa/DlYr5y09Q== X-Received: from lux.lon.corp.google.com ([2a00:79e0:d:210:47e9:78df:690b:201]) (user=maennich job=sendgmr) by 2002:a05:600c:4ec7:: with SMTP id g7mr14521105wmq.138.1638533356177; Fri, 03 Dec 2021 04:09:16 -0800 (PST) Date: Fri, 3 Dec 2021 11:46:23 +0000 In-Reply-To: <20211203114622.2944173-1-maennich@google.com> Message-Id: <20211203114622.2944173-6-maennich@google.com> Mime-Version: 1.0 References: <20211203114622.2944173-1-maennich@google.com> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH 5/5] XML writer: resolve declaration-only enum definitions To: libabigail@sourceware.org X-Spam-Status: No, score=-22.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matthias Maennich via Libabigail From: =?utf-8?q?Matthias_M=C3=A4nnich?= Reply-To: Matthias Maennich Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Let the writer look through declaration-only enums for definitions. This matches what get_preferred_type, write_class_decl and write_union_decl do. No current test cases are affected. * src/abg-writer.cc (write_enum_type_decl): Look through declaration-only types the same as for structs and unions. Reviewed-by: Giuliano Procida Signed-off-by: Matthias Maennich --- src/abg-writer.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/abg-writer.cc b/src/abg-writer.cc index 76e60eb92347..31667bf7ccea 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -3020,14 +3020,16 @@ write_array_type_def(const array_type_def_sptr& decl, /// /// @return true upon succesful completion, false otherwise. static bool -write_enum_type_decl(const enum_type_decl_sptr& decl, - const string& id, - write_context& ctxt, - unsigned indent) +write_enum_type_decl(const enum_type_decl_sptr& d, + const string& id, + write_context& ctxt, + unsigned indent) { - if (!decl) + if (!d) return false; + enum_type_decl_sptr decl = is_enum_type(look_through_decl_only_enum(d)); + annotate(decl->get_canonical_type(), ctxt, indent); ostream& o = ctxt.get_ostream();