Commit 1d088dee by Andreas Jaeger Committed by Andreas Jaeger

gcc.c: Convert prototypes to ISO C90.

	* gcc.c: Convert prototypes to ISO C90.
	* gcc.h: Likewise.
	* gcov-dump.c: Likewise.
	* gcov-iov.c: Likewise.
	* gcse.c: Likewise.
	* genattrtab.h: Likewise.
	* ggc.h: Likewise.
	* global.c: Likewise.
	* graph.c: Likewise.
	* graph.h: Likewise.
	* hosthooks.h: Likewise.
	* hooks.h: Likewise.
	* hooks.c: Likewise.
	* hashtable.h: Likewise.
	* hashtable.c: Likewise.
	* haifa-sched.c: Likewise.
	* integrate.h: Likewise.
	* integrate.c: Likewise.
	* input.h: Likewise.
	* ifcvt.c: Likewise.

From-SVN: r68995
parent 48166869
2003-07-06 Andreas Jaeger <aj@suse.de>
* gcc.c: Convert prototypes to ISO C90.
* gcc.h: Likewise.
* gcov-dump.c: Likewise.
* gcov-iov.c: Likewise.
* gcse.c: Likewise.
* genattrtab.h: Likewise.
* ggc.h: Likewise.
* global.c: Likewise.
* graph.c: Likewise.
* graph.h: Likewise.
* hosthooks.h: Likewise.
* hooks.h: Likewise.
* hooks.c: Likewise.
* hashtable.h: Likewise.
* hashtable.c: Likewise.
* haifa-sched.c: Likewise.
* integrate.h: Likewise.
* integrate.c: Likewise.
* input.h: Likewise.
* ifcvt.c: Likewise.
2003-07-05 Kazu Hirata <kazu@cs.umass.edu> 2003-07-05 Kazu Hirata <kazu@cs.umass.edu>
* combine.c (nonzero_bits1): Fix a warning. * combine.c (nonzero_bits1): Fix a warning.
......
...@@ -26,9 +26,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -26,9 +26,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* The mapping of a spec function name to the C function that /* The mapping of a spec function name to the C function that
implements it. */ implements it. */
struct spec_function struct spec_function
{ {
const char *name; const char *name;
const char *(*func) PARAMS ((int, const char **)); const char *(*func) (int, const char **);
}; };
/* This defines which switch letters take arguments. */ /* This defines which switch letters take arguments. */
...@@ -54,22 +54,21 @@ struct spec_function ...@@ -54,22 +54,21 @@ struct spec_function
/* These are exported by gcc.c. */ /* These are exported by gcc.c. */
extern int do_spec PARAMS ((const char *)); extern int do_spec (const char *);
extern void record_temp_file PARAMS ((const char *, int, int)); extern void record_temp_file (const char *, int, int);
extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN; extern void fancy_abort (void) ATTRIBUTE_NORETURN;
extern void fatal PARAMS ((const char *, ...)) extern void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; extern void error (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1; extern void pfatal_with_name (const char *) ATTRIBUTE_NORETURN;
extern void pfatal_with_name PARAMS ((const char *)) ATTRIBUTE_NORETURN; extern void set_input (const char *);
extern void set_input PARAMS ((const char *));
/* Spec files linked with gcc.c must provide definitions for these. */ /* Spec files linked with gcc.c must provide definitions for these. */
/* Called before processing to change/add/remove arguments. */ /* Called before processing to change/add/remove arguments. */
extern void lang_specific_driver PARAMS ((int *, const char *const **, int *)); extern void lang_specific_driver (int *, const char *const **, int *);
/* Called before linking. Returns 0 on success and -1 on failure. */ /* Called before linking. Returns 0 on success and -1 on failure. */
extern int lang_specific_pre_link PARAMS ((void)); extern int lang_specific_pre_link (void);
extern int n_infiles; extern int n_infiles;
......
/* Dump a gcov file, for debugging use. /* Dump a gcov file, for debugging use.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Nathan Sidwell <nathan@codesourcery.com> Contributed by Nathan Sidwell <nathan@codesourcery.com>
Gcov is free software; you can redistribute it and/or modify Gcov is free software; you can redistribute it and/or modify
...@@ -27,17 +27,17 @@ Boston, MA 02111-1307, USA. */ ...@@ -27,17 +27,17 @@ Boston, MA 02111-1307, USA. */
#include "gcov-io.h" #include "gcov-io.h"
#include "gcov-io.c" #include "gcov-io.c"
static void dump_file PARAMS ((const char *)); static void dump_file (const char *);
static void print_prefix PARAMS ((const char *, unsigned, gcov_position_t)); static void print_prefix (const char *, unsigned, gcov_position_t);
static void print_usage PARAMS ((void)); static void print_usage (void);
static void print_version PARAMS ((void)); static void print_version (void);
static void tag_function PARAMS ((const char *, unsigned, unsigned)); static void tag_function (const char *, unsigned, unsigned);
static void tag_blocks PARAMS ((const char *, unsigned, unsigned)); static void tag_blocks (const char *, unsigned, unsigned);
static void tag_arcs PARAMS ((const char *, unsigned, unsigned)); static void tag_arcs (const char *, unsigned, unsigned);
static void tag_lines PARAMS ((const char *, unsigned, unsigned)); static void tag_lines (const char *, unsigned, unsigned);
static void tag_counters PARAMS ((const char *, unsigned, unsigned)); static void tag_counters (const char *, unsigned, unsigned);
static void tag_summary PARAMS ((const char *, unsigned, unsigned)); static void tag_summary (const char *, unsigned, unsigned);
extern int main PARAMS ((int, char **)); extern int main (int, char **);
typedef struct tag_format typedef struct tag_format
{ {
...@@ -72,9 +72,8 @@ static const tag_format_t tag_table[] = ...@@ -72,9 +72,8 @@ static const tag_format_t tag_table[] =
{0, NULL, NULL} {0, NULL, NULL}
}; };
int main (argc, argv) int
int argc ATTRIBUTE_UNUSED; main (int argc ATTRIBUTE_UNUSED, char **argv)
char **argv;
{ {
int opt; int opt;
...@@ -98,14 +97,14 @@ int main (argc, argv) ...@@ -98,14 +97,14 @@ int main (argc, argv)
fprintf (stderr, "unknown flag `%c'\n", opt); fprintf (stderr, "unknown flag `%c'\n", opt);
} }
} }
while (argv[optind]) while (argv[optind])
dump_file (argv[optind++]); dump_file (argv[optind++]);
return 0; return 0;
} }
static void static void
print_usage () print_usage (void)
{ {
printf ("Usage: gcov-dump [OPTION] ... gcovfiles\n"); printf ("Usage: gcov-dump [OPTION] ... gcovfiles\n");
printf ("Print coverage file contents\n"); printf ("Print coverage file contents\n");
...@@ -116,7 +115,7 @@ print_usage () ...@@ -116,7 +115,7 @@ print_usage ()
} }
static void static void
print_version () print_version (void)
{ {
char v[4]; char v[4];
unsigned version = GCOV_VERSION; unsigned version = GCOV_VERSION;
...@@ -131,13 +130,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" ...@@ -131,13 +130,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
} }
static void static void
print_prefix (filename, depth, position) print_prefix (const char *filename, unsigned depth, gcov_position_t position)
const char *filename;
unsigned depth;
gcov_position_t position;
{ {
static const char prefix[] = " "; static const char prefix[] = " ";
printf ("%s:", filename); printf ("%s:", filename);
if (flag_dump_positions) if (flag_dump_positions)
printf ("%lu:", (unsigned long) position); printf ("%lu:", (unsigned long) position);
...@@ -145,18 +141,17 @@ print_prefix (filename, depth, position) ...@@ -145,18 +141,17 @@ print_prefix (filename, depth, position)
} }
static void static void
dump_file (filename) dump_file (const char *filename)
const char *filename;
{ {
unsigned tags[4]; unsigned tags[4];
unsigned depth = 0; unsigned depth = 0;
if (!gcov_open (filename, 1)) if (!gcov_open (filename, 1))
{ {
fprintf (stderr, "%s:cannot open\n", filename); fprintf (stderr, "%s:cannot open\n", filename);
return; return;
} }
/* magic */ /* magic */
{ {
unsigned magic = gcov_read_unsigned (); unsigned magic = gcov_read_unsigned ();
...@@ -166,7 +161,7 @@ dump_file (filename) ...@@ -166,7 +161,7 @@ dump_file (filename)
unsigned expected = GCOV_VERSION; unsigned expected = GCOV_VERSION;
unsigned ix; unsigned ix;
int different = version != GCOV_VERSION; int different = version != GCOV_VERSION;
if (magic == GCOV_DATA_MAGIC) if (magic == GCOV_DATA_MAGIC)
type = "data"; type = "data";
else if (magic == GCOV_GRAPH_MAGIC) else if (magic == GCOV_GRAPH_MAGIC)
...@@ -183,7 +178,7 @@ dump_file (filename) ...@@ -183,7 +178,7 @@ dump_file (filename)
v[ix] = version; v[ix] = version;
m[ix] = magic; m[ix] = magic;
} }
printf ("%s:%s:magic `%.4s':version `%.4s'\n", filename, type, m, v); printf ("%s:%s:magic `%.4s':version `%.4s'\n", filename, type, m, v);
if (different) if (different)
printf ("%s:warning:current version is `%.4s'\n", filename, e); printf ("%s:warning:current version is `%.4s'\n", filename, e);
...@@ -229,17 +224,17 @@ dump_file (filename) ...@@ -229,17 +224,17 @@ dump_file (filename)
depth = tag_depth; depth = tag_depth;
tags[depth - 1] = tag; tags[depth - 1] = tag;
} }
print_prefix (filename, tag_depth, position); print_prefix (filename, tag_depth, position);
printf ("%08x:%4u:%s", tag, length, format->name); printf ("%08x:%4u:%s", tag, length, format->name);
if (format->proc) if (format->proc)
(*format->proc) (filename, tag, length); (*format->proc) (filename, tag, length);
printf ("\n"); printf ("\n");
if (flag_dump_contents && format->proc) if (flag_dump_contents && format->proc)
{ {
unsigned long actual_length = gcov_position () - base; unsigned long actual_length = gcov_position () - base;
if (actual_length > length) if (actual_length > length)
printf ("%s:record size mismatch %lu bytes overread\n", printf ("%s:record size mismatch %lu bytes overread\n",
filename, actual_length - length); filename, actual_length - length);
...@@ -262,20 +257,18 @@ dump_file (filename) ...@@ -262,20 +257,18 @@ dump_file (filename)
} }
static void static void
tag_function (filename, tag, length) tag_function (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
unsigned long pos = gcov_position (); unsigned long pos = gcov_position ();
printf (" ident=%u", gcov_read_unsigned ()); printf (" ident=%u", gcov_read_unsigned ());
printf (", checksum=0x%08x", gcov_read_unsigned ()); printf (", checksum=0x%08x", gcov_read_unsigned ());
if (gcov_position () - pos < length) if (gcov_position () - pos < length)
{ {
const char *name; const char *name;
name = gcov_read_string (); name = gcov_read_string ();
printf (", `%s'", name ? name : "NULL"); printf (", `%s'", name ? name : "NULL");
name = gcov_read_string (); name = gcov_read_string ();
...@@ -285,13 +278,11 @@ tag_function (filename, tag, length) ...@@ -285,13 +278,11 @@ tag_function (filename, tag, length)
} }
static void static void
tag_blocks (filename, tag, length) tag_blocks (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
unsigned n_blocks = length / 4; unsigned n_blocks = length / 4;
printf (" %u blocks", n_blocks); printf (" %u blocks", n_blocks);
if (flag_dump_contents) if (flag_dump_contents)
...@@ -312,10 +303,8 @@ tag_blocks (filename, tag, length) ...@@ -312,10 +303,8 @@ tag_blocks (filename, tag, length)
} }
static void static void
tag_arcs (filename, tag, length) tag_arcs (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
unsigned n_arcs = (length - 4) / 8; unsigned n_arcs = (length - 4) / 8;
...@@ -328,7 +317,7 @@ tag_arcs (filename, tag, length) ...@@ -328,7 +317,7 @@ tag_arcs (filename, tag, length)
for (ix = 0; ix != n_arcs; ix++) for (ix = 0; ix != n_arcs; ix++)
{ {
unsigned dst, flags; unsigned dst, flags;
if (!(ix & 3)) if (!(ix & 3))
{ {
printf ("\n"); printf ("\n");
...@@ -343,10 +332,8 @@ tag_arcs (filename, tag, length) ...@@ -343,10 +332,8 @@ tag_arcs (filename, tag, length)
} }
static void static void
tag_lines (filename, tag, length) tag_lines (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
if (flag_dump_contents) if (flag_dump_contents)
{ {
...@@ -358,7 +345,7 @@ tag_lines (filename, tag, length) ...@@ -358,7 +345,7 @@ tag_lines (filename, tag, length)
gcov_position_t position = gcov_position (); gcov_position_t position = gcov_position ();
const char *source = NULL; const char *source = NULL;
unsigned lineno = gcov_read_unsigned (); unsigned lineno = gcov_read_unsigned ();
if (!lineno) if (!lineno)
{ {
source = gcov_read_string (); source = gcov_read_string ();
...@@ -366,7 +353,7 @@ tag_lines (filename, tag, length) ...@@ -366,7 +353,7 @@ tag_lines (filename, tag, length)
break; break;
sep = NULL; sep = NULL;
} }
if (!sep) if (!sep)
{ {
printf ("\n"); printf ("\n");
...@@ -389,14 +376,12 @@ tag_lines (filename, tag, length) ...@@ -389,14 +376,12 @@ tag_lines (filename, tag, length)
} }
static void static void
tag_counters (filename, tag, length) tag_counters (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
static const char *const counter_names[] = GCOV_COUNTER_NAMES; static const char *const counter_names[] = GCOV_COUNTER_NAMES;
unsigned n_counts = length / 8; unsigned n_counts = length / 8;
printf (" %s %u counts", printf (" %s %u counts",
counter_names[GCOV_COUNTER_FOR_TAG (tag)], n_counts); counter_names[GCOV_COUNTER_FOR_TAG (tag)], n_counts);
if (flag_dump_contents) if (flag_dump_contents)
...@@ -406,14 +391,14 @@ tag_counters (filename, tag, length) ...@@ -406,14 +391,14 @@ tag_counters (filename, tag, length)
for (ix = 0; ix != n_counts; ix++) for (ix = 0; ix != n_counts; ix++)
{ {
gcov_type count; gcov_type count;
if (!(ix & 7)) if (!(ix & 7))
{ {
printf ("\n"); printf ("\n");
print_prefix (filename, 0, gcov_position ()); print_prefix (filename, 0, gcov_position ());
printf ("\t\t%u", ix); printf ("\t\t%u", ix);
} }
count = gcov_read_counter (); count = gcov_read_counter ();
printf (" "); printf (" ");
printf (HOST_WIDEST_INT_PRINT_DEC, count); printf (HOST_WIDEST_INT_PRINT_DEC, count);
...@@ -422,24 +407,22 @@ tag_counters (filename, tag, length) ...@@ -422,24 +407,22 @@ tag_counters (filename, tag, length)
} }
static void static void
tag_summary (filename, tag, length) tag_summary (const char *filename ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED; unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED)
unsigned tag ATTRIBUTE_UNUSED;
unsigned length ATTRIBUTE_UNUSED;
{ {
struct gcov_summary summary; struct gcov_summary summary;
unsigned ix; unsigned ix;
gcov_read_summary (&summary); gcov_read_summary (&summary);
printf (" checksum=0x%08x", summary.checksum); printf (" checksum=0x%08x", summary.checksum);
for (ix = 0; ix != GCOV_COUNTERS; ix++) for (ix = 0; ix != GCOV_COUNTERS; ix++)
{ {
printf ("\n"); printf ("\n");
print_prefix (filename, 0, 0); print_prefix (filename, 0, 0);
printf ("\t\tcounts=%u, runs=%u", printf ("\t\tcounts=%u, runs=%u",
summary.ctrs[ix].num, summary.ctrs[ix].runs); summary.ctrs[ix].num, summary.ctrs[ix].runs);
printf (", sum_all=" HOST_WIDEST_INT_PRINT_DEC, printf (", sum_all=" HOST_WIDEST_INT_PRINT_DEC,
(HOST_WIDEST_INT)summary.ctrs[ix].sum_all); (HOST_WIDEST_INT)summary.ctrs[ix].sum_all);
printf (", run_max=" HOST_WIDEST_INT_PRINT_DEC, printf (", run_max=" HOST_WIDEST_INT_PRINT_DEC,
......
/* Generate gcov version string from version.c. See gcov-io.h for /* Generate gcov version string from version.c. See gcov-io.h for
description of how the version string is generated. description of how the version string is generated.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Nathan Sidwell <nathan@codesourcery.com> Contributed by Nathan Sidwell <nathan@codesourcery.com>
This file is part of GCC. This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under GCC is free software; you can redistribute it and/or modify it under
...@@ -26,12 +26,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -26,12 +26,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm.h" #include "tm.h"
#include "version.c" /* We want the actual string. */ #include "version.c" /* We want the actual string. */
int main PARAMS ((int, char **)); int main (int, char **);
int int
main (argc, argv) main (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
int argc ATTRIBUTE_UNUSED;
char **argv;
{ {
unsigned version = 0; unsigned version = 0;
unsigned char v[4]; unsigned char v[4];
...@@ -56,7 +54,7 @@ main (argc, argv) ...@@ -56,7 +54,7 @@ main (argc, argv)
v[1] = (minor / 10) + '0'; v[1] = (minor / 10) + '0';
v[2] = (minor % 10) + '0'; v[2] = (minor % 10) + '0';
v[3] = s ? s : '*'; v[3] = s ? s : '*';
for (ix = 0; ix != 4; ix++) for (ix = 0; ix != 4; ix++)
version = (version << 8) | v[ix]; version = (version << 8) | v[ix];
...@@ -65,6 +63,6 @@ main (argc, argv) ...@@ -65,6 +63,6 @@ main (argc, argv)
printf ("\n"); printf ("\n");
printf ("#define GCOV_VERSION ((unsigned)%#08x) /* %.4s */\n", printf ("#define GCOV_VERSION ((unsigned)%#08x) /* %.4s */\n",
version, v); version, v);
return 0; return 0;
} }
...@@ -219,8 +219,7 @@ extern void ggc_splay_dont_free (void *, void *); ...@@ -219,8 +219,7 @@ extern void ggc_splay_dont_free (void *, void *);
/* Allocate a gc-able string, and fill it with LENGTH bytes from CONTENTS. /* Allocate a gc-able string, and fill it with LENGTH bytes from CONTENTS.
If LENGTH is -1, then CONTENTS is assumed to be a If LENGTH is -1, then CONTENTS is assumed to be a
null-terminated string and the memory sized accordingly. */ null-terminated string and the memory sized accordingly. */
extern const char *ggc_alloc_string PARAMS ((const char *contents, extern const char *ggc_alloc_string (const char *contents, int length);
int length));
/* Make a copy of S, in GC-able memory. */ /* Make a copy of S, in GC-able memory. */
#define ggc_strdup(S) ggc_alloc_string((S), -1) #define ggc_strdup(S) ggc_alloc_string((S), -1)
......
/* Allocate registers for pseudo-registers that span basic blocks. /* Allocate registers for pseudo-registers that span basic blocks.
Copyright (C) 1987, 1988, 1991, 1994, 1996, 1997, 1998, Copyright (C) 1987, 1988, 1991, 1994, 1996, 1997, 1998,
1999, 2000, 2002 Free Software Foundation, Inc. 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -289,24 +289,23 @@ static int n_regs_set; ...@@ -289,24 +289,23 @@ static int n_regs_set;
static HARD_REG_SET eliminable_regset; static HARD_REG_SET eliminable_regset;
static int allocno_compare PARAMS ((const void *, const void *)); static int allocno_compare (const void *, const void *);
static void global_conflicts PARAMS ((void)); static void global_conflicts (void);
static void mirror_conflicts PARAMS ((void)); static void mirror_conflicts (void);
static void expand_preferences PARAMS ((void)); static void expand_preferences (void);
static void prune_preferences PARAMS ((void)); static void prune_preferences (void);
static void find_reg PARAMS ((int, HARD_REG_SET, int, int, int)); static void find_reg (int, HARD_REG_SET, int, int, int);
static void record_one_conflict PARAMS ((int)); static void record_one_conflict (int);
static void record_conflicts PARAMS ((int *, int)); static void record_conflicts (int *, int);
static void mark_reg_store PARAMS ((rtx, rtx, void *)); static void mark_reg_store (rtx, rtx, void *);
static void mark_reg_clobber PARAMS ((rtx, rtx, void *)); static void mark_reg_clobber (rtx, rtx, void *);
static void mark_reg_conflicts PARAMS ((rtx)); static void mark_reg_conflicts (rtx);
static void mark_reg_death PARAMS ((rtx)); static void mark_reg_death (rtx);
static void mark_reg_live_nc PARAMS ((int, enum machine_mode)); static void mark_reg_live_nc (int, enum machine_mode);
static void set_preference PARAMS ((rtx, rtx)); static void set_preference (rtx, rtx);
static void dump_conflicts PARAMS ((FILE *)); static void dump_conflicts (FILE *);
static void reg_becomes_live PARAMS ((rtx, rtx, void *)); static void reg_becomes_live (rtx, rtx, void *);
static void reg_dies PARAMS ((int, enum machine_mode, static void reg_dies (int, enum machine_mode, struct insn_chain *);
struct insn_chain *));
/* Perform allocation of pseudo-registers not allocated by local_alloc. /* Perform allocation of pseudo-registers not allocated by local_alloc.
FILE is a file to output debugging information on, FILE is a file to output debugging information on,
...@@ -316,8 +315,7 @@ static void reg_dies PARAMS ((int, enum machine_mode, ...@@ -316,8 +315,7 @@ static void reg_dies PARAMS ((int, enum machine_mode,
and we must not do any more for this function. */ and we must not do any more for this function. */
int int
global_alloc (file) global_alloc (FILE *file)
FILE *file;
{ {
int retval; int retval;
#ifdef ELIMINABLE_REGS #ifdef ELIMINABLE_REGS
...@@ -599,9 +597,7 @@ global_alloc (file) ...@@ -599,9 +597,7 @@ global_alloc (file)
Returns -1 (1) if *v1 should be allocated before (after) *v2. */ Returns -1 (1) if *v1 should be allocated before (after) *v2. */
static int static int
allocno_compare (v1p, v2p) allocno_compare (const void *v1p, const void *v2p)
const void *v1p;
const void *v2p;
{ {
int v1 = *(const int *)v1p, v2 = *(const int *)v2p; int v1 = *(const int *)v1p, v2 = *(const int *)v2p;
/* Note that the quotient will never be bigger than /* Note that the quotient will never be bigger than
...@@ -629,7 +625,7 @@ allocno_compare (v1p, v2p) ...@@ -629,7 +625,7 @@ allocno_compare (v1p, v2p)
conflict matrices and preference tables. */ conflict matrices and preference tables. */
static void static void
global_conflicts () global_conflicts (void)
{ {
int i; int i;
basic_block b; basic_block b;
...@@ -703,11 +699,11 @@ global_conflicts () ...@@ -703,11 +699,11 @@ global_conflicts ()
scan the instruction that makes either X or Y become live. */ scan the instruction that makes either X or Y become live. */
record_conflicts (block_start_allocnos, ax); record_conflicts (block_start_allocnos, ax);
/* Pseudos can't go in stack regs at the start of a basic block that /* Pseudos can't go in stack regs at the start of a basic block that
is reached by an abnormal edge. Likewise for call clobbered regs, is reached by an abnormal edge. Likewise for call clobbered regs,
because because caller-save, fixup_abnormal_edges, and possibly because because caller-save, fixup_abnormal_edges, and possibly
the table driven EH machinery are not quite ready to handle such the table driven EH machinery are not quite ready to handle such
regs live across such edges. */ regs live across such edges. */
{ {
edge e; edge e;
...@@ -852,7 +848,7 @@ global_conflicts () ...@@ -852,7 +848,7 @@ global_conflicts ()
merge any preferences between those allocnos. */ merge any preferences between those allocnos. */
static void static void
expand_preferences () expand_preferences (void)
{ {
rtx insn; rtx insn;
rtx link; rtx link;
...@@ -903,7 +899,7 @@ expand_preferences () ...@@ -903,7 +899,7 @@ expand_preferences ()
we will avoid using these registers. */ we will avoid using these registers. */
static void static void
prune_preferences () prune_preferences (void)
{ {
int i; int i;
int num; int num;
...@@ -991,12 +987,7 @@ prune_preferences () ...@@ -991,12 +987,7 @@ prune_preferences ()
If not, do nothing. */ If not, do nothing. */
static void static void
find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying) find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbered, int retrying)
int num;
HARD_REG_SET losers;
int alt_regs_p;
int accept_call_clobbered;
int retrying;
{ {
int i, best_reg, pass; int i, best_reg, pass;
HARD_REG_SET used, used1, used2; HARD_REG_SET used, used1, used2;
...@@ -1110,7 +1101,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying) ...@@ -1110,7 +1101,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
(j < lim (j < lim
&& ! TEST_HARD_REG_BIT (used, j) && ! TEST_HARD_REG_BIT (used, j)
&& (REGNO_REG_CLASS (j) && (REGNO_REG_CLASS (j)
== REGNO_REG_CLASS (best_reg + (j - i)) == REGNO_REG_CLASS (best_reg + (j - i))
|| reg_class_subset_p (REGNO_REG_CLASS (j), || reg_class_subset_p (REGNO_REG_CLASS (j),
REGNO_REG_CLASS (best_reg + (j - i))) REGNO_REG_CLASS (best_reg + (j - i)))
|| reg_class_subset_p (REGNO_REG_CLASS (best_reg + (j - i)), || reg_class_subset_p (REGNO_REG_CLASS (best_reg + (j - i)),
...@@ -1149,7 +1140,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying) ...@@ -1149,7 +1140,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
(j < lim (j < lim
&& ! TEST_HARD_REG_BIT (used, j) && ! TEST_HARD_REG_BIT (used, j)
&& (REGNO_REG_CLASS (j) && (REGNO_REG_CLASS (j)
== REGNO_REG_CLASS (best_reg + (j - i)) == REGNO_REG_CLASS (best_reg + (j - i))
|| reg_class_subset_p (REGNO_REG_CLASS (j), || reg_class_subset_p (REGNO_REG_CLASS (j),
REGNO_REG_CLASS (best_reg + (j - i))) REGNO_REG_CLASS (best_reg + (j - i)))
|| reg_class_subset_p (REGNO_REG_CLASS (best_reg + (j - i)), || reg_class_subset_p (REGNO_REG_CLASS (best_reg + (j - i)),
...@@ -1311,9 +1302,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying) ...@@ -1311,9 +1302,7 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
If FORBIDDEN_REGS is zero, no regs are forbidden. */ If FORBIDDEN_REGS is zero, no regs are forbidden. */
void void
retry_global_alloc (regno, forbidden_regs) retry_global_alloc (int regno, HARD_REG_SET forbidden_regs)
int regno;
HARD_REG_SET forbidden_regs;
{ {
int alloc_no = reg_allocno[regno]; int alloc_no = reg_allocno[regno];
if (alloc_no >= 0) if (alloc_no >= 0)
...@@ -1344,8 +1333,7 @@ retry_global_alloc (regno, forbidden_regs) ...@@ -1344,8 +1333,7 @@ retry_global_alloc (regno, forbidden_regs)
reg_renumber before calling here. */ reg_renumber before calling here. */
static void static void
record_one_conflict (regno) record_one_conflict (int regno)
int regno;
{ {
int j; int j;
...@@ -1388,9 +1376,7 @@ record_one_conflict (regno) ...@@ -1388,9 +1376,7 @@ record_one_conflict (regno)
are currently live. Their bits are also flagged in allocnos_live. */ are currently live. Their bits are also flagged in allocnos_live. */
static void static void
record_conflicts (allocno_vec, len) record_conflicts (int *allocno_vec, int len)
int *allocno_vec;
int len;
{ {
while (--len >= 0) while (--len >= 0)
IOR_HARD_REG_SET (allocno[allocno_vec[len]].hard_reg_conflicts, IOR_HARD_REG_SET (allocno[allocno_vec[len]].hard_reg_conflicts,
...@@ -1399,7 +1385,7 @@ record_conflicts (allocno_vec, len) ...@@ -1399,7 +1385,7 @@ record_conflicts (allocno_vec, len)
/* If CONFLICTP (i, j) is true, make sure CONFLICTP (j, i) is also true. */ /* If CONFLICTP (i, j) is true, make sure CONFLICTP (j, i) is also true. */
static void static void
mirror_conflicts () mirror_conflicts (void)
{ {
int i, j; int i, j;
int rw = allocno_row_words; int rw = allocno_row_words;
...@@ -1447,9 +1433,7 @@ mirror_conflicts () ...@@ -1447,9 +1433,7 @@ mirror_conflicts ()
a REG_INC note was found for it). */ a REG_INC note was found for it). */
static void static void
mark_reg_store (reg, setter, data) mark_reg_store (rtx reg, rtx setter, void *data ATTRIBUTE_UNUSED)
rtx reg, setter;
void *data ATTRIBUTE_UNUSED;
{ {
int regno; int regno;
...@@ -1496,9 +1480,7 @@ mark_reg_store (reg, setter, data) ...@@ -1496,9 +1480,7 @@ mark_reg_store (reg, setter, data)
/* Like mark_reg_set except notice just CLOBBERs; ignore SETs. */ /* Like mark_reg_set except notice just CLOBBERs; ignore SETs. */
static void static void
mark_reg_clobber (reg, setter, data) mark_reg_clobber (rtx reg, rtx setter, void *data ATTRIBUTE_UNUSED)
rtx reg, setter;
void *data ATTRIBUTE_UNUSED;
{ {
if (GET_CODE (setter) == CLOBBER) if (GET_CODE (setter) == CLOBBER)
mark_reg_store (reg, setter, data); mark_reg_store (reg, setter, data);
...@@ -1508,8 +1490,7 @@ mark_reg_clobber (reg, setter, data) ...@@ -1508,8 +1490,7 @@ mark_reg_clobber (reg, setter, data)
Do not mark REG itself as live. */ Do not mark REG itself as live. */
static void static void
mark_reg_conflicts (reg) mark_reg_conflicts (rtx reg)
rtx reg;
{ {
int regno; int regno;
...@@ -1548,8 +1529,7 @@ mark_reg_conflicts (reg) ...@@ -1548,8 +1529,7 @@ mark_reg_conflicts (reg)
Store a 0 in regs_live or allocnos_live for this register. */ Store a 0 in regs_live or allocnos_live for this register. */
static void static void
mark_reg_death (reg) mark_reg_death (rtx reg)
rtx reg;
{ {
int regno = REGNO (reg); int regno = REGNO (reg);
...@@ -1585,9 +1565,7 @@ mark_reg_death (reg) ...@@ -1585,9 +1565,7 @@ mark_reg_death (reg)
it is assumed that the caller will do that. */ it is assumed that the caller will do that. */
static void static void
mark_reg_live_nc (regno, mode) mark_reg_live_nc (int regno, enum machine_mode mode)
int regno;
enum machine_mode mode;
{ {
int last = regno + HARD_REGNO_NREGS (regno, mode); int last = regno + HARD_REGNO_NREGS (regno, mode);
while (regno < last) while (regno < last)
...@@ -1607,8 +1585,7 @@ mark_reg_live_nc (regno, mode) ...@@ -1607,8 +1585,7 @@ mark_reg_live_nc (regno, mode)
pseudo-register to a hard register. */ pseudo-register to a hard register. */
static void static void
set_preference (dest, src) set_preference (rtx dest, rtx src)
rtx dest, src;
{ {
unsigned int src_regno, dest_regno; unsigned int src_regno, dest_regno;
/* Amount to add to the hard regno for SRC, or subtract from that for DEST, /* Amount to add to the hard regno for SRC, or subtract from that for DEST,
...@@ -1715,8 +1692,7 @@ set_preference (dest, src) ...@@ -1715,8 +1692,7 @@ set_preference (dest, src)
a use of TO. */ a use of TO. */
void void
mark_elimination (from, to) mark_elimination (int from, int to)
int from, to;
{ {
basic_block bb; basic_block bb;
...@@ -1738,10 +1714,7 @@ static regset live_relevant_regs; ...@@ -1738,10 +1714,7 @@ static regset live_relevant_regs;
/* Record in live_relevant_regs and REGS_SET that register REG became live. /* Record in live_relevant_regs and REGS_SET that register REG became live.
This is called via note_stores. */ This is called via note_stores. */
static void static void
reg_becomes_live (reg, setter, regs_set) reg_becomes_live (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *regs_set)
rtx reg;
rtx setter ATTRIBUTE_UNUSED;
void *regs_set;
{ {
int regno; int regno;
...@@ -1772,10 +1745,7 @@ reg_becomes_live (reg, setter, regs_set) ...@@ -1772,10 +1745,7 @@ reg_becomes_live (reg, setter, regs_set)
/* Record in live_relevant_regs that register REGNO died. */ /* Record in live_relevant_regs that register REGNO died. */
static void static void
reg_dies (regno, mode, chain) reg_dies (int regno, enum machine_mode mode, struct insn_chain *chain)
int regno;
enum machine_mode mode;
struct insn_chain *chain;
{ {
if (regno < FIRST_PSEUDO_REGISTER) if (regno < FIRST_PSEUDO_REGISTER)
{ {
...@@ -1799,8 +1769,7 @@ reg_dies (regno, mode, chain) ...@@ -1799,8 +1769,7 @@ reg_dies (regno, mode, chain)
/* Walk the insns of the current function and build reload_insn_chain, /* Walk the insns of the current function and build reload_insn_chain,
and record register life information. */ and record register life information. */
void void
build_insn_chain (first) build_insn_chain (rtx first)
rtx first;
{ {
struct insn_chain **p = &reload_insn_chain; struct insn_chain **p = &reload_insn_chain;
struct insn_chain *prev = 0; struct insn_chain *prev = 0;
...@@ -1905,8 +1874,7 @@ build_insn_chain (first) ...@@ -1905,8 +1874,7 @@ build_insn_chain (first)
showing the information on which the allocation decisions are based. */ showing the information on which the allocation decisions are based. */
static void static void
dump_conflicts (file) dump_conflicts (FILE *file)
FILE *file;
{ {
int i; int i;
int has_preferences; int has_preferences;
...@@ -1963,8 +1931,7 @@ dump_conflicts (file) ...@@ -1963,8 +1931,7 @@ dump_conflicts (file)
} }
void void
dump_global_regs (file) dump_global_regs (FILE *file)
FILE *file;
{ {
int i, j; int i, j;
......
/* Output routines for graphical representation. /* Output routines for graphical representation.
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
This file is part of GCC. This file is part of GCC.
...@@ -39,17 +39,16 @@ static const char *const graph_ext[] = ...@@ -39,17 +39,16 @@ static const char *const graph_ext[] =
/* vcg */ ".vcg", /* vcg */ ".vcg",
}; };
static void start_fct PARAMS ((FILE *)); static void start_fct (FILE *);
static void start_bb PARAMS ((FILE *, int)); static void start_bb (FILE *, int);
static void node_data PARAMS ((FILE *, rtx)); static void node_data (FILE *, rtx);
static void draw_edge PARAMS ((FILE *, int, int, int, int)); static void draw_edge (FILE *, int, int, int, int);
static void end_fct PARAMS ((FILE *)); static void end_fct (FILE *);
static void end_bb PARAMS ((FILE *)); static void end_bb (FILE *);
/* Output text for new basic block. */ /* Output text for new basic block. */
static void static void
start_fct (fp) start_fct (FILE *fp)
FILE *fp;
{ {
switch (graph_dump_format) switch (graph_dump_format)
{ {
...@@ -64,9 +63,7 @@ graph: { title: \"%s\"\nfolding: 1\nhidden: 2\nnode: { title: \"%s.0\" }\n", ...@@ -64,9 +63,7 @@ graph: { title: \"%s\"\nfolding: 1\nhidden: 2\nnode: { title: \"%s.0\" }\n",
} }
static void static void
start_bb (fp, bb) start_bb (FILE *fp, int bb)
FILE *fp;
int bb;
{ {
switch (graph_dump_format) switch (graph_dump_format)
{ {
...@@ -105,9 +102,7 @@ label: \"basic block %d", ...@@ -105,9 +102,7 @@ label: \"basic block %d",
} }
static void static void
node_data (fp, tmp_rtx) node_data (FILE *fp, rtx tmp_rtx)
FILE *fp;
rtx tmp_rtx;
{ {
if (PREV_INSN (tmp_rtx) == 0) if (PREV_INSN (tmp_rtx) == 0)
{ {
...@@ -168,12 +163,7 @@ darkgrey\n shape: ellipse" : "white", ...@@ -168,12 +163,7 @@ darkgrey\n shape: ellipse" : "white",
} }
static void static void
draw_edge (fp, from, to, bb_edge, class) draw_edge (FILE *fp, int from, int to, int bb_edge, int class)
FILE *fp;
int from;
int to;
int bb_edge;
int class;
{ {
const char * color; const char * color;
switch (graph_dump_format) switch (graph_dump_format)
...@@ -200,8 +190,7 @@ draw_edge (fp, from, to, bb_edge, class) ...@@ -200,8 +190,7 @@ draw_edge (fp, from, to, bb_edge, class)
} }
static void static void
end_bb (fp) end_bb (FILE *fp)
FILE *fp;
{ {
switch (graph_dump_format) switch (graph_dump_format)
{ {
...@@ -214,8 +203,7 @@ end_bb (fp) ...@@ -214,8 +203,7 @@ end_bb (fp)
} }
static void static void
end_fct (fp) end_fct (FILE *fp)
FILE *fp;
{ {
switch (graph_dump_format) switch (graph_dump_format)
{ {
...@@ -231,10 +219,7 @@ end_fct (fp) ...@@ -231,10 +219,7 @@ end_fct (fp)
/* Like print_rtl, but also print out live information for the start of each /* Like print_rtl, but also print out live information for the start of each
basic block. */ basic block. */
void void
print_rtl_graph_with_bb (base, suffix, rtx_first) print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
const char *base;
const char *suffix;
rtx rtx_first;
{ {
rtx tmp_rtx; rtx tmp_rtx;
size_t namelen = strlen (base); size_t namelen = strlen (base);
...@@ -400,9 +385,7 @@ print_rtl_graph_with_bb (base, suffix, rtx_first) ...@@ -400,9 +385,7 @@ print_rtl_graph_with_bb (base, suffix, rtx_first)
/* Similar as clean_dump_file, but this time for graph output files. */ /* Similar as clean_dump_file, but this time for graph output files. */
void void
clean_graph_dump_file (base, suffix) clean_graph_dump_file (const char *base, const char *suffix)
const char *base;
const char *suffix;
{ {
size_t namelen = strlen (base); size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix); size_t suffixlen = strlen (suffix);
...@@ -434,9 +417,7 @@ clean_graph_dump_file (base, suffix) ...@@ -434,9 +417,7 @@ clean_graph_dump_file (base, suffix)
/* Do final work on the graph output file. */ /* Do final work on the graph output file. */
void void
finish_graph_dump_file (base, suffix) finish_graph_dump_file (const char *base, const char *suffix)
const char *base;
const char *suffix;
{ {
size_t namelen = strlen (base); size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix); size_t suffixlen = strlen (suffix);
......
/* Header file for graph routines. /* Header file for graph routines.
Copyright (C) 1999 Free Software Foundation, Inc. Copyright (C) 1999, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -21,8 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -21,8 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_GRAPH_H #ifndef GCC_GRAPH_H
#define GCC_GRAPH_H #define GCC_GRAPH_H
extern void print_rtl_graph_with_bb PARAMS ((const char *, const char *, rtx)); extern void print_rtl_graph_with_bb (const char *, const char *, rtx);
extern void clean_graph_dump_file PARAMS ((const char *, const char *)); extern void clean_graph_dump_file (const char *, const char *);
extern void finish_graph_dump_file PARAMS ((const char *, const char *)); extern void finish_graph_dump_file (const char *, const char *);
#endif /* ! GCC_GRAPH_H */ #endif /* ! GCC_GRAPH_H */
/* Hash tables. /* Hash tables.
Copyright (C) 2000, 2001 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the under the terms of the GNU General Public License as published by the
...@@ -32,15 +32,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -32,15 +32,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
existing entry with a potential new one. Also, the ability to existing entry with a potential new one. Also, the ability to
delete members from the table has been removed. */ delete members from the table has been removed. */
static unsigned int calc_hash PARAMS ((const unsigned char *, unsigned int)); static unsigned int calc_hash (const unsigned char *, unsigned int);
static void ht_expand PARAMS ((hash_table *)); static void ht_expand (hash_table *);
/* Calculate the hash of the string STR of length LEN. */ /* Calculate the hash of the string STR of length LEN. */
static unsigned int static unsigned int
calc_hash (str, len) calc_hash (const unsigned char *str, unsigned int len)
const unsigned char *str;
unsigned int len;
{ {
unsigned int n = len; unsigned int n = len;
unsigned int r = 0; unsigned int r = 0;
...@@ -56,8 +54,7 @@ calc_hash (str, len) ...@@ -56,8 +54,7 @@ calc_hash (str, len)
/* Initialize an identifier hashtable. */ /* Initialize an identifier hashtable. */
hash_table * hash_table *
ht_create (order) ht_create (unsigned int order)
unsigned int order;
{ {
unsigned int nslots = 1 << order; unsigned int nslots = 1 << order;
hash_table *table; hash_table *table;
...@@ -77,8 +74,7 @@ ht_create (order) ...@@ -77,8 +74,7 @@ ht_create (order)
/* Frees all memory associated with a hash table. */ /* Frees all memory associated with a hash table. */
void void
ht_destroy (table) ht_destroy (hash_table *table)
hash_table *table;
{ {
obstack_free (&table->stack, NULL); obstack_free (&table->stack, NULL);
free (table->entries); free (table->entries);
...@@ -94,11 +90,8 @@ ht_destroy (table) ...@@ -94,11 +90,8 @@ ht_destroy (table)
CPP_ALLOCED and the item is assumed to be at the top of the CPP_ALLOCED and the item is assumed to be at the top of the
obstack. */ obstack. */
hashnode hashnode
ht_lookup (table, str, len, insert) ht_lookup (hash_table *table, const unsigned char *str, unsigned int len,
hash_table *table; enum ht_lookup_option insert)
const unsigned char *str;
unsigned int len;
enum ht_lookup_option insert;
{ {
unsigned int hash = calc_hash (str, len); unsigned int hash = calc_hash (str, len);
unsigned int hash2; unsigned int hash2;
...@@ -158,8 +151,7 @@ ht_lookup (table, str, len, insert) ...@@ -158,8 +151,7 @@ ht_lookup (table, str, len, insert)
/* Double the size of a hash table, re-hashing existing entries. */ /* Double the size of a hash table, re-hashing existing entries. */
static void static void
ht_expand (table) ht_expand (hash_table *table)
hash_table *table;
{ {
hashnode *nentries, *p, *limit; hashnode *nentries, *p, *limit;
unsigned int size, sizemask; unsigned int size, sizemask;
...@@ -200,10 +192,7 @@ ht_expand (table) ...@@ -200,10 +192,7 @@ ht_expand (table)
/* For all nodes in TABLE, callback CB with parameters TABLE->PFILE, /* For all nodes in TABLE, callback CB with parameters TABLE->PFILE,
the node, and V. */ the node, and V. */
void void
ht_forall (table, cb, v) ht_forall (hash_table *table, ht_cb cb, const void *v)
hash_table *table;
ht_cb cb;
const void *v;
{ {
hashnode *p, *limit; hashnode *p, *limit;
...@@ -221,8 +210,7 @@ ht_forall (table, cb, v) ...@@ -221,8 +210,7 @@ ht_forall (table, cb, v)
/* Dump allocation statistics to stderr. */ /* Dump allocation statistics to stderr. */
void void
ht_dump_statistics (table) ht_dump_statistics (hash_table *table)
hash_table *table;
{ {
size_t nelts, nids, overhead, headers; size_t nelts, nids, overhead, headers;
size_t total_bytes, longest, sum_of_squares; size_t total_bytes, longest, sum_of_squares;
...@@ -251,7 +239,7 @@ ht_dump_statistics (table) ...@@ -251,7 +239,7 @@ ht_dump_statistics (table)
nids++; nids++;
} }
while (++p < limit); while (++p < limit);
nelts = table->nelements; nelts = table->nelements;
overhead = obstack_memory_used (&table->stack) - total_bytes; overhead = obstack_memory_used (&table->stack) - total_bytes;
headers = table->nslots * sizeof (hashnode); headers = table->nslots * sizeof (hashnode);
...@@ -287,8 +275,7 @@ ht_dump_statistics (table) ...@@ -287,8 +275,7 @@ ht_dump_statistics (table)
/* Return the approximate positive square root of a number N. This is for /* Return the approximate positive square root of a number N. This is for
statistical reports, not code generation. */ statistical reports, not code generation. */
double double
approx_sqrt (x) approx_sqrt (double x)
double x;
{ {
double s, d; double s, d;
......
/* Hash tables. /* Hash tables.
Copyright (C) 2000, 2001 Free Software Foundation, Inc. Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the under the terms of the GNU General Public License as published by the
...@@ -46,7 +46,7 @@ struct ht ...@@ -46,7 +46,7 @@ struct ht
hashnode *entries; hashnode *entries;
/* Call back. */ /* Call back. */
hashnode (*alloc_node) PARAMS ((hash_table *)); hashnode (*alloc_node) (hash_table *);
unsigned int nslots; /* Total slots in the entries array. */ unsigned int nslots; /* Total slots in the entries array. */
unsigned int nelements; /* Number of live elements. */ unsigned int nelements; /* Number of live elements. */
...@@ -60,25 +60,25 @@ struct ht ...@@ -60,25 +60,25 @@ struct ht
}; };
/* Initialize the hashtable with 2 ^ order entries. */ /* Initialize the hashtable with 2 ^ order entries. */
extern hash_table *ht_create PARAMS ((unsigned int order)); extern hash_table *ht_create (unsigned int order);
/* Frees all memory associated with a hash table. */ /* Frees all memory associated with a hash table. */
extern void ht_destroy PARAMS ((hash_table *)); extern void ht_destroy (hash_table *);
extern hashnode ht_lookup PARAMS ((hash_table *, const unsigned char *, extern hashnode ht_lookup (hash_table *, const unsigned char *,
unsigned int, enum ht_lookup_option)); unsigned int, enum ht_lookup_option);
/* For all nodes in TABLE, make a callback. The callback takes /* For all nodes in TABLE, make a callback. The callback takes
TABLE->PFILE, the node, and a PTR, and the callback sequence stops TABLE->PFILE, the node, and a PTR, and the callback sequence stops
if the callback returns zero. */ if the callback returns zero. */
typedef int (*ht_cb) PARAMS ((struct cpp_reader *, hashnode, const void *)); typedef int (*ht_cb) (struct cpp_reader *, hashnode, const void *);
extern void ht_forall PARAMS ((hash_table *, ht_cb, const void *)); extern void ht_forall (hash_table *, ht_cb, const void *);
/* Dump allocation statistics to stderr. */ /* Dump allocation statistics to stderr. */
extern void ht_dump_statistics PARAMS ((hash_table *)); extern void ht_dump_statistics (hash_table *);
/* Approximate positive square root of a host double. This is for /* Approximate positive square root of a host double. This is for
statistical reports, not code generation. */ statistical reports, not code generation. */
extern double approx_sqrt PARAMS ((double)); extern double approx_sqrt (double);
#endif /* GCC_HASHTABLE_H */ #endif /* GCC_HASHTABLE_H */
...@@ -30,13 +30,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -30,13 +30,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* Generic hook that does absolutely zappo. */ /* Generic hook that does absolutely zappo. */
void void
hook_void_void () hook_void_void (void)
{ {
} }
/* Generic hook that takes no arguments and returns false. */ /* Generic hook that takes no arguments and returns false. */
bool bool
hook_bool_void_false () hook_bool_void_false (void)
{ {
return false; return false;
} }
...@@ -58,63 +58,53 @@ hook_bool_bool_false (bool a ATTRIBUTE_UNUSED) ...@@ -58,63 +58,53 @@ hook_bool_bool_false (bool a ATTRIBUTE_UNUSED)
/* Generic hook that takes (tree, int) and does nothing. */ /* Generic hook that takes (tree, int) and does nothing. */
void void
hook_void_tree_int (a, b) hook_void_tree_int (tree a ATTRIBUTE_UNUSED, int b ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
int b ATTRIBUTE_UNUSED;
{ {
} }
/* Generic hook that takes (FILE *, const char *) and does nothing. */ /* Generic hook that takes (FILE *, const char *) and does nothing. */
void void
hook_void_FILEptr_constcharptr (a, b) hook_void_FILEptr_constcharptr (FILE *a ATTRIBUTE_UNUSED, const char *b ATTRIBUTE_UNUSED)
FILE *a ATTRIBUTE_UNUSED;
const char *b ATTRIBUTE_UNUSED;
{ {
} }
/* Used for the TARGET_ASM_CAN_OUTPUT_MI_THUNK hook. */ /* Used for the TARGET_ASM_CAN_OUTPUT_MI_THUNK hook. */
bool bool
hook_bool_tree_hwi_hwi_tree_false (a, b, c, d) hook_bool_tree_hwi_hwi_tree_false (tree a ATTRIBUTE_UNUSED,
tree a ATTRIBUTE_UNUSED; HOST_WIDE_INT b ATTRIBUTE_UNUSED,
HOST_WIDE_INT b ATTRIBUTE_UNUSED; HOST_WIDE_INT c ATTRIBUTE_UNUSED,
HOST_WIDE_INT c ATTRIBUTE_UNUSED; tree d ATTRIBUTE_UNUSED)
tree d ATTRIBUTE_UNUSED;
{ {
return false; return false;
} }
bool bool
hook_bool_tree_hwi_hwi_tree_true (a, b, c, d) hook_bool_tree_hwi_hwi_tree_true (tree a ATTRIBUTE_UNUSED,
tree a ATTRIBUTE_UNUSED; HOST_WIDE_INT b ATTRIBUTE_UNUSED,
HOST_WIDE_INT b ATTRIBUTE_UNUSED; HOST_WIDE_INT c ATTRIBUTE_UNUSED,
HOST_WIDE_INT c ATTRIBUTE_UNUSED; tree d ATTRIBUTE_UNUSED)
tree d ATTRIBUTE_UNUSED;
{ {
return true; return true;
} }
bool bool
default_can_output_mi_thunk_no_vcall (a, b, c, d) default_can_output_mi_thunk_no_vcall (tree a ATTRIBUTE_UNUSED,
tree a ATTRIBUTE_UNUSED; HOST_WIDE_INT b ATTRIBUTE_UNUSED,
HOST_WIDE_INT b ATTRIBUTE_UNUSED; HOST_WIDE_INT c,
HOST_WIDE_INT c; tree d ATTRIBUTE_UNUSED)
tree d ATTRIBUTE_UNUSED;
{ {
return c == 0; return c == 0;
} }
/* ??? Used for comp_type_attributes, which ought to return bool. */ /* ??? Used for comp_type_attributes, which ought to return bool. */
int int
hook_int_tree_tree_1 (a, b) hook_int_tree_tree_1 (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
tree b ATTRIBUTE_UNUSED;
{ {
return 1; return 1;
} }
int int
hook_int_rtx_0 (a) hook_int_rtx_0 (rtx a ATTRIBUTE_UNUSED)
rtx a ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }
...@@ -141,62 +131,52 @@ hook_uint_uint_constcharptrptr_0 (unsigned int a ATTRIBUTE_UNUSED, ...@@ -141,62 +131,52 @@ hook_uint_uint_constcharptrptr_0 (unsigned int a ATTRIBUTE_UNUSED,
} }
void void
hook_void_tree (a) hook_void_tree (tree a ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
{ {
} }
void void
hook_void_tree_treeptr (a, b) hook_void_tree_treeptr (tree a ATTRIBUTE_UNUSED, tree *b ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
tree *b ATTRIBUTE_UNUSED;
{ {
} }
bool bool
hook_bool_tree_false (a) hook_bool_tree_false (tree a ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
{ {
return false; return false;
} }
bool bool
hook_bool_tree_tree_false (a, b) hook_bool_tree_tree_false (tree a ATTRIBUTE_UNUSED, tree b ATTRIBUTE_UNUSED)
tree a ATTRIBUTE_UNUSED;
tree b ATTRIBUTE_UNUSED;
{ {
return false; return false;
} }
bool bool
hook_bool_rtx_false (a) hook_bool_rtx_false (rtx a ATTRIBUTE_UNUSED)
rtx a ATTRIBUTE_UNUSED;
{ {
return false; return false;
} }
bool bool
hook_bool_rtx_int_int_intp_false (a, b, c, d) hook_bool_rtx_int_int_intp_false (rtx a ATTRIBUTE_UNUSED,
rtx a ATTRIBUTE_UNUSED; int b ATTRIBUTE_UNUSED,
int b ATTRIBUTE_UNUSED; int c ATTRIBUTE_UNUSED,
int c ATTRIBUTE_UNUSED; int *d ATTRIBUTE_UNUSED)
int *d ATTRIBUTE_UNUSED;
{ {
return false; return false;
} }
/* Generic hook that takes an rtx and returns it. */ /* Generic hook that takes an rtx and returns it. */
rtx rtx
hook_rtx_rtx_identity (x) hook_rtx_rtx_identity (rtx x)
rtx x;
{ {
return x; return x;
} }
/* Generic hook that takes an rtx and returns NULL_RTX. */ /* Generic hook that takes an rtx and returns NULL_RTX. */
rtx rtx
hook_rtx_rtx_null (x) hook_rtx_rtx_null (rtx x ATTRIBUTE_UNUSED)
rtx x ATTRIBUTE_UNUSED;
{ {
return 0; return 0;
} }
...@@ -22,36 +22,36 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -22,36 +22,36 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef GCC_HOOKS_H #ifndef GCC_HOOKS_H
#define GCC_HOOKS_H #define GCC_HOOKS_H
bool hook_bool_void_false PARAMS ((void)); bool hook_bool_void_false (void);
bool hook_bool_bool_false (bool); bool hook_bool_bool_false (bool);
bool hook_bool_tree_false PARAMS ((tree)); bool hook_bool_tree_false (tree);
bool hook_bool_tree_hwi_hwi_tree_false bool hook_bool_tree_hwi_hwi_tree_false (tree, HOST_WIDE_INT, HOST_WIDE_INT,
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree)); tree);
bool hook_bool_tree_hwi_hwi_tree_true bool hook_bool_tree_hwi_hwi_tree_true (tree, HOST_WIDE_INT, HOST_WIDE_INT,
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree)); tree);
bool hook_bool_rtx_false PARAMS ((rtx)); bool hook_bool_rtx_false (rtx);
bool hook_bool_rtx_int_int_intp_false PARAMS ((rtx, int, int, int *)); bool hook_bool_rtx_int_int_intp_false (rtx, int, int, int *);
void hook_void_tree_int PARAMS ((tree, int)); void hook_void_tree_int (tree, int);
void hook_void_void PARAMS ((void)); void hook_void_void (void);
void hook_void_FILEptr_constcharptr PARAMS ((FILE *, const char *)); void hook_void_FILEptr_constcharptr (FILE *, const char *);
void hook_void_tree PARAMS ((tree)); void hook_void_tree (tree);
void hook_void_tree_treeptr PARAMS ((tree, tree *)); void hook_void_tree_treeptr (tree, tree *);
int hook_int_tree_tree_1 PARAMS ((tree, tree)); int hook_int_tree_tree_1 (tree, tree);
int hook_int_rtx_0 PARAMS ((rtx)); int hook_int_rtx_0 (rtx);
int hook_int_void_0 (void); int hook_int_void_0 (void);
int hook_int_size_t_constcharptr_int_0 (size_t, const char *, int); int hook_int_size_t_constcharptr_int_0 (size_t, const char *, int);
int hook_int_void_no_regs (void); int hook_int_void_no_regs (void);
unsigned hook_uint_uint_constcharptrptr_0 (unsigned, const char **); unsigned hook_uint_uint_constcharptrptr_0 (unsigned, const char **);
bool default_can_output_mi_thunk_no_vcall bool default_can_output_mi_thunk_no_vcall (tree, HOST_WIDE_INT,
PARAMS ((tree, HOST_WIDE_INT, HOST_WIDE_INT, tree)); HOST_WIDE_INT, tree);
bool hook_bool_tree_tree_false PARAMS ((tree, tree)); bool hook_bool_tree_tree_false (tree, tree);
rtx hook_rtx_rtx_identity PARAMS ((rtx)); rtx hook_rtx_rtx_identity (rtx);
rtx hook_rtx_rtx_null PARAMS ((rtx)); rtx hook_rtx_rtx_null (rtx);
#endif #endif
...@@ -21,9 +21,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,9 +21,9 @@ Boston, MA 02111-1307, USA. */
#ifndef GCC_HOST_HOOKS_H #ifndef GCC_HOST_HOOKS_H
#define GCC_HOST_HOOKS_H #define GCC_HOST_HOOKS_H
struct host_hooks struct host_hooks
{ {
void (*extra_signals) PARAMS((void)); void (*extra_signals) (void);
/* Whenever you add entries here, make sure you adjust hosthooks-def.h. */ /* Whenever you add entries here, make sure you adjust hosthooks-def.h. */
}; };
......
...@@ -25,7 +25,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -25,7 +25,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* The data structure used to record a location in a translation unit. */ /* The data structure used to record a location in a translation unit. */
struct location_s GTY (()) struct location_s GTY (())
{ {
/* The name of the source file involved. */ /* The name of the source file involved. */
const char *file; const char *file;
/* The line-location in the source file. */ /* The line-location in the source file. */
...@@ -53,7 +53,7 @@ extern struct file_stack *input_file_stack; ...@@ -53,7 +53,7 @@ extern struct file_stack *input_file_stack;
/* Incremented on each change to input_file_stack. */ /* Incremented on each change to input_file_stack. */
extern int input_file_stack_tick; extern int input_file_stack_tick;
extern void push_srcloc PARAMS ((const char *name, int line)); extern void push_srcloc (const char *name, int line);
extern void pop_srcloc PARAMS ((void)); extern void pop_srcloc (void);
#endif #endif
/* Function integration definitions for GCC /* Function integration definitions for GCC
Copyright (C) 1990, 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Copyright (C) 1990, 1995, 1998, 1999, 2000, 2001, 2003
Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -112,7 +113,7 @@ struct inline_remap ...@@ -112,7 +113,7 @@ struct inline_remap
rtx dest; rtx dest;
rtx equiv; rtx equiv;
} equiv_sets[MAX_RECOG_OPERANDS]; } equiv_sets[MAX_RECOG_OPERANDS];
/* Record the last thing assigned to pc. This is used for folded /* Record the last thing assigned to pc. This is used for folded
conditional branch insns. */ conditional branch insns. */
rtx last_pc_value; rtx last_pc_value;
#ifdef HAVE_cc0 #ifdef HAVE_cc0
...@@ -127,41 +128,41 @@ struct inline_remap ...@@ -127,41 +128,41 @@ struct inline_remap
/* Return a copy of an rtx (as needed), substituting pseudo-register, /* Return a copy of an rtx (as needed), substituting pseudo-register,
labels, and frame-pointer offsets as necessary. */ labels, and frame-pointer offsets as necessary. */
extern rtx copy_rtx_and_substitute PARAMS ((rtx, struct inline_remap *, int)); extern rtx copy_rtx_and_substitute (rtx, struct inline_remap *, int);
/* Return a pseudo that corresponds to the value in the specified hard /* Return a pseudo that corresponds to the value in the specified hard
reg as of the start of the function (for inlined functions, the reg as of the start of the function (for inlined functions, the
value at the start of the parent function). */ value at the start of the parent function). */
extern rtx get_hard_reg_initial_val PARAMS ((enum machine_mode, int)); extern rtx get_hard_reg_initial_val (enum machine_mode, int);
/* Likewise, but for a different than the current function, or /* Likewise, but for a different than the current function, or
arbitrary expression. */ arbitrary expression. */
extern rtx get_func_hard_reg_initial_val PARAMS ((struct function *, rtx)); extern rtx get_func_hard_reg_initial_val (struct function *, rtx);
/* Likewise, but iff someone else has caused it to become allocated. */ /* Likewise, but iff someone else has caused it to become allocated. */
extern rtx has_func_hard_reg_initial_val PARAMS ((struct function *, rtx)); extern rtx has_func_hard_reg_initial_val (struct function *, rtx);
/* Likewise, but for common cases. */ /* Likewise, but for common cases. */
extern rtx has_hard_reg_initial_val PARAMS ((enum machine_mode, int)); extern rtx has_hard_reg_initial_val (enum machine_mode, int);
/* If a pseudo represents an initial hard reg (or expression), return /* If a pseudo represents an initial hard reg (or expression), return
it, else return NULL_RTX. */ it, else return NULL_RTX. */
extern rtx get_hard_reg_initial_reg PARAMS ((struct function *, rtx)); extern rtx get_hard_reg_initial_reg (struct function *, rtx);
/* Called from rest_of_compilation. */ /* Called from rest_of_compilation. */
extern void emit_initial_value_sets PARAMS ((void)); extern void emit_initial_value_sets (void);
extern void allocate_initial_values PARAMS ((rtx *)); extern void allocate_initial_values (rtx *);
/* Copy a declaration when one function is substituted inline into /* Copy a declaration when one function is substituted inline into
another. */ another. */
extern union tree_node *copy_decl_for_inlining PARAMS ((union tree_node *, extern union tree_node *copy_decl_for_inlining (union tree_node *,
union tree_node *, union tree_node *,
union tree_node *)); union tree_node *);
/* Check whether there's any attribute in a function declaration that /* Check whether there's any attribute in a function declaration that
makes the function uninlinable. Returns false if it finds any, makes the function uninlinable. Returns false if it finds any,
true otherwise. */ true otherwise. */
extern bool function_attribute_inlinable_p PARAMS ((union tree_node *)); extern bool function_attribute_inlinable_p (union tree_node *);
extern void try_constants PARAMS ((rtx, struct inline_remap *)); extern void try_constants (rtx, struct inline_remap *);
/* Return the label indicated. */ /* Return the label indicated. */
extern rtx get_label_from_map PARAMS ((struct inline_remap *, int)); extern rtx get_label_from_map (struct inline_remap *, int);
/* Set the label indicated. */ /* Set the label indicated. */
#define set_label_in_map(MAP, I, X) ((MAP)->label_map[I] = (X)) #define set_label_in_map(MAP, I, X) ((MAP)->label_map[I] = (X))
......
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