Commit 93bad80e by Steven Bosscher

ra.c: Convert to ISO C90 prototypes.

2003-09-14  Steven Bosscher  <steven@gcc.gnu.org>

	* ra.c: Convert to ISO C90 prototypes.
	* ra-build.c: Likewise.
	* ra-colorize.c: Likewise.
	* ra-debug.c: Likewise.
	* ra-rewrite.c: Likewise.

From-SVN: r71379
parent 3983d33e
2003-09-14 Steven Bosscher <steven@gcc.gnu.org>
* ra.c: Convert to ISO C90 prototypes.
* ra-build.c: Likewise.
* ra-colorize.c: Likewise.
* ra-debug.c: Likewise.
* ra-rewrite.c: Likewise.
2003-09-14 Richard Sandiford <rsandifo@redhat.com> 2003-09-14 Richard Sandiford <rsandifo@redhat.com>
* Makefile.in (%.dvi): Remove excess $(docdir). * Makefile.in (%.dvi): Remove excess $(docdir).
......
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
/* This file contains various dumping and debug functions for /* This file contains various dumping and debug functions for
the graph coloring register allocator. */ the graph coloring register allocator. */
static void ra_print_rtx_1op PARAMS ((FILE *, rtx)); static void ra_print_rtx_1op (FILE *, rtx);
static void ra_print_rtx_2op PARAMS ((FILE *, rtx)); static void ra_print_rtx_2op (FILE *, rtx);
static void ra_print_rtx_3op PARAMS ((FILE *, rtx)); static void ra_print_rtx_3op (FILE *, rtx);
static void ra_print_rtx_object PARAMS ((FILE *, rtx)); static void ra_print_rtx_object (FILE *, rtx);
/* The hardregs as names, for debugging. */ /* The hardregs as names, for debugging. */
static const char *const reg_class_names[] = REG_CLASS_NAMES; static const char *const reg_class_names[] = REG_CLASS_NAMES;
...@@ -70,9 +70,7 @@ ra_debug_msg (unsigned int level, const char *format, ...) ...@@ -70,9 +70,7 @@ ra_debug_msg (unsigned int level, const char *format, ...)
"op(Y)" to FILE. */ "op(Y)" to FILE. */
static void static void
ra_print_rtx_1op (file, x) ra_print_rtx_1op (FILE *file, rtx x)
FILE *file;
rtx x;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
rtx op0 = XEXP (x, 0); rtx op0 = XEXP (x, 0);
...@@ -106,9 +104,7 @@ ra_print_rtx_1op (file, x) ...@@ -106,9 +104,7 @@ ra_print_rtx_1op (file, x)
to FILE. */ to FILE. */
static void static void
ra_print_rtx_2op (file, x) ra_print_rtx_2op (FILE *file, rtx x)
FILE *file;
rtx x;
{ {
int infix = 1; int infix = 1;
const char *opname = "shitop"; const char *opname = "shitop";
...@@ -171,9 +167,7 @@ ra_print_rtx_2op (file, x) ...@@ -171,9 +167,7 @@ ra_print_rtx_2op (file, x)
I.e. X is either an IF_THEN_ELSE, or a bitmap operation. */ I.e. X is either an IF_THEN_ELSE, or a bitmap operation. */
static void static void
ra_print_rtx_3op (file, x) ra_print_rtx_3op (FILE *file, rtx x)
FILE *file;
rtx x;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
rtx op0 = XEXP (x, 0); rtx op0 = XEXP (x, 0);
...@@ -208,9 +202,7 @@ ra_print_rtx_3op (file, x) ...@@ -208,9 +202,7 @@ ra_print_rtx_3op (file, x)
is a hardreg, whose name is NULL, or empty. */ is a hardreg, whose name is NULL, or empty. */
static void static void
ra_print_rtx_object (file, x) ra_print_rtx_object (FILE *file, rtx x)
FILE *file;
rtx x;
{ {
enum rtx_code code = GET_CODE (x); enum rtx_code code = GET_CODE (x);
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
...@@ -344,10 +336,7 @@ ra_print_rtx_object (file, x) ...@@ -344,10 +336,7 @@ ra_print_rtx_object (file, x)
the preceding and following insn. */ the preceding and following insn. */
void void
ra_print_rtx (file, x, with_pn) ra_print_rtx (FILE *file, rtx x, int with_pn)
FILE *file;
rtx x;
int with_pn;
{ {
enum rtx_code code; enum rtx_code code;
char class; char class;
...@@ -517,10 +506,7 @@ ra_print_rtx (file, x, with_pn) ...@@ -517,10 +506,7 @@ ra_print_rtx (file, x, with_pn)
/* This only calls ra_print_rtx(), but emits a final newline. */ /* This only calls ra_print_rtx(), but emits a final newline. */
void void
ra_print_rtx_top (file, x, with_pn) ra_print_rtx_top (FILE *file, rtx x, int with_pn)
FILE *file;
rtx x;
int with_pn;
{ {
ra_print_rtx (file, x, with_pn); ra_print_rtx (file, x, with_pn);
fprintf (file, "\n"); fprintf (file, "\n");
...@@ -529,8 +515,7 @@ ra_print_rtx_top (file, x, with_pn) ...@@ -529,8 +515,7 @@ ra_print_rtx_top (file, x, with_pn)
/* Callable from gdb. This prints rtx X onto stderr. */ /* Callable from gdb. This prints rtx X onto stderr. */
void void
ra_debug_rtx (x) ra_debug_rtx (rtx x)
rtx x;
{ {
ra_print_rtx_top (stderr, x, 1); ra_print_rtx_top (stderr, x, 1);
} }
...@@ -539,8 +524,7 @@ ra_debug_rtx (x) ...@@ -539,8 +524,7 @@ ra_debug_rtx (x)
The first and last insn are emitted with UIDs of prev and next insns. */ The first and last insn are emitted with UIDs of prev and next insns. */
void void
ra_debug_bbi (bbi) ra_debug_bbi (int bbi)
int bbi;
{ {
basic_block bb = BASIC_BLOCK (bbi); basic_block bb = BASIC_BLOCK (bbi);
rtx insn; rtx insn;
...@@ -557,9 +541,7 @@ ra_debug_bbi (bbi) ...@@ -557,9 +541,7 @@ ra_debug_bbi (bbi)
or emit a window of NUM insns around INSN, to stderr. */ or emit a window of NUM insns around INSN, to stderr. */
void void
ra_debug_insns (insn, num) ra_debug_insns (rtx insn, int num)
rtx insn;
int num;
{ {
int i, count = (num == 0 ? 1 : num < 0 ? -num : num); int i, count = (num == 0 ? 1 : num < 0 ? -num : num);
if (num < 0) if (num < 0)
...@@ -578,9 +560,7 @@ ra_debug_insns (insn, num) ...@@ -578,9 +560,7 @@ ra_debug_insns (insn, num)
some notes, if flag_ra_dump_notes is zero. */ some notes, if flag_ra_dump_notes is zero. */
void void
ra_print_rtl_with_bb (file, insn) ra_print_rtl_with_bb (FILE *file, rtx insn)
FILE *file;
rtx insn;
{ {
basic_block last_bb, bb; basic_block last_bb, bb;
unsigned int num = 0; unsigned int num = 0;
...@@ -628,7 +608,7 @@ ra_print_rtl_with_bb (file, insn) ...@@ -628,7 +608,7 @@ ra_print_rtl_with_bb (file, insn)
graph, and prints the findings. */ graph, and prints the findings. */
void void
dump_number_seen () dump_number_seen (void)
{ {
#define N 17 #define N 17
int num[N]; int num[N];
...@@ -654,8 +634,7 @@ dump_number_seen () ...@@ -654,8 +634,7 @@ dump_number_seen ()
/* Dump the interference graph, the move list and the webs. */ /* Dump the interference graph, the move list and the webs. */
void void
dump_igraph (df) dump_igraph (struct df *df ATTRIBUTE_UNUSED)
struct df *df ATTRIBUTE_UNUSED;
{ {
struct move_list *ml; struct move_list *ml;
unsigned int def1, def2; unsigned int def1, def2;
...@@ -741,7 +720,7 @@ dump_igraph (df) ...@@ -741,7 +720,7 @@ dump_igraph (df)
to my custom graph colorizer. */ to my custom graph colorizer. */
void void
dump_igraph_machine () dump_igraph_machine (void)
{ {
unsigned int i; unsigned int i;
...@@ -801,7 +780,7 @@ dump_igraph_machine () ...@@ -801,7 +780,7 @@ dump_igraph_machine ()
and emits information, if the resulting insns are strictly valid. */ and emits information, if the resulting insns are strictly valid. */
void void
dump_constraints () dump_constraints (void)
{ {
rtx insn; rtx insn;
int i; int i;
...@@ -854,9 +833,7 @@ dump_constraints () ...@@ -854,9 +833,7 @@ dump_constraints ()
preceded by a custom message MSG, with debug level LEVEL. */ preceded by a custom message MSG, with debug level LEVEL. */
void void
dump_graph_cost (level, msg) dump_graph_cost (unsigned int level, const char *msg)
unsigned int level;
const char *msg;
{ {
unsigned int i; unsigned int i;
unsigned HOST_WIDE_INT cost; unsigned HOST_WIDE_INT cost;
...@@ -878,8 +855,7 @@ dump_graph_cost (level, msg) ...@@ -878,8 +855,7 @@ dump_graph_cost (level, msg)
/* Dump the color assignment per web, the coalesced and spilled webs. */ /* Dump the color assignment per web, the coalesced and spilled webs. */
void void
dump_ra (df) dump_ra (struct df *df ATTRIBUTE_UNUSED)
struct df *df ATTRIBUTE_UNUSED;
{ {
struct web *web; struct web *web;
struct dlist *d; struct dlist *d;
...@@ -913,10 +889,7 @@ dump_ra (df) ...@@ -913,10 +889,7 @@ dump_ra (df)
(loads, stores and copies). */ (loads, stores and copies). */
void void
dump_static_insn_cost (file, message, prefix) dump_static_insn_cost (FILE *file, const char *message, const char *prefix)
FILE *file;
const char *message;
const char *prefix;
{ {
struct cost struct cost
{ {
...@@ -1001,9 +974,7 @@ dump_static_insn_cost (file, message, prefix) ...@@ -1001,9 +974,7 @@ dump_static_insn_cost (file, message, prefix)
hardregs in common. */ hardregs in common. */
int int
web_conflicts_p (web1, web2) web_conflicts_p (struct web *web1, struct web *web2)
struct web *web1;
struct web *web2;
{ {
if (web1->type == PRECOLORED && web2->type == PRECOLORED) if (web1->type == PRECOLORED && web2->type == PRECOLORED)
return 0; return 0;
...@@ -1020,8 +991,7 @@ web_conflicts_p (web1, web2) ...@@ -1020,8 +991,7 @@ web_conflicts_p (web1, web2)
/* Dump all uids of insns in which WEB is mentioned. */ /* Dump all uids of insns in which WEB is mentioned. */
void void
dump_web_insns (web) dump_web_insns (struct web *web)
struct web *web;
{ {
unsigned int i; unsigned int i;
...@@ -1047,8 +1017,7 @@ dump_web_insns (web) ...@@ -1047,8 +1017,7 @@ dump_web_insns (web)
/* Dump conflicts for web WEB. */ /* Dump conflicts for web WEB. */
void void
dump_web_conflicts (web) dump_web_conflicts (struct web *web)
struct web *web;
{ {
int num = 0; int num = 0;
unsigned int def2; unsigned int def2;
...@@ -1099,8 +1068,7 @@ dump_web_conflicts (web) ...@@ -1099,8 +1068,7 @@ dump_web_conflicts (web)
/* Output HARD_REG_SET to stderr. */ /* Output HARD_REG_SET to stderr. */
void void
debug_hard_reg_set (set) debug_hard_reg_set (HARD_REG_SET set)
HARD_REG_SET set;
{ {
int i; int i;
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i) for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
......
/* Graph coloring register allocator /* Graph coloring register allocator
Copyright (C) 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Michael Matz <matz@suse.de> Contributed by Michael Matz <matz@suse.de>
and Daniel Berlin <dan@cgsoftware.com>. and Daniel Berlin <dan@cgsoftware.com>.
...@@ -85,16 +85,16 @@ ...@@ -85,16 +85,16 @@
*/ */
static struct obstack ra_obstack; static struct obstack ra_obstack;
static void create_insn_info PARAMS ((struct df *)); static void create_insn_info (struct df *);
static void free_insn_info PARAMS ((void)); static void free_insn_info (void);
static void alloc_mem PARAMS ((struct df *)); static void alloc_mem (struct df *);
static void free_mem PARAMS ((struct df *)); static void free_mem (struct df *);
static void free_all_mem PARAMS ((struct df *df)); static void free_all_mem (struct df *df);
static int one_pass PARAMS ((struct df *, int)); static int one_pass (struct df *, int);
static void check_df PARAMS ((struct df *)); static void check_df (struct df *);
static void init_ra PARAMS ((void)); static void init_ra (void);
void reg_alloc PARAMS ((void)); void reg_alloc (void);
/* These global variables are "internal" to the register allocator. /* These global variables are "internal" to the register allocator.
They are all documented at their declarations in ra.h. */ They are all documented at their declarations in ra.h. */
...@@ -165,8 +165,7 @@ int flag_ra_dump_notes = 0; ...@@ -165,8 +165,7 @@ int flag_ra_dump_notes = 0;
is done. Allocate an object of SIZE bytes. */ is done. Allocate an object of SIZE bytes. */
void * void *
ra_alloc (size) ra_alloc (size_t size)
size_t size;
{ {
return obstack_alloc (&ra_obstack, size); return obstack_alloc (&ra_obstack, size);
} }
...@@ -174,8 +173,7 @@ ra_alloc (size) ...@@ -174,8 +173,7 @@ ra_alloc (size)
/* Like ra_alloc(), but clear the returned memory. */ /* Like ra_alloc(), but clear the returned memory. */
void * void *
ra_calloc (size) ra_calloc (size_t size)
size_t size;
{ {
void *p = obstack_alloc (&ra_obstack, size); void *p = obstack_alloc (&ra_obstack, size);
memset (p, 0, size); memset (p, 0, size);
...@@ -185,8 +183,7 @@ ra_calloc (size) ...@@ -185,8 +183,7 @@ ra_calloc (size)
/* Returns the number of hardregs in HARD_REG_SET RS. */ /* Returns the number of hardregs in HARD_REG_SET RS. */
int int
hard_regs_count (rs) hard_regs_count (HARD_REG_SET rs)
HARD_REG_SET rs;
{ {
int count = 0; int count = 0;
#ifdef HARD_REG_SET #ifdef HARD_REG_SET
...@@ -220,8 +217,7 @@ hard_regs_count (rs) ...@@ -220,8 +217,7 @@ hard_regs_count (rs)
be basically valid. */ be basically valid. */
rtx rtx
ra_emit_move_insn (x, y) ra_emit_move_insn (rtx x, rtx y)
rtx x, y;
{ {
enum machine_mode mode = GET_MODE (x); enum machine_mode mode = GET_MODE (x);
if (GET_MODE_CLASS (mode) == MODE_CC) if (GET_MODE_CLASS (mode) == MODE_CC)
...@@ -238,8 +234,7 @@ static struct ref **refs_for_insn_df; ...@@ -238,8 +234,7 @@ static struct ref **refs_for_insn_df;
all valid defs and uses in an insn. */ all valid defs and uses in an insn. */
static void static void
create_insn_info (df) create_insn_info (struct df *df)
struct df *df;
{ {
rtx insn; rtx insn;
struct ref **act_refs; struct ref **act_refs;
...@@ -288,7 +283,7 @@ create_insn_info (df) ...@@ -288,7 +283,7 @@ create_insn_info (df)
/* Free the insn_df structures. */ /* Free the insn_df structures. */
static void static void
free_insn_info () free_insn_info (void)
{ {
free (refs_for_insn_df); free (refs_for_insn_df);
refs_for_insn_df = NULL; refs_for_insn_df = NULL;
...@@ -302,9 +297,7 @@ free_insn_info () ...@@ -302,9 +297,7 @@ free_insn_info ()
represented by WEB. Returns the matching subweb or NULL. */ represented by WEB. Returns the matching subweb or NULL. */
struct web * struct web *
find_subweb (web, reg) find_subweb (struct web *web, rtx reg)
struct web *web;
rtx reg;
{ {
struct web *w; struct web *w;
if (GET_CODE (reg) != SUBREG) if (GET_CODE (reg) != SUBREG)
...@@ -320,9 +313,7 @@ find_subweb (web, reg) ...@@ -320,9 +313,7 @@ find_subweb (web, reg)
a collection of the needed size and offset (in bytes). */ a collection of the needed size and offset (in bytes). */
struct web * struct web *
find_subweb_2 (web, size_word) find_subweb_2 (struct web *web, unsigned int size_word)
struct web *web;
unsigned int size_word;
{ {
struct web *w = web; struct web *w = web;
if (size_word == GET_MODE_SIZE (GET_MODE (web->orig_x))) if (size_word == GET_MODE_SIZE (GET_MODE (web->orig_x)))
...@@ -340,8 +331,7 @@ find_subweb_2 (web, size_word) ...@@ -340,8 +331,7 @@ find_subweb_2 (web, size_word)
/* Returns the superweb for SUBWEB. */ /* Returns the superweb for SUBWEB. */
struct web * struct web *
find_web_for_subweb_1 (subweb) find_web_for_subweb_1 (struct web *subweb)
struct web *subweb;
{ {
while (subweb->parent_web) while (subweb->parent_web)
subweb = subweb->parent_web; subweb = subweb->parent_web;
...@@ -352,8 +342,7 @@ find_web_for_subweb_1 (subweb) ...@@ -352,8 +342,7 @@ find_web_for_subweb_1 (subweb)
Return 1 if they do. */ Return 1 if they do. */
int int
hard_regs_intersect_p (a, b) hard_regs_intersect_p (HARD_REG_SET *a, HARD_REG_SET *b)
HARD_REG_SET *a, *b;
{ {
HARD_REG_SET c; HARD_REG_SET c;
COPY_HARD_REG_SET (c, *a); COPY_HARD_REG_SET (c, *a);
...@@ -368,8 +357,7 @@ lose: ...@@ -368,8 +357,7 @@ lose:
register allocator. */ register allocator. */
static void static void
alloc_mem (df) alloc_mem (struct df *df)
struct df *df;
{ {
int i; int i;
ra_build_realloc (df); ra_build_realloc (df);
...@@ -386,8 +374,7 @@ alloc_mem (df) ...@@ -386,8 +374,7 @@ alloc_mem (df)
/* Free the memory which isn't necessary for the next pass. */ /* Free the memory which isn't necessary for the next pass. */
static void static void
free_mem (df) free_mem (struct df *df ATTRIBUTE_UNUSED)
struct df *df ATTRIBUTE_UNUSED;
{ {
free_insn_info (); free_insn_info ();
ra_build_free (); ra_build_free ();
...@@ -397,8 +384,7 @@ free_mem (df) ...@@ -397,8 +384,7 @@ free_mem (df)
it's done. */ it's done. */
static void static void
free_all_mem (df) free_all_mem (struct df *df)
struct df *df;
{ {
unsigned int i; unsigned int i;
live_at_end -= 2; live_at_end -= 2;
...@@ -418,9 +404,7 @@ static long ticks_rebuild; ...@@ -418,9 +404,7 @@ static long ticks_rebuild;
was added, i.e. if the allocator needs to rerun. */ was added, i.e. if the allocator needs to rerun. */
static int static int
one_pass (df, rebuild) one_pass (struct df *df, int rebuild)
struct df *df;
int rebuild;
{ {
long ticks = clock (); long ticks = clock ();
int something_spilled; int something_spilled;
...@@ -461,7 +445,7 @@ one_pass (df, rebuild) ...@@ -461,7 +445,7 @@ one_pass (df, rebuild)
/* Initialize various arrays for the register allocator. */ /* Initialize various arrays for the register allocator. */
static void static void
init_ra () init_ra (void)
{ {
int i; int i;
HARD_REG_SET rs; HARD_REG_SET rs;
...@@ -592,8 +576,7 @@ init_ra () ...@@ -592,8 +576,7 @@ init_ra ()
invariances we expect. */ invariances we expect. */
static void static void
check_df (df) check_df (struct df *df)
struct df *df;
{ {
struct df_link *link; struct df_link *link;
rtx insn; rtx insn;
...@@ -663,7 +646,7 @@ check_df (df) ...@@ -663,7 +646,7 @@ check_df (df)
/* Main register allocator entry point. */ /* Main register allocator entry point. */
void void
reg_alloc () reg_alloc (void)
{ {
int changed; int changed;
FILE *ra_dump_file = rtl_dump_file; FILE *ra_dump_file = rtl_dump_file;
......
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