This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][1/n] Merge from match-and-simplify, infrastructure
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 17 Oct 2014 14:45:23 +0200
- Subject: Re: [PATCH][1/n] Merge from match-and-simplify, infrastructure
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1410151338340 dot 20733 at zhemvz dot fhfr dot qr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Oct 15, 2014 at 01:39:33PM +0200, Richard Biener wrote:
> 2014-10-15 Richard Biener <rguenther@suse.de>
Shouldn't Prathamesh be listed as co-author of the patch?
> + fprintf (f, "case SSA_NAME:\n");
> + fprintf (f, "{\n");
> + fprintf (f, "gimple def_stmt = SSA_NAME_DEF_STMT (%s);\n", kid_opname);
Etc.; so no attempt to indent the generated code, by tracking number
of current indentation columns and trasnating that into a series of
spaces or tabs or tabs+spaces? Other generated sources like insn-*.c
usually are indented, at least to some extent.
> + char dest[32];
> + snprintf (dest, 32, " res_ops[%d]", j);
> + const char *optype
> + = get_operand_type (e->operation,
This seems to be indented too much.
> + "type", e->expr_type,
> + j == 0
> + ? NULL : "TREE_TYPE (res_ops[0])");
> + /* The genmatch generator progam. It reads from a pattern description
> + and outputs GIMPLE or GENERIC IL matching and simplification routines. */
> +
> + int
> + main(int argc, char **argv)
Formatting ;)
> + return 1;
> +
> + bool gimple = true;
> + bool verbose = false;
> + char *input = argv[argc-1];
> + for (int i = 1; i < argc - 1; ++i)
> + {
> + if (strcmp (argv[i], "-gimple") == 0)
> + gimple = true;
> + else if (strcmp (argv[i], "-generic") == 0)
> + gimple = false;
> + else if (strcmp (argv[i], "-v") == 0)
> + verbose = true;
> + else
> + {
> + fprintf (stderr, "Usage: genmatch [-gimple] [-generic] [-v] input\n");
> + return 1;
> + }
> + }
Wouldn't --gimple and --generic be nicer?
Otherwise, LGTM.
Jakub