From patchwork Thu Jul 9 13:14:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39993 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 C9AAB384403B; Thu, 9 Jul 2020 13:14:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9AAB384403B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594300480; bh=pSlbnHr1oLZNL7tN50ZFAlPCg7qVnsNkkxbYZ5rm6Wc=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Rl5c+B6qi5cwMZecxKzFoZtPVdumKkwU6GUSyAMIiWuMUtU2t5k74+beh7zENlfHE KEpLDwfXZaqRr67xLQh5hldV7OguTtBEdKqbbygSD/XP20M0zqSvegbJs3X0UBLvOt qgfQ/9z4dlh8BbNWa7KX02tQ3tBvGRsPTWUv4sD4= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by sourceware.org (Postfix) with ESMTPS id 365AA3846417 for ; Thu, 9 Jul 2020 13:14:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 365AA3846417 Received: by mail-qt1-x84a.google.com with SMTP id i5so1581406qtw.3 for ; Thu, 09 Jul 2020 06:14:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=pSlbnHr1oLZNL7tN50ZFAlPCg7qVnsNkkxbYZ5rm6Wc=; b=UZiySazqx+cNMdAFnJcY7D9gJUmrW5+zJCIiOzHtiEZwfaF56KKFhf83tEvdFkaRkn +00RTPnjuqOGj4e7F1v+X4476IhqJ9DHQ+MF6sjCny8PWvYZlsEzsvHCxNWdvz6vTB8G Fz8l3bdAw4PP2lAwtJh5dVkDKv1kN81SZ8ABTCREDSEe53s1y/knVaBzaDeAU4OmLNZu OjTYoOLpqGoo6WYCNUSMEYHrm8oeJgWULK2jEnWUiCA6nJ1SmpGaUAVlSlHPN/e0XAXT ovc5gBlR/mdwu+fxc0qENieGFXeHXJAv7Iaw7AWXBSAXPKH0+JML6L73iVZcROTKNZvq BMfA== X-Gm-Message-State: AOAM532ztflor22hJpQm8VuXHidGuWEdz3xuKEoUYz5emdD4+XguAKpK U/RCfnBmczXmgu4uXCTzWq1lG6uerpeAQFxq3E0hr+BrWijRyTUTCsPJrTIb2B1wOu4mXGP/+qB k4ZRBZH9ILg1pPnTBOqDhLFcoF0v3bld1V/uw6qIym3Sc3TDScVkiFp9jPBnnsg500+W1dLE= X-Google-Smtp-Source: ABdhPJzC1LRy6fedYQzf5I5SGggFJeO1TjvZkD8Z0I3tMdoTINoX9NER23M1LGoA8gd9fQGEIgs/IR2KuK/0aA== X-Received: by 2002:a0c:bd15:: with SMTP id m21mr63788519qvg.61.1594300477575; Thu, 09 Jul 2020 06:14:37 -0700 (PDT) Date: Thu, 9 Jul 2020 14:14:27 +0100 In-Reply-To: <20200709131429.1366074-1-gprocida@google.com> Message-Id: <20200709131429.1366074-2-gprocida@google.com> Mime-Version: 1.0 References: <20200709131429.1366074-1-gprocida@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 1/3] abg-comparison.h: Remove stray declaration 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Giuliano Procida via Libabigail From: Giuliano Procida Reply-To: Giuliano Procida Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" The functon is_reference_or_pointer_diff_to_non_basic_distinct_types was declared in ef9d20c9 Fix redundancy detection through fn ptr and typedef paths but never defined. This commit removes it. There are no functional changes. * include/abg-comparison (is_reference_or_pointer_diff_to_non_basic_distinct_types): Remove stray declaration. Signed-off-by: Giuliano Procida Reviewed-by: Matthias Maennich --- include/abg-comparison.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/abg-comparison.h b/include/abg-comparison.h index d107bf9f..84258209 100644 --- a/include/abg-comparison.h +++ b/include/abg-comparison.h @@ -2855,9 +2855,6 @@ is_qualified_type_diff(const diff* diff); bool is_reference_or_pointer_diff(const diff* diff); -bool -is_reference_or_pointer_diff_to_non_basic_distinct_types(const diff* diff); - const fn_parm_diff* is_fn_parm_diff(const diff* diff); From patchwork Thu Jul 9 13:14:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39994 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 1EFB33846417; Thu, 9 Jul 2020 13:14:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1EFB33846417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594300482; bh=nRl53m2BqrKBD4T4BSIupl8xojK8qZgECGw34WhruOo=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=GDc9gBUPv18akgJT9tRrYepLwRuMTQCXni9Tn2mL/7AlNlpC+iNt6lKvwX5BrZ2Pi Wd1CC2PzR31or253ApFcPezDwtEsmD3CcXzG/O2qppgFjiGh7QCNR9w1M3lFLddOQh dKtvaIvruL8XRPbfHKDpC8rclfUGh+96WGkXdqvY= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by sourceware.org (Postfix) with ESMTPS id 306F93846417 for ; Thu, 9 Jul 2020 13:14:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 306F93846417 Received: by mail-qv1-xf4a.google.com with SMTP id 59so1342574qvb.4 for ; Thu, 09 Jul 2020 06:14:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=nRl53m2BqrKBD4T4BSIupl8xojK8qZgECGw34WhruOo=; b=cq1eBTQpTvnFDRYPx6zUK7/GfrXRgkND6jjb5pjOoLSKLEP2gTeSzHDmjJ8xM8tDnH 6lTaESpDK8JJYqkRr04FHZFd41z1R0gEQ5vqjamLf9wX9U+6p1bgPsoT6BrgOUiek83l QitdVjCm0PUUHg+WU50YXPJd8PBzrk6t9X7WY+JaBaSjxBM+oIkyXIMqZqh9gZR9m6Ir NwVXYvquKV/a8ixkL1RExgWQHgCIzvxyz9My+vLHmYd1J9PmuQ/lptiWhEXtGmvS5zHH LaD3MU9367IIb+yKeHsoktb0us3PIrl1gv+/le41x6xmxhSCe7zZ/ffraeT3AN85JpVt XKhg== X-Gm-Message-State: AOAM532zLdt4e74SKoWNFIrScLP2gwBNLgUXUSbfbYowp0/E9tWcCw91 EPw4r6zpSH7vQ0v+0nROL0CRFuI7WRnM8VaQ9423DrXNtgxdn10MVDvD61Ix65I9cr/nVmm7VC5 A9+DyXAGv69kZS6uVozZVFvKFEnXCq8tlbXwhXqnM600x1TJytHjfNUwkX0AuEGtbUQykQow= X-Google-Smtp-Source: ABdhPJz0XIB8/xzqKiotlzpILVdkWMuCQDRWiiXzCNYXxuxsCiTQmIBI8SH2PFzHY12QDBkg+5CGYKsk6xFkbA== X-Received: by 2002:ad4:4903:: with SMTP id bh3mr62858587qvb.17.1594300479644; Thu, 09 Jul 2020 06:14:39 -0700 (PDT) Date: Thu, 9 Jul 2020 14:14:28 +0100 In-Reply-To: <20200709131429.1366074-1-gprocida@google.com> Message-Id: <20200709131429.1366074-3-gprocida@google.com> Mime-Version: 1.0 References: <20200709131429.1366074-1-gprocida@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 2/3] Remove unused is_reference_or_pointer_diff. To: libabigail@sourceware.org X-Spam-Status: No, score=-22.8 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Giuliano Procida via Libabigail From: Giuliano Procida Reply-To: Giuliano Procida Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" The function is_reference_or_pointer_diff was added in commit 85929105 Fix redundancy marking for change of types used directly and was updated to peel typedefs as a first step in ef9d20c9 Fix redundancy detection through fn ptr and typedef paths which, however, also made it obsolete. This commit removes the function's declaration and definition. There are no functional changes. * include/abg-comparison.h (is_reference_or_pointer_diff): Drop function declaration. * src/abg-comparison.cc (is_reference_or_pointer_diff): Drop function definition. Signed-off-by: Giuliano Procida Reviewed-by: Matthias Maennich --- include/abg-comparison.h | 2 -- src/abg-comparison.cc | 15 --------------- 2 files changed, 17 deletions(-) diff --git a/include/abg-comparison.h b/include/abg-comparison.h index 84258209..c4eb5925 100644 --- a/include/abg-comparison.h +++ b/include/abg-comparison.h @@ -2852,8 +2852,6 @@ is_reference_diff(const diff* diff); const qualified_type_diff* is_qualified_type_diff(const diff* diff); -bool -is_reference_or_pointer_diff(const diff* diff); const fn_parm_diff* is_fn_parm_diff(const diff* diff); diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc index d0f1d21b..0dbe2635 100644 --- a/src/abg-comparison.cc +++ b/src/abg-comparison.cc @@ -788,21 +788,6 @@ const qualified_type_diff* is_qualified_type_diff(const diff* diff) {return dynamic_cast(diff);} -/// Test if a diff node is either a reference diff node or a pointer -/// diff node. Note that this function also works on diffs of -/// typedefs of reference or pointer. -/// -/// @param diff the diff node to test. -/// -/// @return true iff @p diff is either reference diff node or a -/// pointer diff node. -bool -is_reference_or_pointer_diff(const diff* diff) -{ - diff = peel_typedef_diff(diff); - return is_reference_diff(diff) || is_pointer_diff(diff); -} - /// Test if a diff node is a reference or pointer diff node to a /// change that is neither basic type change nor distinct type change. /// From patchwork Thu Jul 9 13:14:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39995 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 63B613844033; Thu, 9 Jul 2020 13:14:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63B613844033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594300485; bh=gM1CedjgsAAQaY6uPCrRwZ06I4cJ6UQGBiwSY2PhoP4=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=byJtCB7ljaTwypa3UIBvNzg4RMH27dCXOvHoxuwXRrXSmRyoj0tnIHmONRHQfw6rH GrK6b0SXgor4w/2GqfCRWyFW+9fZxWHcU5ApUfQ/BBCK/Mqsp3B2qmZenqweGcpuHw FOOQILtRNJRprXFKpIe5sfkQlWieDb6Z4gvMWvFU= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wr1-x44a.google.com (mail-wr1-x44a.google.com [IPv6:2a00:1450:4864:20::44a]) by sourceware.org (Postfix) with ESMTPS id D88BC3844033 for ; Thu, 9 Jul 2020 13:14:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D88BC3844033 Received: by mail-wr1-x44a.google.com with SMTP id j16so1919527wrw.3 for ; Thu, 09 Jul 2020 06:14:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=gM1CedjgsAAQaY6uPCrRwZ06I4cJ6UQGBiwSY2PhoP4=; b=NubULiLvkUXZDTPnqi6yN9vEfhYPc7fxbQ0i9lHYItrzGpecAT+FHElAG5lB5XuwlM OJ7ukgAbBJ7vcEpDGDfSKJNJOKXkJqQW/m/aP8dwQTqI1L4MILVlN+DxonqWXcH5m4g6 a0G5Ql0REwwdiYaCoN9k6YWf5k+UGcBVMMnobUS6XPUtKzv1LFE//GTLSrpySYOcpA5o lPPj+867I3PBH4V1svxgCI+CR34LeHPuD921+LUe+juoOdpM42R2U1+MRSH+7FzymJBR jBjmAHwaWa1hvTUmM5Ua7jn/iAYnda1rYojCCppTu57pHpDByMujLR07Y5sCrxegin7N hWMA== X-Gm-Message-State: AOAM5318eae9gK6jNVTK4ZBxbnKVJfekMqpIHRriwrHCnIi+Ow5mck/1 5bv0IhYi23BQtqlkdGD+RvIDX+lMkKIrc7+skxTP13Vt3xKCvbxhlzWS9Z3pXeHAnywGTYXVDy6 9K3vppducMwSnWlW8y+N4kU96QrjFe91pTQz+Doq/mw2ZlqQj4eOhJrcgUVL+ZPixkAQqjDY= X-Google-Smtp-Source: ABdhPJzSGwNspwxLciJgUUgvZZao0HEvk0tU3v6vGpOeOYTZLS9vp/D4eyej/Nm/Ezko87yMfN5A5ry0VriFmw== X-Received: by 2002:a1c:ac81:: with SMTP id v123mr13772038wme.159.1594300481806; Thu, 09 Jul 2020 06:14:41 -0700 (PDT) Date: Thu, 9 Jul 2020 14:14:29 +0100 In-Reply-To: <20200709131429.1366074-1-gprocida@google.com> Message-Id: <20200709131429.1366074-4-gprocida@google.com> Mime-Version: 1.0 References: <20200709131429.1366074-1-gprocida@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 3/3] Simplify peel_typedef_pointer_or_reference_type To: libabigail@sourceware.org X-Spam-Status: No, score=-23.2 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Giuliano Procida via Libabigail From: Giuliano Procida Reply-To: Giuliano Procida Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces@sourceware.org Sender: "Libabigail" The second argument to this function controls whether CV qualifiers should be stripped as well as the elements mentioned in the function name. While it defaults to true, it is now always passed in as false. The function contains incomplete code for peeling array types. This is not needed or indeed wanted by its current callers. This commits removes the peel_qual_type argument and removes the associated behaviour. It removes the array peeling code. There are no functional changes apart from no longer performing early canonicalisation of certain array types. I looked at the history of this function to see where the behaviours originated. bd161caa Make type_has_non_canonicalized_subtype() tighter The function is added to help make more types, self-referential ones, candidates for early canonicalisation. 5822798d Bug 18894 - Fix representation of enumerators in abixml format This undid the previous change but the function remained. c20c8c79 Fix infinite loop in peel_typedef_pointer_or_reference_type As it says, fixing the overload that is currently in use. 6e36a438 Late canonicalize all types that reference classes when reading DWARF This reintroduced the use of the function to control canonicalisation by the detection of class types. It also added array peeling to the function, but in a broken fashion as it would only work for certain combinations of pointers, references or typedefs referring to arrays. e9bdb488 Bug 19025 - abixml writer forgets to emit some member types This added a use of the function in a map key comparison function. 8cc382c8 Fix emitting of referenced type in abixml writer This undid the previous change. 1bee40c0 Do not forget to peel qualified type off when peeling types This made the function remove CV qualifiers unconditionally. e73901a5 Do not mark "distinct" diff nodes as being redundant This made behaviour to remove CV qualifiers optional and newly added is_mostly_distinct_diff disabled it. 5d6af8d5 Delay canonicalization for array and qualified types This change switches maybe_canonicalize_type to not request CV qualifer peeling from peel_typedef_pointer_or_reference_type. It partially resolves the array type issue as they are separately checked for. Presumably they shouldn't be peeled, but still are under some circumstances. The tests here could be subject to further refinement. Many types have delayed canonicalisation already. 9cf76b11 abg-ir.cc: Improve types_have_similar_structure. This change replaced the use of the function with a more delicate matched peeling process for pointer and reference types plus peel_qualified_or_typedef_type. It obsoleted the behaviour where CV qualifiers were stripped. * include/abg-fwd.h (peel_qualified_or_typedef_type): Remove second argument in declarations of both overloads. * src/abg-comp-filter.cc (is_mostly_distinct_diff): Remove second argument to peel_qualified_or_typedef_type. * src/abg-dwarf-reader.cc (maybe_canonicalize_type): Likewise. * src/abg-ir.cc (peel_qualified_or_typedef_type): In both overloads, remove second argument peel_qual_type, simplify code with the assumption it was always false and remove incomplete array type peeling logic. In type_base_sptr overload, remove stray space. Signed-off-by: Giuliano Procida Reviewed-by: Matthias Maennich --- include/abg-fwd.h | 6 ++---- src/abg-comp-filter.cc | 6 ++---- src/abg-dwarf-reader.cc | 6 ++---- src/abg-ir.cc | 40 +++++++++------------------------------- 4 files changed, 15 insertions(+), 43 deletions(-) diff --git a/include/abg-fwd.h b/include/abg-fwd.h index f23f4a46..14b95a96 100644 --- a/include/abg-fwd.h +++ b/include/abg-fwd.h @@ -819,12 +819,10 @@ type_base* peel_qualified_or_typedef_type(const type_base* type); type_base_sptr -peel_typedef_pointer_or_reference_type(const type_base_sptr, - bool peel_qualified_type = true); +peel_typedef_pointer_or_reference_type(const type_base_sptr); type_base* -peel_typedef_pointer_or_reference_type(const type_base* type, - bool peel_qualified_type = true); +peel_typedef_pointer_or_reference_type(const type_base* type); type_base* peel_pointer_or_reference_type(const type_base *type, diff --git a/src/abg-comp-filter.cc b/src/abg-comp-filter.cc index 702d223f..a9bf2c70 100644 --- a/src/abg-comp-filter.cc +++ b/src/abg-comp-filter.cc @@ -1067,10 +1067,8 @@ is_mostly_distinct_diff(const diff *d) type_base_sptr first = is_type(td->first_subject()); type_base_sptr second = is_type(td->second_subject()); - first = peel_typedef_pointer_or_reference_type(first, - /*peel_qualified_type=*/false); - second = peel_typedef_pointer_or_reference_type(second, - /*peel_qual_type=*/false); + first = peel_typedef_pointer_or_reference_type(first); + second = peel_typedef_pointer_or_reference_type(second); ABG_ASSERT(first && second); return distinct_diff::entities_are_of_distinct_kinds(first, second); diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index ba4e750f..054ac91b 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -15740,8 +15740,7 @@ maybe_canonicalize_type(const Dwarf_Die *die, read_context& ctxt) if (!t) return; - type_base_sptr peeled_type = - peel_typedef_pointer_or_reference_type(t, /*peel_qual_types=*/false); + type_base_sptr peeled_type = peel_typedef_pointer_or_reference_type(t); if (is_class_type(peeled_type) || is_union_type(peeled_type) || is_function_type(peeled_type) @@ -15794,8 +15793,7 @@ maybe_canonicalize_type(const type_base_sptr& t, if (!t) return; - type_base_sptr peeled_type = - peel_typedef_pointer_or_reference_type(t, /*peel_qual_types=*/false); + type_base_sptr peeled_type = peel_typedef_pointer_or_reference_type(t); if (is_class_type(peeled_type) || is_union_type(peeled_type) || is_function_type(peeled_type) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index a434ec69..5ad60dfa 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -5707,23 +5707,19 @@ peel_qualified_or_typedef_type(const type_base* type) } /// Return the leaf underlying or pointed-to type node of a @ref -/// typedef_decl, @ref pointer_type_def, @ref reference_type_def or -/// @ref qualified_type_def node. +/// typedef_decl, @ref pointer_type_def or @ref reference_type_def +/// node. /// /// @param type the type to peel. /// -/// @param peel_qualified_type if true, also peel qualified types. -/// /// @return the leaf underlying or pointed-to type node of @p type. type_base_sptr -peel_typedef_pointer_or_reference_type(const type_base_sptr type, - bool peel_qual_type) +peel_typedef_pointer_or_reference_type(const type_base_sptr type) { - type_base_sptr typ = type; + type_base_sptr typ = type; while (is_typedef(typ) || is_pointer_type(typ) - || is_reference_type(typ) - || (peel_qual_type && is_qualified_type(typ))) + || is_reference_type(typ)) { if (typedef_decl_sptr t = is_typedef(typ)) typ = peel_typedef_type(t); @@ -5733,35 +5729,24 @@ peel_typedef_pointer_or_reference_type(const type_base_sptr type, if (reference_type_def_sptr t = is_reference_type(typ)) typ = peel_reference_type(t); - - if (array_type_def_sptr t = is_array_type(typ)) - typ = peel_array_type(t); - - if (peel_qual_type) - if (qualified_type_def_sptr t = is_qualified_type(typ)) - typ = peel_qualified_type(t); } return typ; } /// Return the leaf underlying or pointed-to type node of a @ref -/// typedef_decl, @ref pointer_type_def, @ref reference_type_def or -/// @ref qualified_type_def type node. +/// typedef_decl, @ref pointer_type_def or @ref reference_type_def +/// node. /// /// @param type the type to peel. /// -/// @param peel_qualified_type if true, also peel qualified types. -/// /// @return the leaf underlying or pointed-to type node of @p type. type_base* -peel_typedef_pointer_or_reference_type(const type_base* type, - bool peel_qual_type) +peel_typedef_pointer_or_reference_type(const type_base* type) { while (is_typedef(type) || is_pointer_type(type) - || is_reference_type(type) - || (peel_qual_type && is_qualified_type(type))) + || is_reference_type(type)) { if (const typedef_decl* t = is_typedef(type)) type = peel_typedef_type(t); @@ -5771,13 +5756,6 @@ peel_typedef_pointer_or_reference_type(const type_base* type, if (const reference_type_def* t = is_reference_type(type)) type = peel_reference_type(t); - - if (const array_type_def* t = is_array_type(type)) - type = peel_array_type(t); - - if (peel_qual_type) - if (const qualified_type_def* t = is_qualified_type(type)) - type = peel_qualified_type(t); } return const_cast(type);