- printf ("const size_t n_insn_conditions = %lu;\n",
- (unsigned long) htab_elements (condition_table));
- puts ("const int insn_elision_unavailable = 0;");
+/* Emit code which will convert the C-format table to a
+ (define_conditions) form, which the MD reader can understand.
+ The result will be added to the set of files scanned by
+ 'downstream' generators. */
+static void
+write_writer (void)
+{
+ puts ("int\n"
+ "main(void)\n"
+ "{\n"
+ " unsigned int i;\n"
+ " const char *p;\n"
+ " puts (\"(define_conditions [\");\n"
+ "#if GCC_VERSION >= 3001\n"
+ " for (i = 0; i < ARRAY_SIZE (insn_conditions); i++)\n"
+ " {\n"
+ " printf (\" (%d \\\"\", insn_conditions[i].value);\n"
+ " for (p = insn_conditions[i].expr; *p; p++)\n"
+ " {\n"
+ " switch (*p)\n"
+ " {\n"
+ " case '\\\\':\n"
+ " case '\\\"': putchar ('\\\\'); break;\n"
+ " default: break;\n"
+ " }\n"
+ " putchar (*p);\n"
+ " }\n"
+ " puts (\"\\\")\");\n"
+ " }\n"
+ "#endif /* gcc >= 3.0.1 */\n"
+ " puts (\"])\");\n"
+ " fflush (stdout);\n"
+ "return ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE;\n"
+ "}");