On Wed, Oct 15, 2014 at 01:39:33PM +0200, Richard Biener wrote:
> 2014-10-15  Richard Biener  <rguent...@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

Reply via email to