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