Commit 159b3be1 by Andreas Jaeger Committed by Andreas Jaeger

collect2.h: Convert prototypes to ISO C90.

	* collect2.h: Convert prototypes to ISO C90.
	* collect2.c: Likewise.
	* conflict.c: Likewise.
	* coverage.c: Likewise.
	* convert.h: Likewise.
	* convert.c: Likewise.

From-SVN: r68669
parent 4e3f84b7
2003-06-29 Andreas Jaeger <aj@suse.de>
* collect2.h: Convert prototypes to ISO C90.
* collect2.c: Likewise.
* conflict.c: Likewise.
* coverage.c: Likewise.
* convert.h: Likewise.
* convert.c: Likewise.
2003-06-29 Nathan Sidwell <nathan@codesourcery.com> 2003-06-29 Nathan Sidwell <nathan@codesourcery.com>
* c-decl.c (c_init_decl_processing): Use a location_t. Set input * c-decl.c (c_init_decl_processing): Use a location_t. Set input
......
/* Header file for collect/tlink routines. /* Header file for collect/tlink routines.
Copyright (C) 1998 Free Software Foundation, Inc. Copyright (C) 1998, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -21,17 +21,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -21,17 +21,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_COLLECT2_H #ifndef GCC_COLLECT2_H
#define GCC_COLLECT2_H #define GCC_COLLECT2_H
extern void do_tlink PARAMS ((char **, char **)); extern void do_tlink (char **, char **);
extern void collect_execute PARAMS ((const char *, char **, const char *)); extern void collect_execute (const char *, char **, const char *);
extern void collect_exit PARAMS ((int)) ATTRIBUTE_NORETURN; extern void collect_exit (int) ATTRIBUTE_NORETURN;
extern int collect_wait PARAMS ((const char *)); extern int collect_wait (const char *);
extern void dump_file PARAMS ((const char *)); extern void dump_file (const char *);
extern int file_exists PARAMS ((const char *)); extern int file_exists (const char *);
extern const char *ldout; extern const char *ldout;
extern const char *c_file_name; extern const char *c_file_name;
...@@ -39,12 +39,11 @@ extern struct obstack temporary_obstack; ...@@ -39,12 +39,11 @@ extern struct obstack temporary_obstack;
extern char *temporary_firstobj; extern char *temporary_firstobj;
extern int vflag, debug; extern int vflag, debug;
extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN; extern void fancy_abort (void) ATTRIBUTE_NORETURN;
extern void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1; extern void error (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void notice PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1; extern void notice (const char *, ...) ATTRIBUTE_PRINTF_1;
extern void fatal PARAMS ((const char *, ...)) extern void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; extern void fatal_perror (const char *, ...)
extern void fatal_perror PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
#endif /* ! GCC_COLLECT2_H */ #endif /* ! GCC_COLLECT2_H */
/* Register conflict graph computation routines. /* Register conflict graph computation routines.
Copyright (C) 2000 Free Software Foundation, Inc. Copyright (C) 2000, 2003 Free Software Foundation, Inc.
Contributed by CodeSourcery, LLC Contributed by CodeSourcery, LLC
This file is part of GCC. This file is part of GCC.
...@@ -114,17 +114,16 @@ struct conflict_graph_def ...@@ -114,17 +114,16 @@ struct conflict_graph_def
R1 and R2. R1 is assumed to be smaller or equal to R2. */ R1 and R2. R1 is assumed to be smaller or equal to R2. */
#define CONFLICT_HASH_FN(R1, R2) ((R2) * ((R2) - 1) / 2 + (R1)) #define CONFLICT_HASH_FN(R1, R2) ((R2) * ((R2) - 1) / 2 + (R1))
static hashval_t arc_hash PARAMS ((const void *)); static hashval_t arc_hash (const void *);
static int arc_eq PARAMS ((const void *, const void *)); static int arc_eq (const void *, const void *);
static int print_conflict PARAMS ((int, int, void *)); static int print_conflict (int, int, void *);
static void mark_reg PARAMS ((rtx, rtx, void *)); static void mark_reg (rtx, rtx, void *);
/* Callback function to compute the hash value of an arc. Uses /* Callback function to compute the hash value of an arc. Uses
current_graph to locate the graph to which the arc belongs. */ current_graph to locate the graph to which the arc belongs. */
static hashval_t static hashval_t
arc_hash (arcp) arc_hash (const void *arcp)
const void *arcp;
{ {
const_conflict_graph_arc arc = (const_conflict_graph_arc) arcp; const_conflict_graph_arc arc = (const_conflict_graph_arc) arcp;
...@@ -135,9 +134,7 @@ arc_hash (arcp) ...@@ -135,9 +134,7 @@ arc_hash (arcp)
table. */ table. */
static int static int
arc_eq (arcp1, arcp2) arc_eq (const void *arcp1, const void *arcp2)
const void *arcp1;
const void *arcp2;
{ {
const_conflict_graph_arc arc1 = (const_conflict_graph_arc) arcp1; const_conflict_graph_arc arc1 = (const_conflict_graph_arc) arcp1;
const_conflict_graph_arc arc2 = (const_conflict_graph_arc) arcp2; const_conflict_graph_arc arc2 = (const_conflict_graph_arc) arcp2;
...@@ -149,8 +146,7 @@ arc_eq (arcp1, arcp2) ...@@ -149,8 +146,7 @@ arc_eq (arcp1, arcp2)
registers. */ registers. */
conflict_graph conflict_graph
conflict_graph_new (num_regs) conflict_graph_new (int num_regs)
int num_regs;
{ {
conflict_graph graph conflict_graph graph
= (conflict_graph) xmalloc (sizeof (struct conflict_graph_def)); = (conflict_graph) xmalloc (sizeof (struct conflict_graph_def));
...@@ -175,8 +171,7 @@ conflict_graph_new (num_regs) ...@@ -175,8 +171,7 @@ conflict_graph_new (num_regs)
/* Deletes a conflict graph. */ /* Deletes a conflict graph. */
void void
conflict_graph_delete (graph) conflict_graph_delete (conflict_graph graph)
conflict_graph graph;
{ {
obstack_free (&graph->arc_obstack, NULL); obstack_free (&graph->arc_obstack, NULL);
htab_delete (graph->arc_hash_table); htab_delete (graph->arc_hash_table);
...@@ -189,10 +184,7 @@ conflict_graph_delete (graph) ...@@ -189,10 +184,7 @@ conflict_graph_delete (graph)
in GRAPH, in which case it does nothing and returns zero. */ in GRAPH, in which case it does nothing and returns zero. */
int int
conflict_graph_add (graph, reg1, reg2) conflict_graph_add (conflict_graph graph, int reg1, int reg2)
conflict_graph graph;
int reg1;
int reg2;
{ {
int smaller = MIN (reg1, reg2); int smaller = MIN (reg1, reg2);
int larger = MAX (reg1, reg2); int larger = MAX (reg1, reg2);
...@@ -238,10 +230,7 @@ conflict_graph_add (graph, reg1, reg2) ...@@ -238,10 +230,7 @@ conflict_graph_add (graph, reg1, reg2)
and REG2. */ and REG2. */
int int
conflict_graph_conflict_p (graph, reg1, reg2) conflict_graph_conflict_p (conflict_graph graph, int reg1, int reg2)
conflict_graph graph;
int reg1;
int reg2;
{ {
/* Build an arc to search for. */ /* Build an arc to search for. */
struct conflict_graph_arc_def arc; struct conflict_graph_arc_def arc;
...@@ -255,11 +244,8 @@ conflict_graph_conflict_p (graph, reg1, reg2) ...@@ -255,11 +244,8 @@ conflict_graph_conflict_p (graph, reg1, reg2)
passed back to ENUM_FN. */ passed back to ENUM_FN. */
void void
conflict_graph_enum (graph, reg, enum_fn, extra) conflict_graph_enum (conflict_graph graph, int reg,
conflict_graph graph; conflict_graph_enum_fn enum_fn, void *extra)
int reg;
conflict_graph_enum_fn enum_fn;
void *extra;
{ {
conflict_graph_arc arc = graph->neighbor_heads[reg]; conflict_graph_arc arc = graph->neighbor_heads[reg];
while (arc != NULL) while (arc != NULL)
...@@ -282,10 +268,7 @@ conflict_graph_enum (graph, reg, enum_fn, extra) ...@@ -282,10 +268,7 @@ conflict_graph_enum (graph, reg, enum_fn, extra)
conflict to GRAPH between x and TARGET. */ conflict to GRAPH between x and TARGET. */
void void
conflict_graph_merge_regs (graph, target, src) conflict_graph_merge_regs (conflict_graph graph, int target, int src)
conflict_graph graph;
int target;
int src;
{ {
conflict_graph_arc arc = graph->neighbor_heads[src]; conflict_graph_arc arc = graph->neighbor_heads[src];
...@@ -328,10 +311,7 @@ struct print_context ...@@ -328,10 +311,7 @@ struct print_context
/* Callback function when enumerating conflicts during printing. */ /* Callback function when enumerating conflicts during printing. */
static int static int
print_conflict (reg1, reg2, contextp) print_conflict (int reg1, int reg2, void *contextp)
int reg1;
int reg2;
void *contextp;
{ {
struct print_context *context = (struct print_context *) contextp; struct print_context *context = (struct print_context *) contextp;
int reg; int reg;
...@@ -363,9 +343,7 @@ print_conflict (reg1, reg2, contextp) ...@@ -363,9 +343,7 @@ print_conflict (reg1, reg2, contextp)
/* Prints the conflicts in GRAPH to FP. */ /* Prints the conflicts in GRAPH to FP. */
void void
conflict_graph_print (graph, fp) conflict_graph_print (conflict_graph graph, FILE *fp)
conflict_graph graph;
FILE *fp;
{ {
int reg; int reg;
struct print_context context; struct print_context context;
...@@ -394,10 +372,7 @@ conflict_graph_print (graph, fp) ...@@ -394,10 +372,7 @@ conflict_graph_print (graph, fp)
/* Callback function for note_stores. */ /* Callback function for note_stores. */
static void static void
mark_reg (reg, setter, data) mark_reg (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *data)
rtx reg;
rtx setter ATTRIBUTE_UNUSED;
void *data;
{ {
regset set = (regset) data; regset set = (regset) data;
...@@ -441,9 +416,7 @@ mark_reg (reg, setter, data) ...@@ -441,9 +416,7 @@ mark_reg (reg, setter, data)
canonical regs instead. */ canonical regs instead. */
conflict_graph conflict_graph
conflict_graph_compute (regs, p) conflict_graph_compute (regset regs, partition p)
regset regs;
partition p;
{ {
conflict_graph graph = conflict_graph_new (max_reg_num ()); conflict_graph graph = conflict_graph_new (max_reg_num ());
regset_head live_head; regset_head live_head;
......
...@@ -39,8 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -39,8 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
in other cases error is called. */ in other cases error is called. */
tree tree
convert_to_pointer (type, expr) convert_to_pointer (tree type, tree expr)
tree type, expr;
{ {
if (integer_zerop (expr)) if (integer_zerop (expr))
{ {
...@@ -75,8 +74,7 @@ convert_to_pointer (type, expr) ...@@ -75,8 +74,7 @@ convert_to_pointer (type, expr)
/* Avoid any floating point extensions from EXP. */ /* Avoid any floating point extensions from EXP. */
tree tree
strip_float_extensions (exp) strip_float_extensions (tree exp)
tree exp;
{ {
tree sub, expt, subt; tree sub, expt, subt;
...@@ -124,8 +122,7 @@ strip_float_extensions (exp) ...@@ -124,8 +122,7 @@ strip_float_extensions (exp)
in other cases error is called. */ in other cases error is called. */
tree tree
convert_to_real (type, expr) convert_to_real (tree type, tree expr)
tree type, expr;
{ {
enum built_in_function fcode = builtin_mathfn_code (expr); enum built_in_function fcode = builtin_mathfn_code (expr);
tree itype = TREE_TYPE (expr); tree itype = TREE_TYPE (expr);
...@@ -285,8 +282,7 @@ convert_to_real (type, expr) ...@@ -285,8 +282,7 @@ convert_to_real (type, expr)
not in use in any existing structure. */ not in use in any existing structure. */
tree tree
convert_to_integer (type, expr) convert_to_integer (tree type, tree expr)
tree type, expr;
{ {
enum tree_code ex_form = TREE_CODE (expr); enum tree_code ex_form = TREE_CODE (expr);
tree intype = TREE_TYPE (expr); tree intype = TREE_TYPE (expr);
...@@ -593,8 +589,7 @@ convert_to_integer (type, expr) ...@@ -593,8 +589,7 @@ convert_to_integer (type, expr)
/* Convert EXPR to the complex type TYPE in the usual ways. */ /* Convert EXPR to the complex type TYPE in the usual ways. */
tree tree
convert_to_complex (type, expr) convert_to_complex (tree type, tree expr)
tree type, expr;
{ {
tree subtype = TREE_TYPE (type); tree subtype = TREE_TYPE (type);
...@@ -649,8 +644,7 @@ convert_to_complex (type, expr) ...@@ -649,8 +644,7 @@ convert_to_complex (type, expr)
/* Convert EXPR to the vector type TYPE in the usual ways. */ /* Convert EXPR to the vector type TYPE in the usual ways. */
tree tree
convert_to_vector (type, expr) convert_to_vector (tree type, tree expr)
tree type, expr;
{ {
switch (TREE_CODE (TREE_TYPE (expr))) switch (TREE_CODE (TREE_TYPE (expr)))
{ {
......
/* Definition of functions in convert.c. /* Definition of functions in convert.c.
Copyright (C) 1993, 2000 Free Software Foundation, Inc. Copyright (C) 1993, 2000, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -18,8 +18,8 @@ along with GCC; see the file COPYING. If not, write to the Free ...@@ -18,8 +18,8 @@ along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */ 02111-1307, USA. */
extern tree convert_to_integer PARAMS ((tree, tree)); extern tree convert_to_integer (tree, tree);
extern tree convert_to_pointer PARAMS ((tree, tree)); extern tree convert_to_pointer (tree, tree);
extern tree convert_to_real PARAMS ((tree, tree)); extern tree convert_to_real (tree, tree);
extern tree convert_to_complex PARAMS ((tree, tree)); extern tree convert_to_complex (tree, tree);
extern tree convert_to_vector PARAMS ((tree, tree)); extern tree convert_to_vector (tree, tree);
...@@ -104,23 +104,22 @@ static const char *const ctr_merge_functions[GCOV_COUNTERS] = GCOV_MERGE_FUNCTIO ...@@ -104,23 +104,22 @@ static const char *const ctr_merge_functions[GCOV_COUNTERS] = GCOV_MERGE_FUNCTIO
static const char *const ctr_names[GCOV_COUNTERS] = GCOV_COUNTER_NAMES; static const char *const ctr_names[GCOV_COUNTERS] = GCOV_COUNTER_NAMES;
/* Forward declarations. */ /* Forward declarations. */
static hashval_t htab_counts_entry_hash PARAMS ((const void *)); static hashval_t htab_counts_entry_hash (const void *);
static int htab_counts_entry_eq PARAMS ((const void *, const void *)); static int htab_counts_entry_eq (const void *, const void *);
static void htab_counts_entry_del PARAMS ((void *)); static void htab_counts_entry_del (void *);
static void read_counts_file PARAMS ((void)); static void read_counts_file (void);
static unsigned compute_checksum PARAMS ((void)); static unsigned compute_checksum (void);
static unsigned checksum_string PARAMS ((unsigned, const char *)); static unsigned checksum_string (unsigned, const char *);
static tree build_fn_info_type PARAMS ((unsigned)); static tree build_fn_info_type (unsigned);
static tree build_fn_info_value PARAMS ((const struct function_list *, tree)); static tree build_fn_info_value (const struct function_list *, tree);
static tree build_ctr_info_type PARAMS ((void)); static tree build_ctr_info_type (void);
static tree build_ctr_info_value PARAMS ((unsigned, tree)); static tree build_ctr_info_value (unsigned, tree);
static tree build_gcov_info PARAMS ((void)); static tree build_gcov_info (void);
static void create_coverage PARAMS ((void)); static void create_coverage (void);
static hashval_t static hashval_t
htab_counts_entry_hash (of) htab_counts_entry_hash (const void *of)
const void *of;
{ {
const counts_entry_t *entry = of; const counts_entry_t *entry = of;
...@@ -128,9 +127,7 @@ htab_counts_entry_hash (of) ...@@ -128,9 +127,7 @@ htab_counts_entry_hash (of)
} }
static int static int
htab_counts_entry_eq (of1, of2) htab_counts_entry_eq (const void *of1, const void *of2)
const void *of1;
const void *of2;
{ {
const counts_entry_t *entry1 = of1; const counts_entry_t *entry1 = of1;
const counts_entry_t *entry2 = of2; const counts_entry_t *entry2 = of2;
...@@ -139,8 +136,7 @@ htab_counts_entry_eq (of1, of2) ...@@ -139,8 +136,7 @@ htab_counts_entry_eq (of1, of2)
} }
static void static void
htab_counts_entry_del (of) htab_counts_entry_del (void *of)
void *of;
{ {
counts_entry_t *entry = of; counts_entry_t *entry = of;
...@@ -151,7 +147,7 @@ htab_counts_entry_del (of) ...@@ -151,7 +147,7 @@ htab_counts_entry_del (of)
/* Read in the counts file, if available. */ /* Read in the counts file, if available. */
static void static void
read_counts_file () read_counts_file (void)
{ {
gcov_unsigned_t fn_ident = 0; gcov_unsigned_t fn_ident = 0;
gcov_unsigned_t version, checksum = -1; gcov_unsigned_t version, checksum = -1;
...@@ -413,7 +409,7 @@ checksum_string (unsigned chksum, const char *string) ...@@ -413,7 +409,7 @@ checksum_string (unsigned chksum, const char *string)
/* Compute checksum for the current function. We generate a CRC32. */ /* Compute checksum for the current function. We generate a CRC32. */
static unsigned static unsigned
compute_checksum () compute_checksum (void)
{ {
unsigned chksum = DECL_SOURCE_LINE (current_function_decl); unsigned chksum = DECL_SOURCE_LINE (current_function_decl);
...@@ -430,7 +426,7 @@ compute_checksum () ...@@ -430,7 +426,7 @@ compute_checksum ()
should be output. */ should be output. */
int int
coverage_begin_output () coverage_begin_output (void)
{ {
if (no_coverage) if (no_coverage)
return 0; return 0;
...@@ -472,7 +468,7 @@ coverage_begin_output () ...@@ -472,7 +468,7 @@ coverage_begin_output ()
error has occurred. Save function coverage counts. */ error has occurred. Save function coverage counts. */
void void
coverage_end_function () coverage_end_function (void)
{ {
unsigned i; unsigned i;
...@@ -509,8 +505,7 @@ coverage_end_function () ...@@ -509,8 +505,7 @@ coverage_end_function ()
/* Creates the gcov_fn_info RECORD_TYPE. */ /* Creates the gcov_fn_info RECORD_TYPE. */
static tree static tree
build_fn_info_type (counters) build_fn_info_type (unsigned int counters)
unsigned counters;
{ {
tree type = (*lang_hooks.types.make_type) (RECORD_TYPE); tree type = (*lang_hooks.types.make_type) (RECORD_TYPE);
tree field, fields; tree field, fields;
...@@ -542,9 +537,7 @@ build_fn_info_type (counters) ...@@ -542,9 +537,7 @@ build_fn_info_type (counters)
RECORD_TYPE. */ RECORD_TYPE. */
static tree static tree
build_fn_info_value (function, type) build_fn_info_value (const struct function_list *function, tree type)
const struct function_list *function;
tree type;
{ {
tree value = NULL_TREE; tree value = NULL_TREE;
tree fields = TYPE_FIELDS (type); tree fields = TYPE_FIELDS (type);
...@@ -586,7 +579,7 @@ build_fn_info_value (function, type) ...@@ -586,7 +579,7 @@ build_fn_info_value (function, type)
/* Creates the gcov_ctr_info RECORD_TYPE. */ /* Creates the gcov_ctr_info RECORD_TYPE. */
static tree static tree
build_ctr_info_type () build_ctr_info_type (void)
{ {
tree type = (*lang_hooks.types.make_type) (RECORD_TYPE); tree type = (*lang_hooks.types.make_type) (RECORD_TYPE);
tree field, fields = NULL_TREE; tree field, fields = NULL_TREE;
...@@ -623,9 +616,7 @@ build_ctr_info_type () ...@@ -623,9 +616,7 @@ build_ctr_info_type ()
RECORD_TYPE. */ RECORD_TYPE. */
static tree static tree
build_ctr_info_value (counter, type) build_ctr_info_value (unsigned int counter, tree type)
unsigned counter;
tree type;
{ {
tree value = NULL_TREE; tree value = NULL_TREE;
tree fields = TYPE_FIELDS (type); tree fields = TYPE_FIELDS (type);
...@@ -679,7 +670,7 @@ build_ctr_info_value (counter, type) ...@@ -679,7 +670,7 @@ build_ctr_info_value (counter, type)
CONSTRUCTOR. */ CONSTRUCTOR. */
static tree static tree
build_gcov_info () build_gcov_info (void)
{ {
unsigned n_ctr_types, ix; unsigned n_ctr_types, ix;
tree type, const_type; tree type, const_type;
...@@ -810,7 +801,7 @@ build_gcov_info () ...@@ -810,7 +801,7 @@ build_gcov_info ()
gcov-io.h. Write out the constructor to call __gcov_init. */ gcov-io.h. Write out the constructor to call __gcov_init. */
static void static void
create_coverage () create_coverage (void)
{ {
tree gcov_info, gcov_info_value; tree gcov_info, gcov_info_value;
char name[20]; char name[20];
...@@ -884,8 +875,7 @@ create_coverage () ...@@ -884,8 +875,7 @@ create_coverage ()
of graph file. */ of graph file. */
void void
coverage_init (filename) coverage_init (const char *filename)
const char *filename;
{ {
int len = strlen (filename); int len = strlen (filename);
...@@ -906,7 +896,7 @@ coverage_init (filename) ...@@ -906,7 +896,7 @@ coverage_init (filename)
variables and constructor. */ variables and constructor. */
void void
coverage_finish () coverage_finish (void)
{ {
create_coverage (); create_coverage ();
if (bbg_file_opened) if (bbg_file_opened)
......
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