From patchwork Mon Jun 5 15:38:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1790496 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.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=cX27FGGd; 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QZd7v31gtz20QH for ; Tue, 6 Jun 2023 01:39:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3BF783893675 for ; Mon, 5 Jun 2023 15:39:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3BF783893675 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685979558; bh=D1vFea8dhaqb7Qg/0Xb0p8qZqH1y/WKvayeZGTsGOwg=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cX27FGGd2S5iF+VacXu6VL9AhhIzRPjIprLWQKL2Rf+q2TegxU3VSUVqdqdYJXN/3 xCIHh77n/ZwMEpzjCZvZkjWKk+sGT4AVh6OcPQjDW7LcbKb+MOBZVfZ9HXNHeib2Xo JNxQm08latmvx3TNwrXh01Rdy23tCwm1Omd6Yofo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by sourceware.org (Postfix) with ESMTPS id 6177E3882078 for ; Mon, 5 Jun 2023 15:38:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6177E3882078 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6237faa8677so36255856d6.1 for ; Mon, 05 Jun 2023 08:38:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685979534; x=1688571534; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=D1vFea8dhaqb7Qg/0Xb0p8qZqH1y/WKvayeZGTsGOwg=; b=JE3VVBC+iQcy9zPHD8vFsICfxNJy+1uBwwUfPj+acKIhCCy/TPbC4SjNIF2SaXa3tw Og51vW19LPqbnvKI/UG+G3A2ardIg2MO6YaydFslk9+PHe8KA2ON2PfChXNMLMWw/sHI kZESjFHda/i95lX9x6b9WRf0qTRhpJf+HO54TzlVuaVzTJ41uM584STgSX1PkenFq0zg 2wBQKndwjCxLF5l3NFldFT7xC4l99Djg07SZ3SNJLNMWRRx4kIUC89uZE3qBuTqtx2gE 5muH4r6Cgzd8K0oMIkNgLuPvnZla3rJ9pXyM3HTHUS5uvW5NzP7x8l6KC99jVLR0CYfC AOww== X-Gm-Message-State: AC+VfDyh+FLL8zC6WB5+OWtWyT6xw2V+Yub86FPSrNvbVqOT2tPa5AnS MEfNzHdOdfUwvvjV92yBm5QV/xEhUSlVTN0E/rS1GZOGBxMZ9w== X-Google-Smtp-Source: ACHHUZ63HSuCoDzqzKQKJ3xH0ZABrsu6eUqciDQLRPfgmp21Sq7EuMXhp3319BeE7OLHOnG7w4PYZTASLIc4cPrm0TM= X-Received: by 2002:a05:6214:401:b0:62b:3c25:5ae9 with SMTP id z1-20020a056214040100b0062b3c255ae9mr7101123qvx.65.1685979534383; Mon, 05 Jun 2023 08:38:54 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 5 Jun 2023 17:38:43 +0200 Message-ID: Subject: [COMMITTED] print-rtl: Change return type of two print functions from int to void To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Uros Bizjak via Gcc-patches From: Uros Bizjak Reply-To: Uros Bizjak Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Also change one internal variable to bool. gcc/ChangeLog: * rtl.h (print_rtl_single): Change return type from int to void. (print_rtl_single_with_indent): Ditto. * print-rtl.h (class rtx_writer): Ditto. Change m_sawclose to bool. * print-rtl.cc (rtx_writer::rtx_writer): Update for m_sawclose change. (rtx_writer::print_rtx_operand_code_0): Ditto. (rtx_writer::print_rtx_operand_codes_E_and_V): Ditto. (rtx_writer::print_rtx_operand_code_i): Ditto. (rtx_writer::print_rtx_operand_code_u): Ditto. (rtx_writer::print_rtx_operand): Ditto. (rtx_writer::print_rtx): Ditto. (rtx_writer::finish_directive): Ditto. (print_rtl_single): Change return type from int to void and adjust function body accordingly. (rtx_writer::print_rtl_single_with_indent): Ditto. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Uros. diff --git a/gcc/print-rtl.cc b/gcc/print-rtl.cc index f67bf868778..c59d9896edb 100644 --- a/gcc/print-rtl.cc +++ b/gcc/print-rtl.cc @@ -85,7 +85,7 @@ int flag_dump_unnumbered_links = 0; rtx_writer::rtx_writer (FILE *outf, int ind, bool simple, bool compact, rtx_reuse_manager *reuse_manager ATTRIBUTE_UNUSED) -: m_outfile (outf), m_sawclose (0), m_indent (ind), +: m_outfile (outf), m_indent (ind), m_sawclose (false), m_in_call_function_usage (false), m_simple (simple), m_compact (compact) #ifndef GENERATOR_FILE , m_rtx_reuse_manager (reuse_manager) @@ -237,13 +237,13 @@ rtx_writer::print_rtx_operand_code_0 (const_rtx in_rtx ATTRIBUTE_UNUSED, fprintf (m_outfile, " #"); else fprintf (m_outfile, " %d", NOTE_EH_HANDLER (in_rtx)); - m_sawclose = 1; + m_sawclose = true; break; case NOTE_INSN_BLOCK_BEG: case NOTE_INSN_BLOCK_END: dump_addr (m_outfile, " ", NOTE_BLOCK (in_rtx)); - m_sawclose = 1; + m_sawclose = true; break; case NOTE_INSN_BASIC_BLOCK: @@ -370,7 +370,7 @@ rtx_writer::print_rtx_operand_codes_E_and_V (const_rtx in_rtx, int idx) { fprintf (m_outfile, "\n%s%*s", print_rtx_head, m_indent * 2, ""); - m_sawclose = 0; + m_sawclose = false; } if (GET_CODE (in_rtx) == CONST_VECTOR && !GET_MODE_NUNITS (GET_MODE (in_rtx)).is_constant () @@ -381,7 +381,7 @@ rtx_writer::print_rtx_operand_codes_E_and_V (const_rtx in_rtx, int idx) { m_indent += 2; if (XVECLEN (in_rtx, idx)) - m_sawclose = 1; + m_sawclose = true; int barrier = XVECLEN (in_rtx, idx); if (GET_CODE (in_rtx) == CONST_VECTOR @@ -431,7 +431,7 @@ rtx_writer::print_rtx_operand_codes_E_and_V (const_rtx in_rtx, int idx) fprintf (m_outfile, "\n%s%*s", print_rtx_head, m_indent * 2, ""); fputs ("]", m_outfile); - m_sawclose = 1; + m_sawclose = true; m_indent -= 2; } @@ -510,7 +510,7 @@ rtx_writer::print_rtx_operand_code_i (const_rtx in_rtx, int idx) /* Don't print INSN_CODEs in compact mode. */ if (m_compact && is_insn && &INSN_CODE (in_rtx) == &XINT (in_rtx, idx)) { - m_sawclose = 0; + m_sawclose = false; return; } @@ -524,7 +524,7 @@ rtx_writer::print_rtx_operand_code_i (const_rtx in_rtx, int idx) && XINT (in_rtx, idx) >= 0 && (name = get_insn_name (XINT (in_rtx, idx))) != NULL) fprintf (m_outfile, " {%s}", name); - m_sawclose = 0; + m_sawclose = false; } } @@ -619,7 +619,7 @@ rtx_writer::print_rtx_operand_code_u (const_rtx in_rtx, int idx) fprintf (m_outfile, " [# deleted]"); else fprintf (m_outfile, " [%d deleted]", INSN_UID (sub)); - m_sawclose = 0; + m_sawclose = false; return; } @@ -640,7 +640,7 @@ rtx_writer::print_rtx_operand_code_u (const_rtx in_rtx, int idx) } else fputs (" 0", m_outfile); - m_sawclose = 0; + m_sawclose = false; } /* Subroutine of print_rtx. Print operand IDX of IN_RTX. */ @@ -667,7 +667,7 @@ rtx_writer::print_rtx_operand (const_rtx in_rtx, int idx) fputs (" (nil)", m_outfile); else fprintf (m_outfile, " (\"%s\")", str); - m_sawclose = 1; + m_sawclose = true; break; case '0': @@ -709,7 +709,7 @@ rtx_writer::print_rtx_operand (const_rtx in_rtx, int idx) case 'n': fprintf (m_outfile, " %s", GET_NOTE_INSN_NAME (XINT (in_rtx, idx))); - m_sawclose = 0; + m_sawclose = false; break; case 'u': @@ -729,7 +729,7 @@ rtx_writer::print_rtx_operand (const_rtx in_rtx, int idx) case '*': fputs (" Unknown", m_outfile); - m_sawclose = 0; + m_sawclose = false; break; case 'B': @@ -797,20 +797,20 @@ rtx_writer::print_rtx (const_rtx in_rtx) fputc (' ', m_outfile); else fprintf (m_outfile, "\n%s%*s", print_rtx_head, m_indent * 2, ""); - m_sawclose = 0; + m_sawclose = false; } if (in_rtx == 0) { fputs ("(nil)", m_outfile); - m_sawclose = 1; + m_sawclose = true; return; } else if (GET_CODE (in_rtx) > NUM_RTX_CODE) { fprintf (m_outfile, "(??? bad code %d\n%s%*s)", GET_CODE (in_rtx), print_rtx_head, m_indent * 2, ""); - m_sawclose = 1; + m_sawclose = true; return; } @@ -829,7 +829,7 @@ rtx_writer::print_rtx (const_rtx in_rtx) if (m_rtx_reuse_manager->seen_def_p (reuse_id)) { fprintf (m_outfile, "reuse_rtx %i)", reuse_id); - m_sawclose = 1; + m_sawclose = true; return; } else @@ -907,7 +907,7 @@ rtx_writer::print_rtx (const_rtx in_rtx) if (PAT_VAR_LOCATION_STATUS (in_rtx) == VAR_INIT_STATUS_UNINITIALIZED) fprintf (m_outfile, " [uninit]"); - m_sawclose = 1; + m_sawclose = true; idx = GET_RTX_LENGTH (VAR_LOCATION); } #endif @@ -1027,7 +1027,7 @@ rtx_writer::print_rtx (const_rtx in_rtx) } fputc (')', m_outfile); - m_sawclose = 1; + m_sawclose = true; } /* Emit a closing parenthesis and newline. */ @@ -1036,7 +1036,7 @@ void rtx_writer::finish_directive () { fprintf (m_outfile, ")\n"); - m_sawclose = 0; + m_sawclose = false; } /* Print an rtx on the current line of FILE. Initially indent IND @@ -1223,18 +1223,17 @@ print_rtl (FILE *outf, const_rtx rtx_first) } /* Like print_rtx, except specify a file. */ -/* Return nonzero if we actually printed anything. */ -int +void print_rtl_single (FILE *outf, const_rtx x) { rtx_writer w (outf, 0, false, false, NULL); - return w.print_rtl_single_with_indent (x, 0); + w.print_rtl_single_with_indent (x, 0); } /* Like print_rtl_single, except specify an indentation. */ -int +void rtx_writer::print_rtl_single_with_indent (const_rtx x, int ind) { char *s_indent = (char *) alloca ((size_t) ind + 1); @@ -1245,11 +1244,10 @@ rtx_writer::print_rtl_single_with_indent (const_rtx x, int ind) int old_indent = m_indent; m_indent = ind; - m_sawclose = 0; + m_sawclose = false; print_rtx (x); putc ('\n', m_outfile); m_indent = old_indent; - return 1; } diff --git a/gcc/print-rtl.h b/gcc/print-rtl.h index ddaec107710..d4c7dda9482 100644 --- a/gcc/print-rtl.h +++ b/gcc/print-rtl.h @@ -36,7 +36,7 @@ class rtx_writer void print_rtx (const_rtx in_rtx); void print_rtl (const_rtx rtx_first); - int print_rtl_single_with_indent (const_rtx x, int ind); + void print_rtl_single_with_indent (const_rtx x, int ind); void finish_directive (); @@ -52,8 +52,8 @@ class rtx_writer private: FILE *m_outfile; - int m_sawclose; int m_indent; + bool m_sawclose; bool m_in_call_function_usage; /* True means use simplified format without flags, modes, etc. */ diff --git a/gcc/rtl.h b/gcc/rtl.h index 3f0af780634..4c993e82708 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -4241,8 +4241,8 @@ extern const rtx_insn *debug_rtx_find (const rtx_insn *, int); extern void print_mem_expr (FILE *, const_tree); extern void print_rtl (FILE *, const_rtx); extern void print_simple_rtl (FILE *, const_rtx); -extern int print_rtl_single (FILE *, const_rtx); -extern int print_rtl_single_with_indent (FILE *, const_rtx, int); +extern void print_rtl_single (FILE *, const_rtx); +extern void print_rtl_single_with_indent (FILE *, const_rtx, int); extern void print_inline_rtx (FILE *, const_rtx, int); /* In stmt.cc */