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: 103365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2774703vqr; Mon, 5 Jun 2023 08:43:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ42ysrk5YxgFX4saMJ1T8hGBl2++fybet4hKSldXvIW187SqCdtF9dgS01TwWymO+AE9D0e X-Received: by 2002:a05:6402:712:b0:514:a669:d064 with SMTP id w18-20020a056402071200b00514a669d064mr9655547edx.16.1685979783459; Mon, 05 Jun 2023 08:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685979783; cv=none; d=google.com; s=arc-20160816; b=pWhcxdsJrCotW3g9z7ilef1GRUeH2JD9GuEPv0W7+wScW3BBrM7NpXxuZtPQQTHomU Tvmix938dVC24qD1nAXv5WEO6MWMqqNdh9KJnJuhK1kXB9aX9Xf3oTac3/hZA0XiRDxh jxFs8/7F0QKaL5HasVM8Fui1otfs1ys04IQWk80amxgWakuzdBjECvzp1DUqb8bcdT+1 upokAX9rdv+31cbjLG0ksILzd/aJ8AnxuIAwD2uNlHIo3dEQBTmQGlEv+bnBTjrIYDJo MnTh/WuXd3eB4AtBSDCjQmJ4GEMiXaGgLQeJypycXWDOiYzGxOoXvvNP8f+MGrCnC6xB Gltw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:to:subject :message-id:date:mime-version:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=D1vFea8dhaqb7Qg/0Xb0p8qZqH1y/WKvayeZGTsGOwg=; b=V+4O1ybxFFJ53x7TxadzQ4ptoPzalwgxWp70KB0W0Fc85rsuDYs1FxttetY9AhmK+j QHF1Oll+r3lWIb6fgoTntidScF2XddRbrnI6KyI4iP7306Ew8oVCSMoXrXn0k+zYX7XH Qg/HCZ9MOYJ8yAqAa8VAyf0fzlTcbThLDYV7BliKEkPkL9tPLSbGIAw3OWKgvzsHmDm0 Sn7NjV6tphPwsfSKs3pjOm7sX9aHpxTxWSN8TVAORiXJP3rr4+30AXCmaRdI5koQub+x kgbfx8YzuQ61R/A22fXgtTFkq/fSFgRBKUkqb+B1IoNlyC6nUIbBKzK4qjQ9XoYIsqn+ /zMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=W23M0zZR; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id b12-20020aa7c90c000000b00514a5f8d317si4969308edt.97.2023.06.05.08.43.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 08:43:03 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=W23M0zZR; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 65AA43895FC5 for ; Mon, 5 Jun 2023 15:39:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65AA43895FC5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685979584; 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=W23M0zZRXPECWrPAC0y7Z3nXGBaeMHw9dnuEeplpyWDJvD6lh8EDfMwxu8jI6wJa6 RsVYzUypyYYQp0UIxeiUWPK/okOXIv9UZeDpY9wO2c5Xb+niIgJCWgMd598/u/CJhO xNDv0ndPPg59hz+QjM+DereofoXWjUXKUaOE4Vxk= 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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767877937559129514?= X-GMAIL-MSGID: =?utf-8?q?1767877937559129514?= 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 */