itable_print_names (lf *file, const filter *set, const char *name)
{
const char *elem;
- lf_printf (file, "const char *%sitable_%s_names[nr_%sitable_%ss + 1] = {\n",
+ lf_printf (file,
+ "const char * const %sitable_%s_names[nr_%sitable_%ss + 1] = {\n",
options.module.itable.prefix.l, name,
options.module.itable.prefix.l, name);
lf_indent (file, +2);
/* output an enumeration type for each flag */
itable_print_enum (file, isa->flags, "flag");
- lf_printf (file, "extern const char *%sitable_flag_names[];\n",
+ lf_printf (file, "extern const char * const %sitable_flag_names[];\n",
options.module.itable.prefix.l);
lf_printf (file, "\n");
/* output an enumeration of all the possible options */
itable_print_enum (file, isa->options, "option");
- lf_printf (file, "extern const char *%sitable_option_names[];\n",
+ lf_printf (file, "extern const char * const %sitable_option_names[];\n",
options.module.itable.prefix.l);
lf_printf (file, "\n");
/* output an enumeration of all the processor models */
itable_print_enum (file, isa->model->processors, "processor");
- lf_printf (file, "extern const char *%sitable_processor_names[];\n",
+ lf_printf (file, "extern const char * const %sitable_processor_names[];\n",
options.module.itable.prefix.l);
lf_printf (file, "\n");
lf_printf (file, "typedef struct _%sitable_instruction_info {\n",
options.module.itable.prefix.l);
lf_printf (file, " %sitable_index nr;\n", options.module.itable.prefix.l);
- lf_printf (file, " char *format;\n");
- lf_printf (file, " char *form;\n");
- lf_printf (file, " char *flags;\n");
+ lf_printf (file, " const char *format;\n");
+ lf_printf (file, " const char *form;\n");
+ lf_printf (file, " const char *flags;\n");
/* nr_itable_* may be zero, so we add 1 to avoid an
illegal zero-sized array. */
- lf_printf (file, " char flag[nr_%sitable_flags + 1];\n",
+ lf_printf (file, " const char flag[nr_%sitable_flags + 1];\n",
options.module.itable.prefix.l);
- lf_printf (file, " char *options;\n");
- lf_printf (file, " char option[nr_%sitable_options + 1];\n",
+ lf_printf (file, " const char *options;\n");
+ lf_printf (file, " const char option[nr_%sitable_options + 1];\n",
options.module.itable.prefix.l);
- lf_printf (file, " char *processors;\n");
- lf_printf (file, " char processor[nr_%sitable_processors + 1];\n",
+ lf_printf (file, " const char *processors;\n");
+ lf_printf (file, " const char processor[nr_%sitable_processors + 1];\n",
options.module.itable.prefix.l);
- lf_printf (file, " char *name;\n");
- lf_printf (file, " char *file;\n");
+ lf_printf (file, " const char *name;\n");
+ lf_printf (file, " const char *file;\n");
lf_printf (file, " int line_nr;\n");
lf_printf (file, "} %sitable_info;\n", options.module.itable.prefix.l);
lf_printf (file, "\n");
- lf_printf (file, "extern %sitable_info %sitable[nr_%sitable_entries];\n",
+ lf_printf (file,
+ "extern const %sitable_info %sitable[nr_%sitable_entries];\n",
options.module.itable.prefix.l, options.module.itable.prefix.l,
options.module.itable.prefix.l);
if (strlen (options.module.itable.prefix.l) > 0)
itable_print_names (file, isa->model->processors, "processor");
/* output the table that contains the actual instruction info */
- lf_printf (file, "%sitable_info %sitable[nr_%sitable_entries] = {\n",
+ lf_printf (file, "const %sitable_info %sitable[nr_%sitable_entries] = {\n",
options.module.itable.prefix.l,
options.module.itable.prefix.l, options.module.itable.prefix.l);
insn_table_traverse_insn (file, isa, itable_c_insn, NULL);