- fprintf (stderr, "genflags: ");
- fprintf (stderr, s, a1, a2);
- fprintf (stderr, "\n");
- exit (FATAL_EXIT_CODE);
-}
+ int num = num_operands (insn);
+ int i;
+ const char *name = XSTR (insn, 0);
+ int truth = maybe_eval_c_test (XSTR (insn, 2));
+
+ /* Many md files don't refer to the last two operands passed to the
+ call patterns. This means their generator functions will be two
+ arguments too short. Instead of changing every md file to touch
+ those operands, we wrap the prototypes in macros that take the
+ correct number of arguments. */
+ if (name[0] == 'c' || name[0] == 's')
+ {
+ if (!strcmp (name, "call")
+ || !strcmp (name, "call_pop")
+ || !strcmp (name, "sibcall")
+ || !strcmp (name, "sibcall_pop"))
+ gen_macro (name, num, 4);
+ else if (!strcmp (name, "call_value")
+ || !strcmp (name, "call_value_pop")
+ || !strcmp (name, "sibcall_value")
+ || !strcmp (name, "sibcall_value_pop"))
+ gen_macro (name, num, 5);
+ }
+
+ if (truth != 0)
+ printf ("extern rtx gen_%-*s (", max_id_len, name);
+ else
+ printf ("static inline rtx gen_%-*s (", max_id_len, name);
+
+ if (num == 0)
+ fputs ("void", stdout);
+ else
+ {
+ for (i = 1; i < num; i++)
+ fputs ("rtx, ", stdout);
+
+ fputs ("rtx", stdout);
+ }
+
+ puts (");");