diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-01-23 19:45:50 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-01-23 19:45:50 +0000 |
commit | a8482e91d66166ec082f4240b4192dbc3f294982 (patch) | |
tree | 55c79465cdc5b1c6462772036b913316f9fc2f6f | |
parent | 7df8690a400db113b722052c4dd8f374ba20d45c (diff) | |
download | gcc-a8482e91d66166ec082f4240b4192dbc3f294982.tar.gz |
* final.c (bb_str): Qualify a char* with the keyword `const'.
(add_bb_string, final_scan_insn, output_asm_insn): Likewise.
* fix-header.c (read_scan_file): Likewise.
* genoutput.c (output_epilogue, process_template): Likewise.
* local-alloc.c (requires_inout, block_alloc): Likewise.
* output.h (output_asm_insn, assemble_string): Likewise.
* recog.c (recog_constraints, check_asm_operands,
decode_asm_operands, extract_insn, preprocess_constraints,
constrain_operands): Likewise.
* recog.h (operand_alternative, recog_constraints, insn_template,
insn_outfun, insn_operand_constraint, insn_name): Likewise.
* regclass.c (record_reg_classes, scan_one_insn): Likewise.
* regmove.c (find_matches): Likewise.
* reload.c (alternative_allows_memconst): Likewise.
* reload1.c (constraint_accepts_reg_p,
reload_cse_simplify_operands): Likewise.
* rtl.h (decode_asm_operands): Likewise.
* scan.h (fn_decl): Likewise.
* varasm.c (assemble_string): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24834 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 35 | ||||
-rw-r--r-- | gcc/final.c | 12 | ||||
-rw-r--r-- | gcc/fix-header.c | 2 | ||||
-rw-r--r-- | gcc/genoutput.c | 14 | ||||
-rw-r--r-- | gcc/local-alloc.c | 6 | ||||
-rw-r--r-- | gcc/output.h | 4 | ||||
-rw-r--r-- | gcc/recog.c | 18 | ||||
-rw-r--r-- | gcc/recog.h | 12 | ||||
-rw-r--r-- | gcc/regclass.c | 10 | ||||
-rw-r--r-- | gcc/regmove.c | 3 | ||||
-rw-r--r-- | gcc/reload.c | 4 | ||||
-rw-r--r-- | gcc/reload1.c | 8 | ||||
-rw-r--r-- | gcc/rtl.h | 4 | ||||
-rw-r--r-- | gcc/scan.h | 6 | ||||
-rw-r--r-- | gcc/varasm.c | 2 |
15 files changed, 89 insertions, 51 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f6a388db834..2f963f24c1b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,38 @@ +Sat Jan 23 22:34:57 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * final.c (bb_str): Qualify a char* with the keyword `const'. + (add_bb_string, final_scan_insn, output_asm_insn): Likewise. + + * fix-header.c (read_scan_file): Likewise. + + * genoutput.c (output_epilogue, process_template): Likewise. + + * local-alloc.c (requires_inout, block_alloc): Likewise. + + * output.h (output_asm_insn, assemble_string): Likewise. + + * recog.c (recog_constraints, check_asm_operands, + decode_asm_operands, extract_insn, preprocess_constraints, + constrain_operands): Likewise. + + * recog.h (operand_alternative, recog_constraints, insn_template, + insn_outfun, insn_operand_constraint, insn_name): Likewise. + + * regclass.c (record_reg_classes, scan_one_insn): Likewise. + + * regmove.c (find_matches): Likewise. + + * reload.c (alternative_allows_memconst): Likewise. + + * reload1.c (constraint_accepts_reg_p, + reload_cse_simplify_operands): Likewise. + + * rtl.h (decode_asm_operands): Likewise. + + * scan.h (fn_decl): Likewise. + + * varasm.c (assemble_string): Likewise. + Sat Jan 23 01:37:36 1999 Jeffrey A Law (law@cygnus.com) * configure.in (gcc_tooldir): Handle case where exec_prefix has diff --git a/gcc/final.c b/gcc/final.c index b82a0425574..08487c7ce04 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -282,7 +282,7 @@ static int bb_func_label_num = -1; /* Current label # for func */ struct bb_str { struct bb_str *next; /* pointer to next string */ - char *string; /* string */ + const char *string; /* string */ int label_num; /* label number */ int length; /* string length */ }; @@ -299,7 +299,7 @@ static int asm_insn_count PROTO((rtx)); static void profile_function PROTO((FILE *)); static void profile_after_prologue PROTO((FILE *)); static void add_bb PROTO((FILE *)); -static int add_bb_string PROTO((char *, int)); +static int add_bb_string PROTO((const char *, int)); static void output_source_line PROTO((FILE *, rtx)); static rtx walk_alter_subreg PROTO((rtx)); static void output_asm_name PROTO((void)); @@ -1866,7 +1866,7 @@ add_bb (file) static int add_bb_string (string, perm_p) - char *string; + const char *string; int perm_p; { int len; @@ -2395,7 +2395,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) { register rtx body = PATTERN (insn); int insn_code_number; - char *template; + const char *template; #ifdef HAVE_cc0 rtx note; #endif @@ -3351,10 +3351,10 @@ output_asm_name () void output_asm_insn (template, operands) - char *template; + const char *template; rtx *operands; { - register char *p; + register const char *p; register int c; /* An insn may return a null string template diff --git a/gcc/fix-header.c b/gcc/fix-header.c index 5ac167f5e4b..416ec7e2a1c 100644 --- a/gcc/fix-header.c +++ b/gcc/fix-header.c @@ -692,7 +692,7 @@ read_scan_file (in_fname, argc, argv) /* Append "_filbuf" and/or "_flsbuf" to the required functions. */ if (need_filbuf + need_flsbuf) { - char *new_list; + const char *new_list; if (need_filbuf) SET_REQUIRED (fn); if (need_flsbuf) diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 4e7a3339441..30d1280b76d 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -233,7 +233,7 @@ output_epilogue () { register struct data *d; - printf ("\nchar * const insn_template[] =\n {\n"); + printf ("\nconst char * const insn_template[] =\n {\n"); for (d = insn_data; d; d = d->next) { if (d->template) @@ -243,7 +243,7 @@ output_epilogue () } printf (" };\n"); - printf ("\nchar *(*const insn_outfun[])() =\n {\n"); + printf ("\nconst char *(*const insn_outfun[])() =\n {\n"); for (d = insn_data; d; d = d->next) { if (d->outfun) @@ -263,7 +263,7 @@ output_epilogue () } printf (" };\n"); - printf ("\nchar *insn_name[] =\n {\n"); + printf ("\nconst char *insn_name[] =\n {\n"); { int offset = 0; int next; @@ -304,7 +304,7 @@ output_epilogue () } } printf (" };\n"); - printf ("char **insn_name_ptr = insn_name;\n"); + printf ("const char **insn_name_ptr = insn_name;\n"); printf ("\nconst int insn_n_operands[] =\n {\n"); for (d = insn_data; d; d = d->next) @@ -318,7 +318,7 @@ output_epilogue () if (have_constraints) { - printf ("\nchar *const insn_operand_constraint[][MAX_RECOG_OPERANDS] =\n {\n"); + printf ("\nconst char *const insn_operand_constraint[][MAX_RECOG_OPERANDS] =\n {\n"); for (d = insn_data; d; d = d->next) { register int i; @@ -595,7 +595,7 @@ process_template (d, template) d->template = 0; d->outfun = 1; - printf ("\nstatic char *\n"); + printf ("\nstatic const char *\n"); printf ("output_%d (operands, insn)\n", d->code_number); printf (" rtx *operands ATTRIBUTE_UNUSED;\n"); printf (" rtx insn ATTRIBUTE_UNUSED;\n"); @@ -608,7 +608,7 @@ process_template (d, template) if (template[0] == '@') { - printf (" static /*const*/ char *const strings_%d[] = {\n", + printf (" static const char *const strings_%d[] = {\n", d->code_number); for (i = 0, cp = &template[1]; *cp; ) diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index d063aac7ba5..127023daae4 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -261,7 +261,7 @@ static int find_free_reg PROTO((enum reg_class, enum machine_mode, static void mark_life PROTO((int, enum machine_mode, int)); static void post_mark_life PROTO((int, enum machine_mode, int, int, int)); static int no_conflict_p PROTO((rtx, rtx, rtx)); -static int requires_inout PROTO((char *)); +static int requires_inout PROTO((const char *)); /* Allocate a new quantity (new within current basic block) for register number REGNO which is born at index BIRTH @@ -1105,7 +1105,7 @@ block_alloc (b) for (i = 1; i < recog_n_operands; i++) { - char *p = recog_constraints[i]; + const char *p = recog_constraints[i]; int this_match = (requires_inout (p)); n_matching_alts += this_match; @@ -2177,7 +2177,7 @@ no_conflict_p (insn, r0, r1) static int requires_inout (p) - char *p; + const char *p; { char c; int found_zero = 0; diff --git a/gcc/output.h b/gcc/output.h index d677c012e05..a7fe6937210 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -81,7 +81,7 @@ extern void output_operand_lossage PROTO((const char *)); /* Output a string of assembler code, substituting insn operands. Defined in final.c. */ -extern void output_asm_insn PROTO((char *, rtx *)); +extern void output_asm_insn PROTO((const char *, rtx *)); /* Compute a worst-case reference address of a branch so that it can be safely used in the presence of aligned labels. @@ -245,7 +245,7 @@ extern void assemble_zeros PROTO((int)); extern void assemble_align PROTO((int)); /* Assemble a string constant with the specified C string as contents. */ -extern void assemble_string PROTO((char *, int)); +extern void assemble_string PROTO((const char *, int)); /* Assemble everything that is needed for a variable or function declaration. Not used for automatic variables, and not used for function definitions. Should not be called for variables of incomplete structure type. diff --git a/gcc/recog.c b/gcc/recog.c index db06d0437df..a0dafd5ccbf 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -94,7 +94,7 @@ int recog_n_alternatives; enum machine_mode recog_operand_mode[MAX_RECOG_OPERANDS]; /* Indexed by N, gives the constraint string for operand N. */ -char *recog_constraints[MAX_RECOG_OPERANDS]; +const char *recog_constraints[MAX_RECOG_OPERANDS]; /* Indexed by N, gives the type (in, out, inout) for operand N. */ enum op_type recog_op_type[MAX_RECOG_OPERANDS]; @@ -162,7 +162,7 @@ check_asm_operands (x) { int noperands; rtx *operands; - char **constraints; + const char **constraints; int i; /* Post-reload, be more strict with things. */ @@ -181,13 +181,13 @@ check_asm_operands (x) return 1; operands = (rtx *) alloca (noperands * sizeof (rtx)); - constraints = (char **) alloca (noperands * sizeof (char *)); + constraints = (const char **) alloca (noperands * sizeof (char *)); decode_asm_operands (x, operands, NULL_PTR, constraints, NULL_PTR); for (i = 0; i < noperands; i++) { - char *c = constraints[i]; + const char *c = constraints[i]; if (ISDIGIT ((unsigned char)c[0])) c = constraints[c[0] - '0']; @@ -1422,7 +1422,7 @@ decode_asm_operands (body, operands, operand_locs, constraints, modes) rtx body; rtx *operands; rtx **operand_locs; - char **constraints; + const char **constraints; enum machine_mode *modes; { register int i; @@ -2022,7 +2022,7 @@ extract_insn (insn) recog_constraints, recog_operand_mode); if (noperands > 0) { - char *p = recog_constraints[0]; + const char *p = recog_constraints[0]; recog_n_alternatives = 1; while (*p) recog_n_alternatives += (*p++ == ','); @@ -2080,7 +2080,7 @@ preprocess_constraints () { int j; struct operand_alternative *op_alt; - char *p = recog_constraints[i]; + const char *p = recog_constraints[i]; op_alt = recog_op_alt[i]; @@ -2210,7 +2210,7 @@ int constrain_operands (strict) int strict; { - char *constraints[MAX_RECOG_OPERANDS]; + const char *constraints[MAX_RECOG_OPERANDS]; int matching_operands[MAX_RECOG_OPERANDS]; int earlyclobber[MAX_RECOG_OPERANDS]; register int c; @@ -2239,7 +2239,7 @@ constrain_operands (strict) { register rtx op = recog_operand[opno]; enum machine_mode mode = GET_MODE (op); - register char *p = constraints[opno]; + register const char *p = constraints[opno]; int offset = 0; int win = 0; int val; diff --git a/gcc/recog.h b/gcc/recog.h index fc4719b4e65..79f22f9135a 100644 --- a/gcc/recog.h +++ b/gcc/recog.h @@ -32,7 +32,7 @@ struct operand_alternative { /* Pointer to the beginning of the constraint string for this alternative, for easier access by alternative number. */ - char *constraint; + const char *constraint; /* The register class valid for this alternative (possibly NO_REGS). */ enum reg_class class; @@ -153,7 +153,7 @@ extern int recog_n_alternatives; extern enum machine_mode recog_operand_mode[]; /* Indexed by N, gives the constraint string for operand N. */ -extern char *recog_constraints[]; +extern const char *recog_constraints[]; /* Indexed by N, gives the type (in, out, inout) for operand N. */ extern enum op_type recog_op_type[]; @@ -176,9 +176,9 @@ extern struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALT /* These are vectors indexed by insn-code. Details in genoutput.c. */ -extern char *const insn_template[]; +extern const char *const insn_template[]; -extern char *(*const insn_outfun[]) (); +extern const char *(*const insn_outfun[]) (); extern const int insn_n_operands[]; @@ -192,7 +192,7 @@ extern const int insn_n_alternatives[]; and second by the operand number. Details in genoutput.c. */ #ifdef REGISTER_CONSTRAINTS /* Avoid undef sym in certain broken linkers. */ -extern char *const insn_operand_constraint[][MAX_RECOG_OPERANDS]; +extern const char *const insn_operand_constraint[][MAX_RECOG_OPERANDS]; #endif #ifndef REGISTER_CONSTRAINTS /* Avoid undef sym in certain broken linkers. */ @@ -205,4 +205,4 @@ extern const char insn_operand_strict_low[][MAX_RECOG_OPERANDS]; extern int (*const insn_operand_predicate[][MAX_RECOG_OPERANDS]) (); -extern char * insn_name[]; +extern const char * insn_name[]; diff --git a/gcc/regclass.c b/gcc/regclass.c index f7c2fe23dd1..f1761206143 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -693,7 +693,7 @@ static int loop_cost; static rtx scan_one_insn PROTO((rtx, int)); static void record_reg_classes PROTO((int, int, rtx *, enum machine_mode *, - char **, rtx)); + const char **, rtx)); static int copy_cost PROTO((rtx, enum machine_mode, enum reg_class, int)); static void record_address_regs PROTO((rtx, enum reg_class, int)); @@ -755,7 +755,7 @@ scan_one_insn (insn, pass) { enum rtx_code code = GET_CODE (insn); enum rtx_code pat_code; - char *constraints[MAX_RECOG_OPERANDS]; + const char *constraints[MAX_RECOG_OPERANDS]; enum machine_mode modes[MAX_RECOG_OPERANDS]; rtx set, note; int i, j; @@ -898,7 +898,7 @@ scan_one_insn (insn, pass) for (i = 0; i < recog_n_operands - 1; i++) if (constraints[i][0] == '%') { - char *xconstraints[MAX_RECOG_OPERANDS]; + const char *xconstraints[MAX_RECOG_OPERANDS]; int j; /* Handle commutative operands by swapping the constraints. @@ -1136,7 +1136,7 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) int n_ops; rtx *ops; enum machine_mode *modes; - char **constraints; + const char **constraints; rtx insn; { int alt; @@ -1156,7 +1156,7 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) for (i = 0; i < n_ops; i++) { - char *p = constraints[i]; + const char *p = constraints[i]; rtx op = ops[i]; enum machine_mode mode = modes[i]; int allows_mem = 0; diff --git a/gcc/regmove.c b/gcc/regmove.c index 9697fa23dc8..70071ac7162 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -1405,7 +1405,8 @@ find_matches (insn, matchp) for (op_no = 0; op_no < recog_n_operands; op_no++) { - char *p, c; + const char *p; + char c; int i = 0; p = recog_constraints[op_no]; diff --git a/gcc/reload.c b/gcc/reload.c index 4bbf317d684..06c34cb7979 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -324,7 +324,7 @@ static int earlyclobber_operand_p PROTO((rtx)); static int hard_reg_set_here_p PROTO((int, int, rtx)); static struct decomposition decompose PROTO((rtx)); static int immune_p PROTO((rtx, rtx, struct decomposition)); -static int alternative_allows_memconst PROTO((char *, int)); +static int alternative_allows_memconst PROTO((const char *, int)); static rtx find_reloads_toplev PROTO((rtx, int, enum reload_type, int, int, rtx)); static rtx make_memloc PROTO((rtx, int)); static int find_reloads_address PROTO((enum machine_mode, rtx *, rtx, rtx *, @@ -4272,7 +4272,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p) static int alternative_allows_memconst (constraint, altnum) - char *constraint; + const char *constraint; int altnum; { register int c; diff --git a/gcc/reload1.c b/gcc/reload1.c index d68fc8a5b7c..d86c4069795 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -426,7 +426,7 @@ static void delete_output_reload PROTO((rtx, int, int)); static void delete_address_reloads PROTO((rtx, rtx)); static void delete_address_reloads_1 PROTO((rtx, rtx, rtx)); static rtx inc_for_reload PROTO((rtx, rtx, rtx, int)); -static int constraint_accepts_reg_p PROTO((char *, rtx)); +static int constraint_accepts_reg_p PROTO((const char *, rtx)); static void reload_cse_regs_1 PROTO((rtx)); static void reload_cse_invalidate_regno PROTO((int, enum machine_mode, int)); static int reload_cse_mem_conflict_p PROTO((rtx, rtx)); @@ -8238,7 +8238,7 @@ inc_for_reload (reloadreg, in, value, inc_amount) static int constraint_accepts_reg_p (string, reg) - char *string; + const char *string; rtx reg; { int value = 0; @@ -9012,7 +9012,7 @@ reload_cse_simplify_operands (insn) #ifdef REGISTER_CONSTRAINTS int i,j; - char *constraints[MAX_RECOG_OPERANDS]; + const char *constraints[MAX_RECOG_OPERANDS]; /* Vector recording how bad an alternative is. */ int *alternative_reject; @@ -9046,7 +9046,7 @@ reload_cse_simplify_operands (insn) { enum machine_mode mode; int regno; - char *p; + const char *p; op_alt_regno[i] = (int *) alloca (recog_n_alternatives * sizeof (int)); for (j = 0; j < recog_n_alternatives; j++) diff --git a/gcc/rtl.h b/gcc/rtl.h index a3156642f7e..c7b59093afa 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1052,7 +1052,9 @@ extern void free_reg_info PROTO((void)); /* recog.c */ extern int asm_noperands PROTO((rtx)); -extern char *decode_asm_operands PROTO((rtx, rtx *, rtx **, char **, enum machine_mode *)); +extern char *decode_asm_operands PROTO((rtx, rtx *, rtx **, + const char **, + enum machine_mode *)); extern enum reg_class reg_preferred_class PROTO((int)); extern enum reg_class reg_alternate_class PROTO((int)); diff --git a/gcc/scan.h b/gcc/scan.h index 5839bfec544..67ee674fe82 100644 --- a/gcc/scan.h +++ b/gcc/scan.h @@ -44,9 +44,9 @@ typedef struct sstring struct partial_proto; struct fn_decl { - char *fname; - char *rtype; - char *params; + const char *fname; + const char *rtype; + const char *params; struct partial_proto *partial; }; diff --git a/gcc/varasm.c b/gcc/varasm.c index 9fad6eb3993..4dc474536d3 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1108,7 +1108,7 @@ assemble_align (align) void assemble_string (p, size) - char *p; + const char *p; int size; { int pos = 0; |