Commit 5f06c983 by Kaveh R. Ghazi Committed by Kaveh Ghazi

rtl.c (rtx_name): Constify a char*.

	* rtl.c (rtx_name): Constify a char*.

	* rtl.h (rtx_name, fix_sched_param): Likewise.

	* gmicro/gmicro.c (rtx_name): Remove redundant declaration.
	(mypr): Use accessor macro, not `rtx_name'.

	* genemit.c (print_code): Constify a char*.

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

	* genpeep.c (print_code): Constify a char*.

	* genrecog.c (print_code): Likewise.

	* graph.c (start_fct, start_bb, node_data, draw_edge, end_fct,
	end_bb): Add static prototype.
	(draw_edge): Constify a char*.
	(end_bb): Remove unused parameter.

	* haifa-sched.c (fix_sched_param, safe_concat, print_exp
	print_block_visualization): Constify a char*.

From-SVN: r28782
parent 22e9174f
Fri Aug 20 18:31:26 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* rtl.c (rtx_name): Constify a char*.
* rtl.h (rtx_name, fix_sched_param): Likewise.
* gmicro/gmicro.c (rtx_name): Remove redundant declaration.
(mypr): Use accessor macro, not `rtx_name'.
* genemit.c (print_code): Constify a char*.
* genopinit.c (gen_insn): Use accessor macro, not `rtx_name'.
* genpeep.c (print_code): Constify a char*.
* genrecog.c (print_code): Likewise.
* graph.c (start_fct, start_bb, node_data, draw_edge, end_fct,
end_bb): Add static prototype.
(draw_edge): Constify a char*.
(end_bb): Remove unused parameter.
* haifa-sched.c (fix_sched_param, safe_concat, print_exp
print_block_visualization): Constify a char*.
Fri Aug 20 15:02:10 1999 Mark Mitchell <mark@codesourcery.com> Fri Aug 20 15:02:10 1999 Mark Mitchell <mark@codesourcery.com>
* c-common.c (c_get_alias_set): Update comment. * c-common.c (c_get_alias_set): Update comment.
......
...@@ -37,8 +37,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,8 +37,6 @@ Boston, MA 02111-1307, USA. */
#include "output.h" #include "output.h"
#include "insn-attr.h" #include "insn-attr.h"
extern char *rtx_name[];
mypr (s, a1, a2, a3, a4, a5) mypr (s, a1, a2, a3, a4, a5)
char *s; char *s;
int a1, a2, a3, a4, a5; int a1, a2, a3, a4, a5;
...@@ -52,7 +50,7 @@ myprcode (i) ...@@ -52,7 +50,7 @@ myprcode (i)
if (i < 0 || i > 90) if (i < 0 || i > 90)
fprintf (stderr, "code = %d\n", i); fprintf (stderr, "code = %d\n", i);
else else
fprintf (stderr, "code = %s\n", rtx_name[i]); fprintf (stderr, "code = %s\n", GET_RTX_NAME(i));
} }
myabort (i) myabort (i)
......
...@@ -134,7 +134,7 @@ static void ...@@ -134,7 +134,7 @@ static void
print_code (code) print_code (code)
RTX_CODE code; RTX_CODE code;
{ {
register char *p1; register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++) for (p1 = GET_RTX_NAME (code); *p1; p1++)
{ {
if (*p1 >= 'a' && *p1 <= 'z') if (*p1 >= 'a' && *p1 <= 'z')
......
...@@ -176,7 +176,7 @@ gen_insn (insn) ...@@ -176,7 +176,7 @@ gen_insn (insn)
case 'c': case 'c':
for (op = 0; op < NUM_RTX_CODE; op++) for (op = 0; op < NUM_RTX_CODE; op++)
{ {
for (p = rtx_name[op], q = np; *p; p++, q++) for (p = GET_RTX_NAME(op), q = np; *p; p++, q++)
if (*p != *q) if (*p != *q)
break; break;
...@@ -190,7 +190,7 @@ gen_insn (insn) ...@@ -190,7 +190,7 @@ gen_insn (insn)
if (op == NUM_RTX_CODE) if (op == NUM_RTX_CODE)
matches = 0; matches = 0;
else else
np += strlen (rtx_name[op]); np += strlen (GET_RTX_NAME(op));
break; break;
case 'a': case 'a':
case 'b': case 'b':
...@@ -268,10 +268,10 @@ gen_insn (insn) ...@@ -268,10 +268,10 @@ gen_insn (insn)
printf ("%smode", mode_name[m2]); printf ("%smode", mode_name[m2]);
break; break;
case 'c': case 'c':
printf ("%s", rtx_name[op]); printf ("%s", GET_RTX_NAME(op));
break; break;
case 'C': case 'C':
for (np = rtx_name[op]; *np; np++) for (np = GET_RTX_NAME(op); *np; np++)
printf ("%c", toupper ((unsigned char)*np)); printf ("%c", toupper ((unsigned char)*np));
break; break;
} }
......
...@@ -374,7 +374,7 @@ static void ...@@ -374,7 +374,7 @@ static void
print_code (code) print_code (code)
RTX_CODE code; RTX_CODE code;
{ {
register char *p1; register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++) for (p1 = GET_RTX_NAME (code); *p1; p1++)
{ {
if (*p1 >= 'a' && *p1 <= 'z') if (*p1 >= 'a' && *p1 <= 'z')
......
...@@ -1527,7 +1527,7 @@ static void ...@@ -1527,7 +1527,7 @@ static void
print_code (code) print_code (code)
enum rtx_code code; enum rtx_code code;
{ {
register char *p1; register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++) for (p1 = GET_RTX_NAME (code); *p1; p1++)
{ {
if (*p1 >= 'a' && *p1 <= 'z') if (*p1 >= 'a' && *p1 <= 'z')
......
...@@ -36,6 +36,13 @@ static const char *graph_ext[] = ...@@ -36,6 +36,13 @@ static const char *graph_ext[] =
/* vcg */ ".vcg", /* vcg */ ".vcg",
}; };
static void start_fct PROTO ((FILE *));
static void start_bb PROTO ((FILE *, int));
static void node_data PROTO ((FILE *, rtx));
static void draw_edge PROTO ((FILE *, int, int, int, int));
static void end_fct PROTO ((FILE *));
static void end_bb PROTO ((FILE *));
/* Output text for new basic block. */ /* Output text for new basic block. */
static void static void
start_fct (fp) start_fct (fp)
...@@ -190,7 +197,7 @@ draw_edge (fp, from, to, bb_edge, class) ...@@ -190,7 +197,7 @@ draw_edge (fp, from, to, bb_edge, class)
int bb_edge; int bb_edge;
int class; int class;
{ {
char * color; const char * color;
switch (graph_dump_format) switch (graph_dump_format)
{ {
case vcg: case vcg:
...@@ -215,9 +222,8 @@ draw_edge (fp, from, to, bb_edge, class) ...@@ -215,9 +222,8 @@ draw_edge (fp, from, to, bb_edge, class)
} }
static void static void
end_bb (fp, bb) end_bb (fp)
FILE *fp; FILE *fp;
int bb ATTRIBUTE_UNUSED;
{ {
switch (graph_dump_format) switch (graph_dump_format)
{ {
...@@ -346,7 +352,7 @@ print_rtl_graph_with_bb (base, suffix, rtx_first) ...@@ -346,7 +352,7 @@ print_rtl_graph_with_bb (base, suffix, rtx_first)
bb = BASIC_BLOCK (i); bb = BASIC_BLOCK (i);
/* End of the basic block. */ /* End of the basic block. */
end_bb (fp, bb); end_bb (fp);
/* Now specify the edges to all the successors of this /* Now specify the edges to all the successors of this
basic block. */ basic block. */
......
...@@ -222,7 +222,7 @@ static FILE *dump = 0; ...@@ -222,7 +222,7 @@ static FILE *dump = 0;
void void
fix_sched_param (param, val) fix_sched_param (param, val)
char *param, *val; const char *param, *val;
{ {
if (!strcmp (param, "verbose")) if (!strcmp (param, "verbose"))
sched_verbose_param = atoi (val); sched_verbose_param = atoi (val);
...@@ -455,7 +455,7 @@ static int schedule_block PROTO ((int, int)); ...@@ -455,7 +455,7 @@ static int schedule_block PROTO ((int, int));
static void split_hard_reg_notes PROTO ((rtx, rtx, rtx)); static void split_hard_reg_notes PROTO ((rtx, rtx, rtx));
static void new_insn_dead_notes PROTO ((rtx, rtx, rtx, rtx)); static void new_insn_dead_notes PROTO ((rtx, rtx, rtx, rtx));
static void update_n_sets PROTO ((rtx, int)); static void update_n_sets PROTO ((rtx, int));
static char *safe_concat PROTO ((char *, char *, char *)); static char *safe_concat PROTO ((char *, char *, const char *));
static int insn_issue_delay PROTO ((rtx)); static int insn_issue_delay PROTO ((rtx));
static int birthing_insn_p PROTO ((rtx)); static int birthing_insn_p PROTO ((rtx));
static void adjust_priority PROTO ((rtx)); static void adjust_priority PROTO ((rtx));
...@@ -748,7 +748,7 @@ static void init_target_units PROTO ((void)); ...@@ -748,7 +748,7 @@ static void init_target_units PROTO ((void));
static void insn_print_units PROTO ((rtx)); static void insn_print_units PROTO ((rtx));
static int get_visual_tbl_length PROTO ((void)); static int get_visual_tbl_length PROTO ((void));
static void init_block_visualization PROTO ((void)); static void init_block_visualization PROTO ((void));
static void print_block_visualization PROTO ((int, char *)); static void print_block_visualization PROTO ((int, const char *));
static void visualize_scheduled_insns PROTO ((int, int)); static void visualize_scheduled_insns PROTO ((int, int));
static void visualize_no_unit PROTO ((rtx)); static void visualize_no_unit PROTO ((rtx));
static void visualize_stall_cycles PROTO ((int, int)); static void visualize_stall_cycles PROTO ((int, int));
...@@ -5792,7 +5792,7 @@ static char * ...@@ -5792,7 +5792,7 @@ static char *
safe_concat (buf, cur, str) safe_concat (buf, cur, str)
char *buf; char *buf;
char *cur; char *cur;
char *str; const char *str;
{ {
char *end = buf + BUF_LEN - 2; /* leave room for null */ char *end = buf + BUF_LEN - 2; /* leave room for null */
int c; int c;
...@@ -5821,10 +5821,10 @@ print_exp (buf, x, verbose) ...@@ -5821,10 +5821,10 @@ print_exp (buf, x, verbose)
int verbose; int verbose;
{ {
char tmp[BUF_LEN]; char tmp[BUF_LEN];
char *st[4]; const char *st[4];
char *cur = buf; char *cur = buf;
char *fun = (char *)0; const char *fun = (char *)0;
char *sep; const char *sep;
rtx op[4]; rtx op[4];
int i; int i;
...@@ -6433,7 +6433,7 @@ print_insn (buf, x, verbose) ...@@ -6433,7 +6433,7 @@ print_insn (buf, x, verbose)
static void static void
print_block_visualization (b, s) print_block_visualization (b, s)
int b; int b;
char *s; const char *s;
{ {
int unit, i; int unit, i;
......
...@@ -47,7 +47,7 @@ int rtx_length[NUM_RTX_CODE + 1]; ...@@ -47,7 +47,7 @@ int rtx_length[NUM_RTX_CODE + 1];
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) NAME , #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) NAME ,
char *rtx_name[] = { const char * const rtx_name[] = {
#include "rtl.def" /* rtl expressions are documented here */ #include "rtl.def" /* rtl expressions are documented here */
}; };
......
...@@ -51,7 +51,7 @@ enum rtx_code { ...@@ -51,7 +51,7 @@ enum rtx_code {
extern int rtx_length[]; extern int rtx_length[];
#define GET_RTX_LENGTH(CODE) (rtx_length[(int) (CODE)]) #define GET_RTX_LENGTH(CODE) (rtx_length[(int) (CODE)])
extern char *rtx_name[]; extern const char * const rtx_name[];
#define GET_RTX_NAME(CODE) (rtx_name[(int) (CODE)]) #define GET_RTX_NAME(CODE) (rtx_name[(int) (CODE)])
extern char *rtx_format[]; extern char *rtx_format[];
...@@ -1347,7 +1347,7 @@ extern void dump_combine_total_stats PROTO ((FILE *)); ...@@ -1347,7 +1347,7 @@ extern void dump_combine_total_stats PROTO ((FILE *));
extern void schedule_insns PROTO ((FILE *)); extern void schedule_insns PROTO ((FILE *));
#endif #endif
#ifdef HAIFA #ifdef HAIFA
extern void fix_sched_param PROTO ((char *, char *)); extern void fix_sched_param PROTO ((const char *, const char *));
#endif #endif
/* In print-rtl.c */ /* In print-rtl.c */
......
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