Commit 1f9a015e by Kaveh R. Ghazi Committed by Kaveh Ghazi

rtl.c (rtx_class, [...]): Constify.

	* rtl.c (rtx_class, note_insn_name, reg_note_name): Constify.

	* rtl.h (rtx_class, reg_note_name, note_insn_name): Likewise.

	* genopinit.c (gen_insn): Use accessor macro, not `rtx_class'.

From-SVN: r28785
parent 6f7d635c
Fri Aug 20 19:07:55 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* rtl.c (rtx_class, note_insn_name, reg_note_name): Constify.
* rtl.h (rtx_class, reg_note_name, note_insn_name): Likewise.
* genopinit.c (gen_insn): Use accessor macro, not `rtx_class'.
Fri Aug 20 18:53:43 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Fri Aug 20 18:53:43 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* rtl.h (rtx_format): Constify a char*. * rtl.h (rtx_format): Constify a char*.
......
...@@ -183,7 +183,7 @@ gen_insn (insn) ...@@ -183,7 +183,7 @@ gen_insn (insn)
/* We have to be concerned about matching "gt" and /* We have to be concerned about matching "gt" and
missing "gtu", e.g., so verify we have reached the missing "gtu", e.g., so verify we have reached the
end of thing we are to match. */ end of thing we are to match. */
if (*p == 0 && *q == 0 && rtx_class[op] == '<') if (*p == 0 && *q == 0 && GET_RTX_CLASS(op) == '<')
break; break;
} }
......
...@@ -167,7 +167,7 @@ const char *rtx_format[] = { ...@@ -167,7 +167,7 @@ const char *rtx_format[] = {
/* Indexed by rtx code, gives a character representing the "class" of /* Indexed by rtx code, gives a character representing the "class" of
that rtx code. See rtl.def for documentation on the defined classes. */ that rtx code. See rtl.def for documentation on the defined classes. */
char rtx_class[] = { const char rtx_class[] = {
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) CLASS, #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) CLASS,
#include "rtl.def" /* rtl expressions are defined here */ #include "rtl.def" /* rtl expressions are defined here */
#undef DEF_RTL_EXPR #undef DEF_RTL_EXPR
...@@ -175,7 +175,7 @@ char rtx_class[] = { ...@@ -175,7 +175,7 @@ char rtx_class[] = {
/* Names for kinds of NOTEs and REG_NOTEs. */ /* Names for kinds of NOTEs and REG_NOTEs. */
char *note_insn_name[] = { 0 , "NOTE_INSN_DELETED", const char * const note_insn_name[] = { 0 , "NOTE_INSN_DELETED",
"NOTE_INSN_BLOCK_BEG", "NOTE_INSN_BLOCK_END", "NOTE_INSN_BLOCK_BEG", "NOTE_INSN_BLOCK_END",
"NOTE_INSN_LOOP_BEG", "NOTE_INSN_LOOP_END", "NOTE_INSN_LOOP_BEG", "NOTE_INSN_LOOP_END",
"NOTE_INSN_FUNCTION_END", "NOTE_INSN_SETJMP", "NOTE_INSN_FUNCTION_END", "NOTE_INSN_SETJMP",
...@@ -187,7 +187,7 @@ char *note_insn_name[] = { 0 , "NOTE_INSN_DELETED", ...@@ -187,7 +187,7 @@ char *note_insn_name[] = { 0 , "NOTE_INSN_DELETED",
"NOTE_INSN_RANGE_END", "NOTE_INSN_LIVE", "NOTE_INSN_RANGE_END", "NOTE_INSN_LIVE",
"NOTE_INSN_BASIC_BLOCK" }; "NOTE_INSN_BASIC_BLOCK" };
char *reg_note_name[] = { "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_WAS_0", const char * const reg_note_name[] = { "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_WAS_0",
"REG_EQUAL", "REG_RETVAL", "REG_LIBCALL", "REG_EQUAL", "REG_RETVAL", "REG_LIBCALL",
"REG_NONNEG", "REG_NO_CONFLICT", "REG_UNUSED", "REG_NONNEG", "REG_NO_CONFLICT", "REG_UNUSED",
"REG_CC_SETTER", "REG_CC_USER", "REG_LABEL", "REG_CC_SETTER", "REG_CC_USER", "REG_LABEL",
......
...@@ -57,7 +57,7 @@ extern const char * const rtx_name[]; ...@@ -57,7 +57,7 @@ extern const char * const rtx_name[];
extern const char *rtx_format[]; extern const char *rtx_format[];
#define GET_RTX_FORMAT(CODE) (rtx_format[(int) (CODE)]) #define GET_RTX_FORMAT(CODE) (rtx_format[(int) (CODE)])
extern char rtx_class[]; extern const char rtx_class[];
#define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)]) #define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)])
/* The flags and bitfields of an ADDR_DIFF_VEC. BASE is the base label /* The flags and bitfields of an ADDR_DIFF_VEC. BASE is the base label
...@@ -378,7 +378,7 @@ enum reg_note { REG_DEAD = 1, REG_INC = 2, REG_EQUIV = 3, REG_WAS_0 = 4, ...@@ -378,7 +378,7 @@ enum reg_note { REG_DEAD = 1, REG_INC = 2, REG_EQUIV = 3, REG_WAS_0 = 4,
/* Names for REG_NOTE's in EXPR_LIST insn's. */ /* Names for REG_NOTE's in EXPR_LIST insn's. */
extern char *reg_note_name[]; extern const char * const reg_note_name[];
#define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int) (MODE)]) #define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int) (MODE)])
/* This field is only present on CALL_INSNs. It holds a chain of EXPR_LIST of /* This field is only present on CALL_INSNs. It holds a chain of EXPR_LIST of
...@@ -479,7 +479,7 @@ extern char *reg_note_name[]; ...@@ -479,7 +479,7 @@ extern char *reg_note_name[];
/* Names for NOTE insn's other than line numbers. */ /* Names for NOTE insn's other than line numbers. */
extern char *note_insn_name[]; extern const char * const note_insn_name[];
#define GET_NOTE_INSN_NAME(NOTE_CODE) (note_insn_name[-(NOTE_CODE)]) #define GET_NOTE_INSN_NAME(NOTE_CODE) (note_insn_name[-(NOTE_CODE)])
/* The name of a label, in case it corresponds to an explicit label /* The name of a label, in case it corresponds to an explicit label
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment