From patchwork Thu Jul 9 16:45:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39998 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 36E04384402A; Thu, 9 Jul 2020 16:45:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36E04384402A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594313134; bh=myXFLXvWho35yGTatYPByswebVsRyU7pRCWRQOd/VMM=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:Cc:From; b=b00U30LOyLSiG1jp8v5jejv+hGo3fODD9oAkkaxdw93HmwJzxScq0Rx1iWITrwNDf kY9esnof0zNYyFZXtd9IXNyyNTnqiZUi6aJb7yLKxexbJJDAyD50qcsQc3vUXPSqv8 s+LiJCYpZgDly9Zlr1LitRlysxCFPVNAWw7TDHME= 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 1C43A384402A for ; Thu, 9 Jul 2020 16:45:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1C43A384402A Received: by mail-qt1-x84a.google.com with SMTP id m25so2076146qtk.1 for ; Thu, 09 Jul 2020 09:45:32 -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:message-id:mime-version:subject:from:to:cc; bh=myXFLXvWho35yGTatYPByswebVsRyU7pRCWRQOd/VMM=; b=V2GXUZU57G8Wd3ycaTpJ6HpDcZJ7mnRiPAPSE7n9tgJkBRFviTs7sKv6dZf4pQ65Wk vfZxudBt7hue80h/pgIiA+78xZjYoT63O5JMc3ym9leVJKZDY1lSSwH3LC1gOFbRFh5N wbx38aLKIoXfhWnFsnqUXjvN6ykiUNsXyOVkPdMipnvNSbCVyN4rlmBB8LRFWwk1wud6 gKAe1XsH60mnUbTK7a8RFcxMpz6GaoUw6Feeo3lDMoc+fp+6c6+hpixuf69wmCrLTdsF S+3M90u5CFysbgudPikTp0F6xNYR5rctTgT/pcm15MKFXbXq3N6B+27kTzGvTthCxd30 x2ew== X-Gm-Message-State: AOAM532Ygd4Hmsp4HpqzWXSnyy3iyDZDMCiX7MYnIvpTmqbpqXWfFJ6P AiBDk1smzYMHW33pbR2SyRvPnGsU3BtTZFoBphWi6DVqhpHWKslLpwwgW/AdA4fa7HYMdvjvR7A Ipx5ziBnf2NteWyNF1e5/4enaWCMQpvjrbTxLiXGQ6RulCUVUvjK8koMTKEThkvVZlr/fTGc= X-Google-Smtp-Source: ABdhPJwvmZ6YPOsq5B7u1/M4pyQDqJK5yEV+WpGCSSJwpAMm2HubRKJa9eGHUHEoZs2nqtO/iU3G5Rwq89twcQ== X-Received: by 2002:a0c:b310:: with SMTP id s16mr12411861qve.5.1594313131493; Thu, 09 Jul 2020 09:45:31 -0700 (PDT) Date: Thu, 9 Jul 2020 17:45:23 +0100 Message-Id: <20200709164523.1578400-1-gprocida@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [PATCH] Drop traversable_base::traverse method. To: libabigail@sourceware.org X-Spam-Status: No, score=-22.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 --- 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