From patchwork Wed Mar 10 13:59:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 1450537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=RR1LeX/E; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DwYbP6Jrlz9sRf for ; Thu, 11 Mar 2021 00:59:13 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2CF42383F86C; Wed, 10 Mar 2021 13:59:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2CF42383F86C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1615384751; bh=+jbirrz4ZhRMDs5p/gv+Lv/KIMUBScre3Ds1MUcOcl0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=RR1LeX/ETgy4CebonNzF2j6yJ9McOY4aw31d9YwZc6JiFXUhQe+BgZIf15Ft4f3JG GWGnPfSgar0WkPQMEjaUhA3AclJ6Qwy+N9wTIwxxdusJAA6yaPnDyCzcEwuFURJ8tI lo0MpfxrCe0pKh9eeCY/N3fZlZIBT0TNSsfr/sWE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 7F4E33844000 for ; Wed, 10 Mar 2021 13:59:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7F4E33844000 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-433-bb7mrhMKNMe5NlIXRB3pLA-1; Wed, 10 Mar 2021 08:59:06 -0500 X-MC-Unique: bb7mrhMKNMe5NlIXRB3pLA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C88A835B4C for ; Wed, 10 Mar 2021 13:59:05 +0000 (UTC) Received: from t14s.localdomain.com (ovpn-114-98.phx2.redhat.com [10.3.114.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06CEE62463; Wed, 10 Mar 2021 13:59:04 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [committed] analyzer: remove duplicated vfuncs Date: Wed, 10 Mar 2021 08:59:03 -0500 Message-Id: <20210310135903.3037800-1-dmalcolm@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: David Malcolm via Gcc-patches From: David Malcolm Reply-To: David Malcolm Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Implement dyn_cast_callgraph_superedge once in callgraph_superedge, rather than twice in the two subclasses. Spotted whilst working on a patch for call summaries. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as c84faa9b7bb0f98ba15a8e29d21232243676d54d. gcc/analyzer/ChangeLog: * supergraph.h (callgraph_superedge::dyn_cast_callgraph_superedge): New. (call_superedge::dyn_cast_callgraph_superedge): Delete. (return_superedge::dyn_cast_callgraph_superedge): Delete. --- gcc/analyzer/supergraph.h | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/gcc/analyzer/supergraph.h b/gcc/analyzer/supergraph.h index fc4a753c5a4..5d1268e555f 100644 --- a/gcc/analyzer/supergraph.h +++ b/gcc/analyzer/supergraph.h @@ -371,6 +371,16 @@ class callgraph_superedge : public superedge void dump_label_to_pp (pretty_printer *pp, bool user_facing) const FINAL OVERRIDE; + callgraph_superedge *dyn_cast_callgraph_superedge () FINAL OVERRIDE + { + return this; + } + const callgraph_superedge *dyn_cast_callgraph_superedge () const + FINAL OVERRIDE + { + return this; + } + function *get_callee_function () const; function *get_caller_function () const; tree get_callee_decl () const; @@ -409,16 +419,6 @@ class call_superedge : public callgraph_superedge : callgraph_superedge (src, dst, SUPEREDGE_CALL, cedge) {} - callgraph_superedge *dyn_cast_callgraph_superedge () FINAL OVERRIDE - { - return this; - } - const callgraph_superedge *dyn_cast_callgraph_superedge () const - FINAL OVERRIDE - { - return this; - } - call_superedge *dyn_cast_call_superedge () FINAL OVERRIDE { return this; @@ -455,14 +455,6 @@ class return_superedge : public callgraph_superedge : callgraph_superedge (src, dst, SUPEREDGE_RETURN, cedge) {} - callgraph_superedge *dyn_cast_callgraph_superedge () FINAL OVERRIDE - { - return this; - } - const callgraph_superedge *dyn_cast_callgraph_superedge () const - FINAL OVERRIDE - { return this; } - return_superedge *dyn_cast_return_superedge () FINAL OVERRIDE { return this; } const return_superedge *dyn_cast_return_superedge () const FINAL OVERRIDE {