This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][1/n] Merge from match-and-simplify, infrastructure


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]