From 3f64b7c8c12e557ac39b3bf12c456f2a0bf8dafd Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 1 Aug 2022 21:58:01 +0200 Subject: [PATCH] Don't spam the output with debug information unless -v is set. --- util/cgg/main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/util/cgg/main.c b/util/cgg/main.c index 12d3b4fd4..7e2460a68 100644 --- a/util/cgg/main.c +++ b/util/cgg/main.c @@ -21,6 +21,7 @@ static void initio(void); static int eqregclass(int r1, int r2); static void compueq(void); +static int want_verbose = 0; char *myalloc(int n) @@ -297,6 +298,9 @@ int main(int argc, char *argv[]) case 'c': cname = &argv[0][2]; break; + case 'v': + want_verbose = 1; + break; default: fprintf(stderr, "Bad flag %s\n", argv[0]); break; @@ -316,9 +320,11 @@ int main(int argc, char *argv[]) compueq(); hashpatterns(); finishio(); - verbose(); + if (want_verbose) + verbose(); } - debug(); + if (want_verbose) + debug(); exit(nerrors); } @@ -777,7 +783,6 @@ static void outregvar(void) static void verbose(void) { - fprintf(stderr, "Codebytes %d\n", codebytes); fprintf(stderr, "Registers %d(%d)\n", nmachregs, MAXREGS); fprintf(stderr, "Properties %d(%d)\n", nprops, MAXPROPS);