aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1999-08-20 22:32:54 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1999-08-20 22:32:54 +0000
commit5f06c983f3b137a2fe493e80087f2bb72b34d715 (patch)
tree010843ea91dff778c8ce14704a4f98a412d570ca
parent22e9174f5416123df52503b2dc2248de0f4ca27e (diff)
downloadgcc-5f06c983f3b137a2fe493e80087f2bb72b34d715.zip
gcc-5f06c983f3b137a2fe493e80087f2bb72b34d715.tar.gz
gcc-5f06c983f3b137a2fe493e80087f2bb72b34d715.tar.bz2
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
-rw-r--r--gcc/ChangeLog25
-rw-r--r--gcc/config/gmicro/gmicro.c4
-rw-r--r--gcc/genemit.c2
-rw-r--r--gcc/genopinit.c8
-rw-r--r--gcc/genpeep.c2
-rw-r--r--gcc/genrecog.c2
-rw-r--r--gcc/graph.c14
-rw-r--r--gcc/haifa-sched.c16
-rw-r--r--gcc/rtl.c2
-rw-r--r--gcc/rtl.h4
10 files changed, 54 insertions, 25 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index abe3702..6daf901 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,28 @@
+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.
diff --git a/gcc/config/gmicro/gmicro.c b/gcc/config/gmicro/gmicro.c
index 0029ccc..7a81a7d 100644
--- a/gcc/config/gmicro/gmicro.c
+++ b/gcc/config/gmicro/gmicro.c
@@ -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)
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 516f167..bd98485 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -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')
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index 2cd67b3..7394e56 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -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;
}
diff --git a/gcc/genpeep.c b/gcc/genpeep.c
index 047fef4..2ef2bd8 100644
--- a/gcc/genpeep.c
+++ b/gcc/genpeep.c
@@ -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')
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 1e230230..1a3c60d 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -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')
diff --git a/gcc/graph.c b/gcc/graph.c
index 3086e40..4f8929d 100644
--- a/gcc/graph.c
+++ b/gcc/graph.c
@@ -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. */
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 0521660..1c60c72 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -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;
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 89f800a..39a72d5 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -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 */
};
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 00abb02..c4a7cbe 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -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 */