* 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.
From-SVN: r24834
+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
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 */
};
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));
static int
add_bb_string (string, perm_p)
- char *string;
+ const char *string;
int perm_p;
{
int len;
{
register rtx body = PATTERN (insn);
int insn_code_number;
- char *template;
+ const char *template;
#ifdef HAVE_cc0
rtx note;
#endif
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
/* 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)
{
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)
}
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)
}
printf (" };\n");
- printf ("\nchar *insn_name[] =\n {\n");
+ printf ("\nconst char *insn_name[] =\n {\n");
{
int offset = 0;
int next;
}
}
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)
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;
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");
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; )
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 *));
\f
/* Allocate a new quantity (new within current basic block)
for register number REGNO which is born at index BIRTH
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;
static int
requires_inout (p)
- char *p;
+ const char *p;
{
char c;
int found_zero = 0;
/* 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.
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.
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];
{
int noperands;
rtx *operands;
- char **constraints;
+ const char **constraints;
int i;
/* Post-reload, be more strict with things. */
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'];
rtx body;
rtx *operands;
rtx **operand_locs;
- char **constraints;
+ const char **constraints;
enum machine_mode *modes;
{
register int i;
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++ == ',');
{
int j;
struct operand_alternative *op_alt;
- char *p = recog_constraints[i];
+ const char *p = recog_constraints[i];
op_alt = recog_op_alt[i];
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;
{
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;
{
/* 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;
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[];
/* 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[];
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. */
extern int (*const insn_operand_predicate[][MAX_RECOG_OPERANDS]) ();
-extern char * insn_name[];
+extern const char * insn_name[];
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));
{
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;
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.
int n_ops;
rtx *ops;
enum machine_mode *modes;
- char **constraints;
+ const char **constraints;
rtx insn;
{
int alt;
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;
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];
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 *,
static int
alternative_allows_memconst (constraint, altnum)
- char *constraint;
+ const char *constraint;
int altnum;
{
register int c;
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));
static int
constraint_accepts_reg_p (string, reg)
- char *string;
+ const char *string;
rtx reg;
{
int value = 0;
#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;
{
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++)
/* 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));
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;
};
void
assemble_string (p, size)
- char *p;
+ const char *p;
int size;
{
int pos = 0;