* machmode.h (mode_name): Constify a char*.
* rtl.c (mode_name): Likewise.
* genopinit.c (gen_insn): Use accessor macro, not `mode_name'.
* optabs.c (init_libfuncs): Constify a char*.
* print-tree.c (mode_name): Remove redundant declaration.
(print_node): Use accessor macro, not `mode_name'.
* reload1.c (dump_needs): Constify a char*. Use accessor macro,
not `mode_name'.
(new_spill_reg): Constify a char*.
* tree.c (mode_name): Remove redundant declaration.
From-SVN: r28783
+Fri Aug 20 18:38:43 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * machmode.h (mode_name): Constify a char*.
+
+ * rtl.c (mode_name): Likewise.
+
+ * genopinit.c (gen_insn): Use accessor macro, not `mode_name'.
+
+ * optabs.c (init_libfuncs): Constify a char*.
+
+ * print-tree.c (mode_name): Remove redundant declaration.
+ (print_node): Use accessor macro, not `mode_name'.
+
+ * reload1.c (dump_needs): Constify a char*. Use accessor macro,
+ not `mode_name'.
+ (new_spill_reg): Constify a char*.
+
+ * tree.c (mode_name): Remove redundant declaration.
+
Fri Aug 20 18:31:26 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* rtl.c (rtx_name): Constify a char*.
CC modes (as it should be). */
for (i = ((int) MAX_MACHINE_MODE) - 1; i >= 0; i--)
{
- for (p = mode_name[i], q = np; *p; p++, q++)
+ for (p = GET_MODE_NAME(i), q = np; *p; p++, q++)
if (tolower ((unsigned char)*p) != *q)
break;
if (i < 0)
matches = 0;
else if (*pp == 'a')
- m1 = i, np += strlen (mode_name[i]);
+ m1 = i, np += strlen (GET_MODE_NAME(i));
else
- m2 = i, np += strlen (mode_name[i]);
+ m2 = i, np += strlen (GET_MODE_NAME(i));
force_int = force_float = 0;
break;
case 'I': case 'F': case 'N':
break;
case 'a':
- for (np = mode_name[m1]; *np; np++)
+ for (np = GET_MODE_NAME(m1); *np; np++)
printf ("%c", tolower ((unsigned char)*np));
break;
case 'b':
- for (np = mode_name[m2]; *np; np++)
+ for (np = GET_MODE_NAME(m2); *np; np++)
printf ("%c", tolower ((unsigned char)*np));
break;
case 'A':
- printf ("%smode", mode_name[m1]);
+ printf ("%smode", GET_MODE_NAME(m1));
break;
case 'B':
- printf ("%smode", mode_name[m2]);
+ printf ("%smode", GET_MODE_NAME(m2));
break;
case 'c':
printf ("%s", GET_RTX_NAME(op));
/* Get the name of mode MODE as a string. */
-extern char *mode_name[];
+extern const char * const mode_name[];
#define GET_MODE_NAME(MODE) (mode_name[(int) (MODE)])
enum mode_class { MODE_RANDOM, MODE_INT, MODE_FLOAT, MODE_PARTIAL_INT, MODE_CC,
for (mode = first_mode; (int) mode <= (int) last_mode;
mode = (enum machine_mode) ((int) mode + 1))
{
- register char *mname = mode_name[(int) mode];
+ register const char *mname = GET_MODE_NAME(mode);
register unsigned mname_len = strlen (mname);
register char *libfunc_name
= (char *) xmalloc (2 + opname_len + mname_len + 1 + 1);
#include "system.h"
#include "tree.h"
-extern char *mode_name[];
-
void print_node ();
void indent_to ();
if (DECL_LANG_FLAG_7 (node))
fputs (" decl_7", file);
- fprintf (file, " %s", mode_name[(int) mode]);
+ fprintf (file, " %s", GET_MODE_NAME(mode));
fprintf (file, " file %s line %d",
DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
fputs (" type_6", file);
mode = TYPE_MODE (node);
- fprintf (file, " %s", mode_name[(int) mode]);
+ fprintf (file, " %s", GET_MODE_NAME(mode));
print_node (file, "size", TYPE_SIZE (node), indent + 4);
indent_to (file, indent + 3);
struct insn_chain *chain;
FILE *dumpfile;
{
- static char *reg_class_names[] = REG_CLASS_NAMES;
+ static const char * const reg_class_names[] = REG_CLASS_NAMES;
int i;
struct needs *n = &chain->need;
fprintf (dumpfile,
";; Need %d group%s (%smode) of class %s.\n",
n->groups[i], n->groups[i] == 1 ? "" : "s",
- mode_name[(int) chain->group_mode[i]],
+ GET_MODE_NAME(chain->group_mode[i]),
reg_class_names[i]);
}
}
if (TEST_HARD_REG_BIT (bad_spill_regs, regno))
{
- static char *reg_class_names[] = REG_CLASS_NAMES;
+ static const char * const reg_class_names[] = REG_CLASS_NAMES;
if (asm_noperands (PATTERN (chain->insn)) < 0)
{
#define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER) NAME,
-char *mode_name[(int) MAX_MACHINE_MODE + 1] = {
+const char * const mode_name[(int) MAX_MACHINE_MODE + 1] = {
#include "machmode.def"
#ifdef EXTRA_CC_MODES
static void append_random_chars PROTO((char *));
static void build_real_from_int_cst_1 PROTO((PTR));
-extern char *mode_name[];
-
void gcc_obstack_init ();
/* If non-null, a language specific helper for unsave_expr_now. */