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>
* c-common.c (c_get_alias_set): Update comment.
......
......@@ -37,8 +37,6 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "insn-attr.h"
extern char *rtx_name[];
mypr (s, a1, a2, a3, a4, a5)
char *s;
int a1, a2, a3, a4, a5;
......@@ -52,7 +50,7 @@ myprcode (i)
if (i < 0 || i > 90)
fprintf (stderr, "code = %d\n", i);
else
fprintf (stderr, "code = %s\n", rtx_name[i]);
fprintf (stderr, "code = %s\n", GET_RTX_NAME(i));
}
myabort (i)
......
......@@ -134,7 +134,7 @@ static void
print_code (code)
RTX_CODE code;
{
register char *p1;
register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++)
{
if (*p1 >= 'a' && *p1 <= 'z')
......
......@@ -176,7 +176,7 @@ gen_insn (insn)
case 'c':
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)
break;
......@@ -190,7 +190,7 @@ gen_insn (insn)
if (op == NUM_RTX_CODE)
matches = 0;
else
np += strlen (rtx_name[op]);
np += strlen (GET_RTX_NAME(op));
break;
case 'a':
case 'b':
......@@ -268,10 +268,10 @@ gen_insn (insn)
printf ("%smode", mode_name[m2]);
break;
case 'c':
printf ("%s", rtx_name[op]);
printf ("%s", GET_RTX_NAME(op));
break;
case 'C':
for (np = rtx_name[op]; *np; np++)
for (np = GET_RTX_NAME(op); *np; np++)
printf ("%c", toupper ((unsigned char)*np));
break;
}
......
......@@ -374,7 +374,7 @@ static void
print_code (code)
RTX_CODE code;
{
register char *p1;
register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++)
{
if (*p1 >= 'a' && *p1 <= 'z')
......
......@@ -1527,7 +1527,7 @@ static void
print_code (code)
enum rtx_code code;
{
register char *p1;
register const char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++)
{
if (*p1 >= 'a' && *p1 <= 'z')
......
......@@ -36,6 +36,13 @@ static const char *graph_ext[] =
/* 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. */
static void
start_fct (fp)
......@@ -190,7 +197,7 @@ draw_edge (fp, from, to, bb_edge, class)
int bb_edge;
int class;
{
char * color;
const char * color;
switch (graph_dump_format)
{
case vcg:
......@@ -215,9 +222,8 @@ draw_edge (fp, from, to, bb_edge, class)
}
static void
end_bb (fp, bb)
end_bb (fp)
FILE *fp;
int bb ATTRIBUTE_UNUSED;
{
switch (graph_dump_format)
{
......@@ -346,7 +352,7 @@ print_rtl_graph_with_bb (base, suffix, rtx_first)
bb = BASIC_BLOCK (i);
/* End of the basic block. */
end_bb (fp, bb);
end_bb (fp);
/* Now specify the edges to all the successors of this
basic block. */
......
......@@ -222,7 +222,7 @@ static FILE *dump = 0;
void
fix_sched_param (param, val)
char *param, *val;
const char *param, *val;
{
if (!strcmp (param, "verbose"))
sched_verbose_param = atoi (val);
......@@ -455,7 +455,7 @@ static int schedule_block PROTO ((int, int));
static void split_hard_reg_notes PROTO ((rtx, rtx, rtx));
static void new_insn_dead_notes PROTO ((rtx, rtx, rtx, rtx));
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 birthing_insn_p PROTO ((rtx));
static void adjust_priority PROTO ((rtx));
......@@ -748,7 +748,7 @@ static void init_target_units PROTO ((void));
static void insn_print_units PROTO ((rtx));
static int get_visual_tbl_length 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_no_unit PROTO ((rtx));
static void visualize_stall_cycles PROTO ((int, int));
......@@ -5792,7 +5792,7 @@ static char *
safe_concat (buf, cur, str)
char *buf;
char *cur;
char *str;
const char *str;
{
char *end = buf + BUF_LEN - 2; /* leave room for null */
int c;
......@@ -5821,10 +5821,10 @@ print_exp (buf, x, verbose)
int verbose;
{
char tmp[BUF_LEN];
char *st[4];
const char *st[4];
char *cur = buf;
char *fun = (char *)0;
char *sep;
const char *fun = (char *)0;
const char *sep;
rtx op[4];
int i;
......@@ -6433,7 +6433,7 @@ print_insn (buf, x, verbose)
static void
print_block_visualization (b, s)
int b;
char *s;
const char *s;
{
int unit, i;
......
......@@ -47,7 +47,7 @@ int rtx_length[NUM_RTX_CODE + 1];
#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 */
};
......
......@@ -51,7 +51,7 @@ enum rtx_code {
extern int rtx_length[];
#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)])
extern char *rtx_format[];
......@@ -1347,7 +1347,7 @@ extern void dump_combine_total_stats PROTO ((FILE *));
extern void schedule_insns PROTO ((FILE *));
#endif
#ifdef HAIFA
extern void fix_sched_param PROTO ((char *, char *));
extern void fix_sched_param PROTO ((const char *, const char *));
#endif
/* 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