From patchwork Sun Sep 19 15:39:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 45160 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 0AD56385803B for ; Sun, 19 Sep 2021 15:41:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0AD56385803B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1632066085; bh=M2H6g6MG9Ye/1uyTTydgumYypR87/HMcJM4ZylYCinI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=EUKq4qQ0XutngRXlBgU4mzrvcvkieAbMbXBCMwD9G5N/s1X6UzaPX2JmvQL44djck cpag/uVHJWDUKkdWVpeoz+DSen/C1THukWBVnE2MDwGNE59xwhy4ZkUiTV8GKGV28D ffyYdG3pDVc7fVtUSWJQ+pkiXqgehoFtL6G5nGCE= 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 A2F963858423 for ; Sun, 19 Sep 2021 15:40:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A2F963858423 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-479-LfTuhq5OMBSroQCptTnzhA-1; Sun, 19 Sep 2021 11:40:17 -0400 X-MC-Unique: LfTuhq5OMBSroQCptTnzhA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7F2EA802B9F for ; Sun, 19 Sep 2021 15:40:16 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1CDB6781ED; Sun, 19 Sep 2021 15:40:03 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.16.1/8.15.2) with ESMTPS id 18JFe1Rj178302 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 19 Sep 2021 17:40:01 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 18JFe1XF178301; Sun, 19 Sep 2021 17:40:01 +0200 To: GCC patches Subject: [COMMITTED] Make dump_ranger routines externally visible. Date: Sun, 19 Sep 2021 17:39:54 +0200 Message-Id: <20210919153954.178251-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.8 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_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" There was an inline extern declaration for dump_ranger that was a bit of a hack. I've removed it in favor of an actual prototype. There are also some trivial changes to the dumping code in the path solver. gcc/ChangeLog: * gimple-range-path.cc (path_range_query::path_range_query): Add header. (path_range_query::dump): Remove extern declaration of dump_ranger. * gimple-range-trace.cc (dump_ranger): Add DEBUG_FUNCTION marker. * gimple-range-trace.h (dump_ranger): Add prototype. --- gcc/gimple-range-path.cc | 8 ++++++-- gcc/gimple-range-trace.cc | 4 ++-- gcc/gimple-range-trace.h | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index c616b65756f..10b018b5211 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -37,6 +37,9 @@ along with GCC; see the file COPYING3. If not see path_range_query::path_range_query (gimple_ranger &ranger) : m_ranger (ranger) { + if (DEBUG_SOLVER) + fprintf (dump_file, "\n*********** path_range_query ******************\n"); + m_cache = new ssa_global_cache; m_has_cache_entry = BITMAP_ALLOC (NULL); m_path = NULL; @@ -85,14 +88,15 @@ path_range_query::set_cache (const irange &r, tree name) void path_range_query::dump (FILE *dump_file) { + push_dump_file save (dump_file, dump_flags & ~TDF_DETAILS); + if (m_path->is_empty ()) return; unsigned i; bitmap_iterator bi; - extern void dump_ranger (FILE *, const vec &); - fprintf (dump_file, "Path is (length=%d):\n", m_path->length ()); + fprintf (dump_file, "\nPath is (length=%d):\n", m_path->length ()); dump_ranger (dump_file, *m_path); fprintf (dump_file, "Imports:\n"); diff --git a/gcc/gimple-range-trace.cc b/gcc/gimple-range-trace.cc index 5175d1400c4..2417c21f1f2 100644 --- a/gcc/gimple-range-trace.cc +++ b/gcc/gimple-range-trace.cc @@ -176,7 +176,7 @@ push_dump_file::~push_dump_file () // Dump all that ranger knows for the current function. -DEBUG_FUNCTION void +void dump_ranger (FILE *out) { push_dump_file save (out, dump_flags); @@ -201,7 +201,7 @@ debug_ranger () // Note that the blocks are in reverse order, thus the exit block is // path[0]. -DEBUG_FUNCTION void +void dump_ranger (FILE *dump_file, const vec &path) { if (path.length () == 0) diff --git a/gcc/gimple-range-trace.h b/gcc/gimple-range-trace.h index b9546a245d1..d3e69e03543 100644 --- a/gcc/gimple-range-trace.h +++ b/gcc/gimple-range-trace.h @@ -72,4 +72,7 @@ private: dump_flags_t old_dump_flags; }; +void dump_ranger (FILE *); +void dump_ranger (FILE *, const vec &path); + #endif // GCC_GIMPLE_RANGE_TRACE_H