Ejemplo n.º 1
0
static void
genmacro (int idx)
{
  const char *p;
  int i;

  /* We write a macro that defines gen_rtx_RTLCODE to be an equivalent to
     gen_rtx_fmt_FORMAT where FORMAT is the RTX_FORMAT of RTLCODE.  */

  if (excluded_rtx (idx))
    /* Don't define a macro for this code.  */
    return;

  printf ("#define gen_rtx_%s%s(MODE",
	   special_rtx (idx) ? "raw_" : "", defs[idx].enumname);

  for (p = defs[idx].format, i = 0; *p != 0; p++)
    if (*p != '0')
      printf (", ARG%d", i++);

  printf (") \\\n  gen_rtx_fmt_%s (%s, (MODE)",
	  defs[idx].format, defs[idx].enumname);

  for (p = defs[idx].format, i = 0; *p != 0; p++)
    if (*p != '0')
      printf (", (ARG%d)", i++);

  puts (")");
}
Ejemplo n.º 2
0
static void
genmacro (int idx)
{
  const char *p;
  const char *sep = "";
  int i;

  /* We write a macro that defines gen_rtx_RTLCODE to be an equivalent to
     gen_rtx_fmt_FORMAT where FORMAT is the RTX_FORMAT of RTLCODE.  */

  if (excluded_rtx (idx))
    /* Don't define a macro for this code.  */
    return;

  bool has_mode_p = !always_void_p (idx);
  printf ("#define gen_rtx_%s%s(",
	   special_rtx (idx) ? "raw_" : "", defs[idx].enumname);
  if (has_mode_p)
    {
      printf ("MODE");
      sep = ", ";
    }

  for (p = defs[idx].format, i = 0; *p != 0; p++)
    if (*p != '0')
      {
	printf ("%sARG%d", sep, i++);
	sep = ", ";
      }

  printf (") \\\n  gen_rtx_fmt_%s (%s, %s",
	  defs[idx].format, defs[idx].enumname,
	  has_mode_p ? "(MODE)" : "VOIDmode");

  for (p = defs[idx].format, i = 0; *p != 0; p++)
    if (*p != '0')
      printf (", (ARG%d)", i++);

  puts (")");
}