From: Tamar Christina <tamar.christina@arm.com>
To: gcc-patches@gcc.gnu.org
Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com
Subject: [PATCH 2/5] match.pd: Remove commented out line pragmas unless -vv is used.
Date: Fri, 28 Apr 2023 11:38:30 +0100 [thread overview]
Message-ID: <patch-17227-tamar@arm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]
Hi All,
genmatch currently outputs commented out line directives that have no effect
but the compiler still has to parse only to discard.
They are however handy when debugging genmatch output. As such this moves them
behind the -vv flag.
Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
Ok for master?
Thanks,
Tamar
gcc/ChangeLog:
PR bootstrap/84402
* genmatch.cc (output_line_directive): Only emit commented directive
when -vv.
(main): Initialize verbose.
--- inline copy of patch --
diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
index 638606b2502f640e59527fc5a0b23fa3bedd0cee..6d62cdea2082d92e5ecc1102c80205115a4e3040 100644
--- a/gcc/genmatch.cc
+++ b/gcc/genmatch.cc
@@ -209,7 +209,7 @@ output_line_directive (FILE *f, location_t location,
else
fprintf (f, "%s:%d", file, loc.line);
}
- else
+ else if (verbose == 2)
/* Other gen programs really output line directives here, at least for
development it's right now more convenient to have line information
from the generated file. Still keep the directives as comment for now
@@ -5221,6 +5221,7 @@ main (int argc, char **argv)
return 1;
bool gimple = true;
+ verbose = 0;
char *input = argv[argc-1];
for (int i = 1; i < argc - 1; ++i)
{
--
[-- Attachment #2: rb17227.patch --]
[-- Type: text/plain, Size: 770 bytes --]
diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
index 638606b2502f640e59527fc5a0b23fa3bedd0cee..6d62cdea2082d92e5ecc1102c80205115a4e3040 100644
--- a/gcc/genmatch.cc
+++ b/gcc/genmatch.cc
@@ -209,7 +209,7 @@ output_line_directive (FILE *f, location_t location,
else
fprintf (f, "%s:%d", file, loc.line);
}
- else
+ else if (verbose == 2)
/* Other gen programs really output line directives here, at least for
development it's right now more convenient to have line information
from the generated file. Still keep the directives as comment for now
@@ -5221,6 +5221,7 @@ main (int argc, char **argv)
return 1;
bool gimple = true;
+ verbose = 0;
char *input = argv[argc-1];
for (int i = 1; i < argc - 1; ++i)
{
next reply other threads:[~2023-04-28 10:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 10:38 Tamar Christina [this message]
2023-04-28 11:49 ` Richard Biener
2023-04-28 13:17 ` Paul Koning
2023-04-28 14:02 ` Tamar Christina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=patch-17227-tamar@arm.com \
--to=tamar.christina@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jlaw@ventanamicro.com \
--cc=nd@arm.com \
--cc=rguenther@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).