From patchwork Thu Sep 3 13:22:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 40356 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 7C1643985402; Thu, 3 Sep 2020 13:22:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C1643985402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1599139335; bh=tcPYYEGEvMMPO5YxiIM3Wi+Z7CAP9K+vANZ/HxbQnrw=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=JBWB5z0Oe4Iv7As2sLeboQKZ416n+5k18DKVjOK1SJVT4t5q64qlnEVJmkKpvFI0+ Tv1kapo7MBp7n45VdaRsw4GE460mVwBPEaeS7Y/K/9Yphe0+SJL6yVQe225oMaoAxv Asj/G4r1Kl2adhnMu8VpMLiMjYYSJSJINgH6k1+M= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-x349.google.com (mail-wm1-x349.google.com [IPv6:2a00:1450:4864:20::349]) by sourceware.org (Postfix) with ESMTPS id 6E7F338708A1 for ; Thu, 3 Sep 2020 13:22:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6E7F338708A1 Received: by mail-wm1-x349.google.com with SMTP id c72so962551wme.4 for ; Thu, 03 Sep 2020 06:22:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=tcPYYEGEvMMPO5YxiIM3Wi+Z7CAP9K+vANZ/HxbQnrw=; b=J9gAzFJqdUAJ2FJMiUfZvBQc8PgB13inociYA40q0bGwI1JWvVt1uXIWXR3PKbqHOY b8pUy4WdV8oYeUOGpv0LFZcawx80hPu6WoLrHdxbthw+AnYbp0fMmhZ9mSbLd3c8xftb vAWGIFpR1CxJ4uCo+TS1rOzMn42PpHooR5PwOWFyF13Iml8QFjA1w5Utk1HHY2ZR7lXr 0o42bKaLRHWWQw9Kd5DWf07TCdKfOHym5aq4VJPdQ1KWxICKYupTjo7d5sgCQrEzp1rN M52asVZCtBtqqlOANRJ/ALWu49oPMcXwDF9ps/G/YFX3jc7F6+Qzk5AQYd18JQYGRhA1 szSw== X-Gm-Message-State: AOAM5303MV/gmanOtUp9mviGfD+JGnH6vN+2s4b5yCJbtU+sp0pqUXw+ dHVrTsy2rb1meISgX3qLYu1bmziF3HKqQFpIsbOm3nCtp+LLc0eYzIzGmbLAJPYhKubCzM7mGjv JhOAVEtshu8SAbGaqW0YS5hK8gobWMDLHNDevZx3wNYBK28/7jfgbwy5TlQQaTjTRZmZ3ruU= X-Google-Smtp-Source: ABdhPJy+QKjKG8fWjfdhws+dy9XO5K2QUd/BbbfBv05Ivc/8IOBULCw1xxylwVJvIGleawi+/QzzPI3x7iOp+A== X-Received: from tef.lon.corp.google.com ([2a00:79e0:d:110:a6ae:11ff:fe11:4f04]) (user=gprocida job=sendgmr) by 2002:a05:600c:2155:: with SMTP id v21mr2617600wml.118.1599139332357; Thu, 03 Sep 2020 06:22:12 -0700 (PDT) Date: Thu, 3 Sep 2020 14:22:03 +0100 In-Reply-To: <20200903132205.589136-1-gprocida@google.com> Message-Id: <20200903132205.589136-2-gprocida@google.com> Mime-Version: 1.0 References: <20200903132205.589136-1-gprocida@google.com> X-Mailer: git-send-email 2.28.0.402.g5ffc5be6b7-goog Subject: [PATCH 1/3] abg-corpus-priv.h: include abg-corpus.h 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" This commit eliminates a clang diagnostic error that can occur if the header abg-corpus-priv.h alone is compiled as the type corpus was incomplete at the point various nested types were defined. * src/abg-corpus-priv.h: Include abg-corpus.h. Signed-off-by: Giuliano Procida --- src/abg-corpus-priv.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/abg-corpus-priv.h b/src/abg-corpus-priv.h index ee8c82396..d8b75cb26 100644 --- a/src/abg-corpus-priv.h +++ b/src/abg-corpus-priv.h @@ -30,6 +30,7 @@ #define __ABG_CORPUS_PRIV_H__ #include "abg-internal.h" +#include "abg-corpus.h" #include "abg-regex.h" #include "abg-sptr-utils.h" From patchwork Thu Sep 3 13:22:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 40357 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 C1D8E386102B; Thu, 3 Sep 2020 13:22:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1D8E386102B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1599139337; bh=eZOPDiVHnks+xR0jBhw8ppXTOZkGcgruU855lnxl1AU=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=iDmh10k5HrThX4nFmgRarz5OIuRTHRhxxFsTz+9JCtiXkjBU9tIlnUBZbLcC8OZqv QLN3ZIHct8y6zSK4+VtekIuLXjyMSXtljeZKsjOo29I4bAVWHw2NY/LI85DOdOSE3O sflcY820xePcKkO30leqzr4Y3uzYuzjjxQQXrL84= 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 8F6963985408 for ; Thu, 3 Sep 2020 13:22:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8F6963985408 Received: by mail-wm1-x34a.google.com with SMTP id z1so985200wmk.1 for ; Thu, 03 Sep 2020 06:22:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=eZOPDiVHnks+xR0jBhw8ppXTOZkGcgruU855lnxl1AU=; b=PiaFsFIRtil8fKShJbMLBjuBoLCWLPjnPuWvD6s1ROuRAmzAIRoJfeGBPWM7U8Rq2+ /QFLGDeRyteXEFvt1xqT/Q4yVZbe5xZfvvl7CyORdwYnkx+nQNxNJL+hlp7tZ8Lo6xNt rmfAjSa5TnuGSJQnZb9kLCH7p4wwyR1e3n3x4dvc1Yqc3o8tFGoOh8r9E15uvwdIrklY EvzM18Yr6HWgvUbsA6oVobysuXCjBQ0lEYHxo9k8unHX6MAl+JRzXcuRDrU+RkUVcFx6 w5uOoRUAqDrIPJ8vuh23JJC7rss+n6ffDCU9Ow/txJlswxHumh/q13ge3HkGFU4uRQtN Dspw== X-Gm-Message-State: AOAM531FSiLIZKz5iG0Iy9o4RV5wQ9FjcFf1zfwKsXSj1Bz45bJ7pqaL Tzt1o8wQAyJC7jsU+w7h6R4pnOEdjcISmi8wRNrPCcva0hlbOLvtdRctJ2L6+YdOT1QqbWG5gcW 3J6a+onl9IuuE/1z5tYvgIpAwl2/XwEGI6cRoDnK4lcYNw0CRoUFXJEuW+bvKOAasqU1F01s= X-Google-Smtp-Source: ABdhPJy2K0LHc87wOV5IkW+rIFqvyBwUKEtpdjpHCOIi/RVOZe8H4kUvpCoG0wV0LE2/YvdM8zItaTqeflipxw== X-Received: from tef.lon.corp.google.com ([2a00:79e0:d:110:a6ae:11ff:fe11:4f04]) (user=gprocida job=sendgmr) by 2002:adf:b602:: with SMTP id f2mr2385613wre.186.1599139334613; Thu, 03 Sep 2020 06:22:14 -0700 (PDT) Date: Thu, 3 Sep 2020 14:22:04 +0100 In-Reply-To: <20200903132205.589136-1-gprocida@google.com> Message-Id: <20200903132205.589136-3-gprocida@google.com> Mime-Version: 1.0 References: <20200903132205.589136-1-gprocida@google.com> X-Mailer: git-send-email 2.28.0.402.g5ffc5be6b7-goog Subject: [PATCH 2/3] Fix readability-redundant-smartptr-get warnings To: libabigail@sourceware.org X-Spam-Status: No, score=-23.3 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" clang-tidy's readability-redundant-smartptr-get warning is triggered when it detects a redundant "get" of various smart pointer types in boolean context. This commit fixes these warnings. * tools/kmidiff.cc (main): Remove redundant .get() when testing smart pointers. Signed-off-by: Giuliano Procida --- tools/kmidiff.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/kmidiff.cc b/tools/kmidiff.cc index 2840eb086..41584d3ae 100644 --- a/tools/kmidiff.cc +++ b/tools/kmidiff.cc @@ -416,7 +416,7 @@ main(int argc, char* argv[]) file_type ftype = guess_file_type(opts.kernel_dist_root1); if (ftype == FILE_TYPE_DIR) { - debug_info_root_dir = opts.di_root_path1.get() + debug_info_root_dir = opts.di_root_path1 ? opts.di_root_path1.get() : ""; @@ -443,7 +443,7 @@ main(int argc, char* argv[]) file_type ftype = guess_file_type(opts.kernel_dist_root2); if (ftype == FILE_TYPE_DIR) { - debug_info_root_dir = opts.di_root_path2.get() + debug_info_root_dir = opts.di_root_path2 ? opts.di_root_path2.get() : ""; group2 = From patchwork Thu Sep 3 13:22:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 40358 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 134FE386102B; Thu, 3 Sep 2020 13:22:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 134FE386102B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1599139340; bh=fV7omqMy/j+6s8/iz0i4sHHkzs0Oz1Xfe0gjbhOfrY4=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=qkP5Xg7sasa5DLXQeGlmxydVXb5OO3qnvrG27zfiSuYNqYkzIFvz3Nf/TU/oJsiDp 0vi5E9SpdFKyJvN24Lf+Ek63mK4eX2rW5GQ3q9s8LCiKOsiojfECH36eiW0bK9+iUQ QnmlYxIVVJvZH2pwZtuMbrdO1erN2tDssdFR0r7g= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by sourceware.org (Postfix) with ESMTPS id 6E4C93984FCD for ; Thu, 3 Sep 2020 13:22:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6E4C93984FCD Received: by mail-yb1-xb4a.google.com with SMTP id k74so2764331ybf.23 for ; Thu, 03 Sep 2020 06:22:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=fV7omqMy/j+6s8/iz0i4sHHkzs0Oz1Xfe0gjbhOfrY4=; b=Rq0cnW1W5thdGcZNSObUQNqjIiEXCPshyx9+Vdpcs4HOYVYn3ndEf53DRBo6hkk25J y3q6TjNMvUrAHbJkwJOsP6AKH8V7zm0Gx1t3PS3JNy02efCb6ijcE0xujZPko2201vGI 83qIOSOhlD0iBSy8j3L0jpVk9AIQ7OYswtY0B2sBsAPbuYi+0NhhSf1s/S7ezjgNUx4y kBQxQMCuFbsVMI72mvwAZdqlKMrmGfBq63inkbY06diRHuDrqANJ1u8/jY3EN4xQibL+ BElxTBO+rrtAkC/UhkwpymocExS1AR64AxQkPdPyFR4g37cXy1fktEcLHUB1aQ/CRaKQ 4SXw== X-Gm-Message-State: AOAM533g91/PbOUHxLfs9cuF1tyLimzV9YpvMt0jPmn1D4KVVLStW8Hx aB0AFAZPX71LM9yNe17nRApCsM/AojItEiylj+0RHiR7VSbE5AXHvWuWa6sIHJcmJOslcSSfCFx NR6GpPcBz055yahVSZpvNsm5WEd8oyh5RClfkZGok/VNEEQLQQpYxvPpNTgmYYg3Aqx536mY= X-Google-Smtp-Source: ABdhPJye2KShfa5bJlyWfoGpUhHu306w9IkjCMTIMcw8Y6u6W/6S0nwwpBVwJnDzkUuUNxUoGQFa8G4yU+ujjQ== X-Received: from tef.lon.corp.google.com ([2a00:79e0:d:110:a6ae:11ff:fe11:4f04]) (user=gprocida job=sendgmr) by 2002:a25:843:: with SMTP id 64mr2433340ybi.311.1599139336816; Thu, 03 Sep 2020 06:22:16 -0700 (PDT) Date: Thu, 3 Sep 2020 14:22:05 +0100 In-Reply-To: <20200903132205.589136-1-gprocida@google.com> Message-Id: <20200903132205.589136-4-gprocida@google.com> Mime-Version: 1.0 References: <20200903132205.589136-1-gprocida@google.com> X-Mailer: git-send-email 2.28.0.402.g5ffc5be6b7-goog Subject: [PATCH 3/3] Fix performance-unnecessary-copy-initialization warnings To: libabigail@sourceware.org X-Spam-Status: No, score=-22.4 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" clang-tidy's performance-unnecessary-copy-initialization warning is triggered when it detects unncessary copying of objects. In the case of the shared_ptr types used by libabigail, the extra cost is primarily that of manipulating reference counts. This commit addresses these warnings. Note that while they are unlikely to be genuine performance issues, eliminating them means we'll be able to spot new issues more easily. * include/abg-diff-utils.h (compute_diff): Take const reference to point instead of copying. * src/abg-comparison-priv.h (elf_symbol_comp::operator()): Take const references to strings instead of copying. * src/abg-default-reporter.cc (default_reporter::report): Take const references to diff_sptrs instead of copying. * src/abg-dwarf-reader.cc (die_location): Take a const reference to translation_unit_sptr instead of copying. * src/abg-ir.cc (function_decls_alias): Take const references to elf_symbol_sptrs instead of copying. (virtual_member_function_less_than::operator()): Take const reference to location instead of copying. (methods_equal_modulo_elf_symbol): Modify objects through given shared pointers rather than copies thereof. * src/abg-suppression.cc (function_suppression::suppresses_function): Take const references to elf_symbol_sptrs instead of copying them. * tools/abipkgdiff.cc (create_private_types_suppressions): Take const reference to package_sptr instead of copying. Signed-off-by: Giuliano Procida --- include/abg-diff-utils.h | 2 +- src/abg-comparison-priv.h | 3 ++- src/abg-default-reporter.cc | 4 ++-- src/abg-dwarf-reader.cc | 2 +- src/abg-ir.cc | 11 ++++++----- src/abg-suppression.cc | 8 ++++---- tools/abipkgdiff.cc | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/abg-diff-utils.h b/include/abg-diff-utils.h index b59ffa04f..d113e8380 100644 --- a/include/abg-diff-utils.h +++ b/include/abg-diff-utils.h @@ -1623,7 +1623,7 @@ compute_diff(RandomAccessOutputIterator a_base, if (snak.has_vertical_edge()) { - point p = snak.intermediate(); + const point& p = snak.intermediate(); insertion ins(p.x()); ins.inserted_indexes().push_back(p.y()); ses.insertions().push_back(ins); diff --git a/src/abg-comparison-priv.h b/src/abg-comparison-priv.h index b82b5d070..8e17155fd 100644 --- a/src/abg-comparison-priv.h +++ b/src/abg-comparison-priv.h @@ -981,7 +981,8 @@ struct elf_symbol_comp bool operator()(const elf_symbol& l, const elf_symbol& r) { - string name1 = l.get_id_string(), name2 = r.get_id_string(); + const string& name1 = l.get_id_string(); + const string& name2 = r.get_id_string(); return name1 < name2; } diff --git a/src/abg-default-reporter.cc b/src/abg-default-reporter.cc index f8572f25c..03c1137fd 100644 --- a/src/abg-default-reporter.cc +++ b/src/abg-default-reporter.cc @@ -489,7 +489,7 @@ default_reporter::report(const reference_diff& d, ostream& out, report_local_reference_type_changes(d, out, indent); if (k & SUBTYPE_CHANGE_KIND) - if (diff_sptr dif = d.underlying_type_diff()) + if (const diff_sptr& dif = d.underlying_type_diff()) { RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2(dif, "referenced type"); @@ -680,7 +680,7 @@ default_reporter::report(const array_diff& d, ostream& out, d.second_array(), "array type"); - diff_sptr dif = d.element_type_diff(); + const diff_sptr& dif = d.element_type_diff(); if (dif->to_be_reported()) { string fn = ir::get_pretty_representation(is_type(dif->first_subject())); diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 7c56bd8c4..88d775b99 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -8426,7 +8426,7 @@ die_location(const read_context& ctxt, const Dwarf_Die* die) if (!file.empty() && line != 0) { - translation_unit_sptr tu = ctxt.cur_transl_unit(); + const translation_unit_sptr& tu = ctxt.cur_transl_unit(); location l = tu->get_loc_mgr().create_new_location(file, line, 1); return l; } diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 358a7a26a..68afd6ea1 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -17746,7 +17746,8 @@ function_decl::get_id() const bool function_decls_alias(const function_decl& f1, const function_decl& f2) { - elf_symbol_sptr s1 = f1.get_symbol(), s2 = f2.get_symbol(); + const elf_symbol_sptr& s1 = f1.get_symbol(); + const elf_symbol_sptr& s2 = f2.get_symbol(); if (!s1 || !s2) return false; @@ -20490,7 +20491,8 @@ struct virtual_member_function_less_than { string fn_filepath, sn_filepath; unsigned line = 0, column = 0; - location fn_loc = f.get_location(), sn_loc = s.get_location(); + const location& fn_loc = f.get_location(); + const location& sn_loc = s.get_location(); if (fn_loc) fn_loc.expand(fn_filepath, line, column); if (sn_loc) @@ -20710,10 +20712,9 @@ class_decl::get_hash() const /// @return true iff @p f equals @p s without taking their linkage /// name or symbol into account. static bool -methods_equal_modulo_elf_symbol(const method_decl_sptr& f, - const method_decl_sptr& s) +methods_equal_modulo_elf_symbol(const method_decl_sptr& first, + const method_decl_sptr& second) { - method_decl_sptr first = f, second = s; elf_symbol_sptr saved_first_elf_symbol = first->get_symbol(); elf_symbol_sptr saved_second_elf_symbol = diff --git a/src/abg-suppression.cc b/src/abg-suppression.cc index ae7cc95ce..d6ee9dc56 100644 --- a/src/abg-suppression.cc +++ b/src/abg-suppression.cc @@ -2500,7 +2500,7 @@ function_suppression::suppresses_function(const function_decl* fn, // function only if the suppression condition matches the // names of all aliases. string symbol_name; - elf_symbol_sptr sym = fn->get_symbol(); + const elf_symbol_sptr& sym = fn->get_symbol(); ABG_ASSERT(sym); symbol_name = sym->get_name(); if (sym->has_aliases() && sym->get_alias_from_name(fname)) @@ -2534,7 +2534,7 @@ function_suppression::suppresses_function(const function_decl* fn, // function only if the suppression condition matches *all* // the aliases. string symbol_name; - elf_symbol_sptr sym = fn->get_symbol(); + const elf_symbol_sptr& sym = fn->get_symbol(); ABG_ASSERT(sym); symbol_name = sym->get_name(); if (sym->has_aliases()) @@ -2565,7 +2565,7 @@ function_suppression::suppresses_function(const function_decl* fn, // function only if the suppression condition matches *all* // the aliases. string symbol_name; - elf_symbol_sptr sym = fn->get_symbol(); + const elf_symbol_sptr& sym = fn->get_symbol(); ABG_ASSERT(sym); symbol_name = sym->get_name(); if (sym->has_aliases()) @@ -2604,7 +2604,7 @@ function_suppression::suppresses_function(const function_decl* fn, // Check if the "symbol_name", "symbol_name_regexp", and // "symbol_name_not_regexp" properties match. string fn_sym_name, fn_sym_version; - elf_symbol_sptr sym = fn->get_symbol(); + const elf_symbol_sptr& sym = fn->get_symbol(); if (sym) { fn_sym_name = sym->get_name(); diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index 445e24068..c24868afd 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -1489,7 +1489,7 @@ create_private_types_suppressions(const package& pkg, const options &opts) { suppressions_type supprs; - package_sptr devel_pkg = pkg.devel_package(); + const package_sptr& devel_pkg = pkg.devel_package(); if (!devel_pkg || !file_exists(devel_pkg->extracted_dir_path()) || !is_dir(devel_pkg->extracted_dir_path()))