From patchwork Thu Jul 9 18:22:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 40006 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 17F66384402B; Thu, 9 Jul 2020 18:23:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17F66384402B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594318991; bh=myXFLXvWho35yGTatYPByswebVsRyU7pRCWRQOd/VMM=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=p4OHhcr11e9Hr8z/Ko/a/2Hwqg4cskwkCXBKL8m9FEm8kZgZbIcdfsrSMICufJVJX VSnivoPaBFR3u2aLV6WHv6rFn00c46swfL3fMyQUP35tmZp4CS19zS6QxoqXaAVGsb fK0RIWriOI5EZ3Ec28UM22FF5WT/6vSJHXgaFSOs= 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 EAC0F3844047 for ; Thu, 9 Jul 2020 18:23:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EAC0F3844047 Received: by mail-wm1-x349.google.com with SMTP id z11so2993204wmg.5 for ; Thu, 09 Jul 2020 11:23:08 -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=myXFLXvWho35yGTatYPByswebVsRyU7pRCWRQOd/VMM=; b=Wv6g7Skt1mYZXDms/Kt6YF9NisGEmkxLP9MSdASr/r04hGA4fR7pxqaaiZ92YUAJPs j+tpsWhH/YuFaHGvXpP9Doo8K6LOPD0iPdCsQAr+9P254YPosD6lU4Ma4/PSIIPgK3Ym j9UDh3dpJ1r0mQ5vU7njybA7DyHVD3u/lMBrGnFdjQTKkyxeNLrJHMGw2H0MdElfjbkA a1yG4UmunyeemfYCjQSvBPoykZNrN/N/acz67lzExtywHZFWC4+O5987CA6Vg3r8oxEx EHKVxMgoPTXja6MrEh5PgnZQEXdIW/zMFm68J1ooGeX1VbSL+J6gMwPJF83HFuF63gWE Y5Gg== X-Gm-Message-State: AOAM531AJVu53EWJwXX0GXeCICRmL3uazqhJP7UVsyN5XNFSL0nozlBD YK16epbCzsO7eBKDfwK3GSMR9/swm0FLWnFMO4ezUPMv+0+DJ2+nhS+vZhc8E51j5Ep+ep37B2s wHNZWErk38v6oaRC6oOvM8ge/NAQbD79j5QKf5X/sEabMyNso/sX+KOnADnA/XILw8Io3ukw= X-Google-Smtp-Source: ABdhPJwgO1X9OLxLizsHVDfOIF7OGdbK5atWHtKleWQ4Vc9lvVNaRuhZta/3SbDMlI1nRu3pMeL5qOWtaqaeKg== X-Received: by 2002:a05:600c:2317:: with SMTP id 23mr1330368wmo.72.1594318987501; Thu, 09 Jul 2020 11:23:07 -0700 (PDT) Date: Thu, 9 Jul 2020 19:22:48 +0100 In-Reply-To: <20200709182250.1677238-1-gprocida@google.com> Message-Id: <20200709182250.1677238-2-gprocida@google.com> Mime-Version: 1.0 References: <20200709164523.1578400-1-gprocida@google.com> <20200709182250.1677238-1-gprocida@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 1/3] Drop traversable_base::traverse method. To: libabigail@sourceware.org X-Spam-Status: No, score=-23.6 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 traverse method is defined in the traversable_base class but is never used as the synonymous methods in the derived classes have different argument types and so hide it. The function can be removed and consequently the source file abg-traverse.cc too. This removes a trigger of Clang's -Werror-overloaded-virtual which is enabled with -Wmost which is enabled by -Wall. * include/abg-traverse.h (class traversable_base): Add class-level comment about expected usage, drop declaration of traverse method. * src/Makefile.am: Remove mention of src/abg-traverse.cc. * src/abg-traverse.cc: Remove file as it only contains the unused traversable_base::traverse method. Signed-off-by: Giuliano Procida Reviewed-by: Matthias Maennich --- include/abg-traverse.h | 21 ++++++--------------- src/Makefile.am | 1 - src/abg-traverse.cc | 43 ------------------------------------------ 3 files changed, 6 insertions(+), 59 deletions(-) delete mode 100644 src/abg-traverse.cc diff --git a/include/abg-traverse.h b/include/abg-traverse.h index a7170dad..2cb84804 100644 --- a/include/abg-traverse.h +++ b/include/abg-traverse.h @@ -44,6 +44,12 @@ struct node_visitor_base /// The interface for types which are feeling social and want to be /// visited during the traversal of a hierarchy of nodes. +/// +/// It is expected that classes derived from traversable_base define a +/// traverse method specialised to the node *visitor* type. Such +/// methods should visit nodes recursively, calling +/// ir_node_visitor::visit for each node. The method should return +/// true until all nodes have been visited. class traversable_base { bool visiting_; @@ -78,21 +84,6 @@ public: {} virtual ~traversable_base() {} - - /// This virtual method is overloaded and implemented by any single - /// type which instance is going to be visited during the traversal - /// of translation unit nodes. - /// - /// The method visits a given node and, for scopes, visits their - /// member nodes. Visiting a node means calling the - /// ir_node_visitor::visit method with the node passed as an - /// argument. - /// - /// @param v the visitor used during the traverse. - /// - /// @return true if traversed until the end of the type tree, false - /// otherwise. - virtual bool traverse(node_visitor_base& v); }; }// end namespace ir. diff --git a/src/Makefile.am b/src/Makefile.am index 1153a5f8..7684e373 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -13,7 +13,6 @@ endif libabigail_la_SOURCES = \ abg-internal.h \ -abg-traverse.cc \ abg-ir-priv.h \ abg-ir.cc \ abg-corpus-priv.h \ diff --git a/src/abg-traverse.cc b/src/abg-traverse.cc deleted file mode 100644 index 3fb87ea2..00000000 --- a/src/abg-traverse.cc +++ /dev/null @@ -1,43 +0,0 @@ -// -*- Mode: C++ -*- -// -// Copyright (C) 2013-2020 Red Hat, Inc. -// -// This file is part of the GNU Application Binary Interface Generic -// Analysis and Instrumentation Library (libabigail). This library is -// free software; you can redistribute it and/or modify it under the -// terms of the GNU Lesser General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) any -// later version. - -// This library is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Lesser Public License for more details. - -// You should have received a copy of the GNU Lesser General Public -// License along with this program; see the file COPYING-LGPLV3. If -// not, see . - -/// @file - -#include "abg-internal.h" -// -ABG_BEGIN_EXPORT_DECLARATIONS - -#include "abg-traverse.h" - -ABG_END_EXPORT_DECLARATIONS -// - -namespace abigail -{ - -namespace ir -{ - -bool -traversable_base::traverse(node_visitor_base&) -{return true;} - -}// end namaspace ir -}// end namespace abigail From patchwork Thu Jul 9 18:22:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 40007 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 5F1103844045; Thu, 9 Jul 2020 18:23:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F1103844045 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594318994; bh=2HIgEOrJasAlRmIYVN9ZynFv54m3IZ+UDks8zEoMl7E=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=sKvp+1NgaGY9/wPbac5dAIjf3zkrFhuiCoR3TDCPiB9D18WcpsTMJ9dUz2xwsxMnd 5f8BW7O40XNOVfH+tA2yNLeHnP1dozn5uQXeiQmRQlMsvfaLZhSBParGzlMT0JEScW BXWEm7e2gszhszvUgtKPVlr29tKiqW12D9/Y7rSM= 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 0B49F384B13D for ; Thu, 9 Jul 2020 18:23:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0B49F384B13D Received: by mail-qv1-xf4a.google.com with SMTP id k3so1976689qvm.11 for ; Thu, 09 Jul 2020 11:23:10 -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=2HIgEOrJasAlRmIYVN9ZynFv54m3IZ+UDks8zEoMl7E=; b=Cn1DwFH4kg5vackYUqGYcjR55tMY3rp/UiQW9Z0v+A6u3FBR674gzz6beVWzs/9erY xkFp+t9nJyd6Bz/eRqA+N3pzymjQZE7LaLndnpkLXkFL8asI/mb4UDe6jYZ9q4raaqwu Gy0NGAxx0Oj3dodYAgg+JRbjYrI7re4e76E58jIsktx4HAoxtZF2wxXLO85H86todYEG 8jA/hGX1XBSqjbxcm5g+a1ONI0lJqAAfBhTQ2wLt2PLImBpuVvzcdQGeGl2NI1BlPbRo t3f80lxIrWuKxBi5Yt6aVqwDWN2nvJXyNU8dFUUsV9tSABMYtO+HINob3RLUNG9YXSNA igOA== X-Gm-Message-State: AOAM530xsR4QjkkCQju2SYcP7Hx6elf4FHViOZGqvHkxy32B+6AuecXO byhsS7ubogOO/f06rrkZOLhpW8mNLMp/8X7A9PWpzP7FLHarh5zY5deEMKCRtnjQSV95DwePXBV CoblqrKhOikvBImDn4+7putkpe0Nj+s5VGSaj0hc73TI+KAihf4g/KaQmlcCJEdfLtGVkUXI= X-Google-Smtp-Source: ABdhPJxR6MTEXoROvkxVydl+cpOGZT2Sugv2aVwpGkQxiIKfITZnEgLMBaeDuND6lZTW67keNYL5NextCtc+WA== X-Received: by 2002:a05:6214:328:: with SMTP id j8mr48916650qvu.75.1594318989591; Thu, 09 Jul 2020 11:23:09 -0700 (PDT) Date: Thu, 9 Jul 2020 19:22:49 +0100 In-Reply-To: <20200709182250.1677238-1-gprocida@google.com> Message-Id: <20200709182250.1677238-3-gprocida@google.com> Mime-Version: 1.0 References: <20200709164523.1578400-1-gprocida@google.com> <20200709182250.1677238-1-gprocida@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 2/3] Fix inheritance of scope_decl::insert_member_decl 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 classes class_decl, class_or_union and scope_decl derive from each other. The method insert_member_decl is declared virtual and defined in each of these. Unfortunately, it has different argument types in the base scope_decl class. Most calls to insert_member_decl are at a statically known class, but in insert_decl_into_scope the method is called via a scope_decl pointer. There is the possibility that this could be a type derived from scope_decl rather than scope_decl itself, in which case the base method would be called, not as intended. This commit adjusts the type of the member argument to scope_decl::insert_member_decl to match the other two classes and eliminates the last trigger of Clang's -Werror-overloaded-virtual. * include/abg-ir.h (scope_decl::insert_member_decl): Change type of member argument from const decl_base_sptr& to plain decl_base_sptr. * src/abg-ir.cc (scope_decl::insert_member_decl): Likewise. Signed-off-by: Giuliano Procida Reviewed-by: Matthias Maennich --- include/abg-ir.h | 3 +-- src/abg-ir.cc | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/abg-ir.h b/include/abg-ir.h index c2b66c4c..ea6a7ce4 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -1653,8 +1653,7 @@ protected: add_member_decl(const decl_base_sptr& member); virtual decl_base_sptr - insert_member_decl(const decl_base_sptr& member, - declarations::iterator before); + insert_member_decl(decl_base_sptr member, declarations::iterator before); virtual void remove_member_decl(decl_base_sptr member); diff --git a/src/abg-ir.cc b/src/abg-ir.cc index a434ec69..a257cf67 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -6081,7 +6081,7 @@ scope_decl::add_member_decl(const decl_base_sptr& member) /// @param before an interator pointing to the element before which /// the new member should be inserted. decl_base_sptr -scope_decl::insert_member_decl(const decl_base_sptr& member, +scope_decl::insert_member_decl(decl_base_sptr member, declarations::iterator before) { ABG_ASSERT(!member->get_scope()); From patchwork Thu Jul 9 18:22:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 40008 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 A71003844033; Thu, 9 Jul 2020 18:23:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A71003844033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594318994; bh=jXi8zv+30Kxvm+KH2F+7O3ae/o375zrPmofybeVXwpo=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=yMeQjfc8h7SH9mMscjBtZzncKThVR298ob7bNpSNaaKf/q4M0aSLEwH2WdsNu0+Q1 7dl8qPDJw5HFjIofFe4mGonxuHxlHbwlUq8yUzvd6g+lqNSODcz23mJe0RCBclboIo q4Dbu4C4s8yqIslLWwM7s5VNLnA0aIdMb/py2aBo= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by sourceware.org (Postfix) with ESMTPS id 3A4643844045 for ; Thu, 9 Jul 2020 18:23:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3A4643844045 Received: by mail-qt1-x849.google.com with SMTP id t36so2256500qtc.16 for ; Thu, 09 Jul 2020 11:23:12 -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=jXi8zv+30Kxvm+KH2F+7O3ae/o375zrPmofybeVXwpo=; b=hY6/NE0MUbm4kFSoYdM0UjVLb000Ousje6SdmdSrLtszPmspLjaEceqKn21TxYJ4L1 n6hJm21gyZfNf2vgTS+WJt59UEtX9tKobZCGSe0net4Nn08do0btAe2vnR5GLSYYi1iF JhXwftGVsf9NLIaqlg5pN3I22oDkhGlLMZ6GYEx4F4uHRMMQ7Fiu2ETd+2VJX0UNIWaZ LoOvLk3JyycTJ4Q9YHNsOTFZ8VGzKxt0YUI/4vsoVQXN2+NygGF8G08dpc0z9gWvkSdB P5AetlbtgL1dWCFQo5Z/aVc0PGrIx2e4jEMoP57h4TPyd1OcW/kt+vhI7tEOmRuAEOLU 84kA== X-Gm-Message-State: AOAM533sHvvyS9WByGePU0na3B4ua6MpZiy5ZK73e2FIr+L3eB9Z/qQW boAXJZfHBzZA/Q0pdqtoQRmhsDRKKPoo4fVKjHKfaa/tC1ShnE4hv/xSDs1NLzldkwkCE9ZtBzQ nF9zO8rrYURxpOIvavCCup9xVCSDY8GFGa/oNscQGrTunjB9pHNzn/RmIak61RW/LR5wPPpc= X-Google-Smtp-Source: ABdhPJwPR4IW2mGaPT/TCCE2S7RV4Uxe3l2JWvdVmZqYtz1LD+7ZjzKOhQRIRQG2ZLETO0NQOPLu1QVTSJ6PVg== X-Received: by 2002:ad4:434c:: with SMTP id q12mr18881766qvs.203.1594318991679; Thu, 09 Jul 2020 11:23:11 -0700 (PDT) Date: Thu, 9 Jul 2020 19:22:50 +0100 In-Reply-To: <20200709182250.1677238-1-gprocida@google.com> Message-Id: <20200709182250.1677238-4-gprocida@google.com> Mime-Version: 1.0 References: <20200709164523.1578400-1-gprocida@google.com> <20200709182250.1677238-1-gprocida@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH 3/3] Enable Clang's -Werror-overloaded-virtual. To: libabigail@sourceware.org X-Spam-Status: No, score=-22.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" Just to see what's still there. Signed-off-by: Giuliano Procida --- configure.ac | 6 ------ 1 file changed, 6 deletions(-) diff --git a/configure.ac b/configure.ac index 225ac38f..904a726e 100644 --- a/configure.ac +++ b/configure.ac @@ -646,12 +646,6 @@ if test x$ENABLE_UBSAN = xyes; then CXXFLAGS="$CXXFLAGS -fsanitize=undefined" fi -dnl Check if we compile with clang and set flags accordingly -dnl TODO: fix that warning (spoiler: not trivial) -if `$CXX -v 2>&1 | grep 'clang version' > /dev/null 2>&1`; then - CXXFLAGS="$CXXFLAGS -Wno-error-overloaded-virtual" -fi - dnl Check if several decls and constant are defined in dependant dnl libraries HAS_EM_AARCH64=no