genattr.c (main): Add extern prototype.

* genattr.c (main): Add extern prototype.  Call return, not exit.
	* genattrtab.c (main): Likewise.
	* gencheck.c (main): Likewise.
	* gencodes.c (main): Likewise.
	* genconfig.c (main): Likewise.
	* genemit.c (main): Likewise.
	* genextract.c (main): Likewise.
	* genflags.c (main): Likewise.
	* gengenrtl.c (main): Likewise.
	* genopinit.c (main): Likewise.
	* genoutput.c (main): Likewise.
	* genpeep.c (main): Likewise.
	* genrecog.c (main): Likewise.

	* genattr.c (get_insn_name): Mark parameter with ATTRIBUTE_UNUSED.
	* genattrtab.c (get_insn_name): Likewise.
	* gencodes.c (get_insn_name): Likewise.
	* genconfig.c (get_insn_name): Likewise.
	* genemit.c (get_insn_name): Likewise.
	* genextract.c (get_insn_name): Likewise.
	* genflags.c (get_insn_name): Likewise.
	* genopinit.c (get_insn_name): Likewise.
	* genpeep.c (get_insn_name): Likewise.

	* gencheck.c (usage): Add static prototype.
	* genextract.c (print_path): Constify a char*.
	* genopinit.c (optabs): Likewise.
	* genoutput.c (operand_data, data, output_predicate_decls,
	compare_operands): Likewise.
	* genrecog.c (write_tree): Add default case in switch.

From-SVN: r29434
This commit is contained in:
Kaveh R. Ghazi 1999-09-15 14:13:50 +00:00 committed by Kaveh Ghazi
parent 7adfcfed37
commit c1b59dce97
14 changed files with 110 additions and 71 deletions

View File

@ -1,3 +1,36 @@
Wed Sep 15 10:09:48 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* genattr.c (main): Add extern prototype. Call return, not exit.
* genattrtab.c (main): Likewise.
* gencheck.c (main): Likewise.
* gencodes.c (main): Likewise.
* genconfig.c (main): Likewise.
* genemit.c (main): Likewise.
* genextract.c (main): Likewise.
* genflags.c (main): Likewise.
* gengenrtl.c (main): Likewise.
* genopinit.c (main): Likewise.
* genoutput.c (main): Likewise.
* genpeep.c (main): Likewise.
* genrecog.c (main): Likewise.
* genattr.c (get_insn_name): Mark parameter with ATTRIBUTE_UNUSED.
* genattrtab.c (get_insn_name): Likewise.
* gencodes.c (get_insn_name): Likewise.
* genconfig.c (get_insn_name): Likewise.
* genemit.c (get_insn_name): Likewise.
* genextract.c (get_insn_name): Likewise.
* genflags.c (get_insn_name): Likewise.
* genopinit.c (get_insn_name): Likewise.
* genpeep.c (get_insn_name): Likewise.
* gencheck.c (usage): Add static prototype.
* genextract.c (print_path): Constify a char*.
* genopinit.c (optabs): Likewise.
* genoutput.c (operand_data, data, output_predicate_decls,
compare_operands): Likewise.
* genrecog.c (write_tree): Add default case in switch.
Wed Sep 15 09:59:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Wed Sep 15 09:59:16 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* rtl.h (get_insn_name, print_rtl_with_bb): Add prototypes. * rtl.h (get_insn_name, print_rtl_with_bb): Add prototypes.

View File

@ -219,6 +219,8 @@ xrealloc (old, size)
return ptr; return ptr;
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -252,7 +254,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
printf ("/* Generated automatically by the program `genattr'\n\ printf ("/* Generated automatically by the program `genattr'\n\
@ -404,15 +406,13 @@ from the machine description file `md'. */\n\n");
printf("#define ATTR_FLAG_very_unlikely\t0x20\n"); printf("#define ATTR_FLAG_very_unlikely\t0x20\n");
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char * const char *
get_insn_name (code) get_insn_name (code)
int code; int code ATTRIBUTE_UNUSED;
{ {
return NULL; return NULL;
} }

View File

@ -5955,6 +5955,8 @@ write_const_num_delay_slots ()
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -5994,7 +5996,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
/* Set up true and false rtx's */ /* Set up true and false rtx's */
@ -6145,15 +6147,13 @@ from the machine description file `md'. */\n\n");
write_length_unit_log (); write_length_unit_log ();
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char * const char *
get_insn_name (code) get_insn_name (code)
int code; int code ATTRIBUTE_UNUSED;
{ {
return NULL; return NULL;
} }

View File

@ -29,14 +29,20 @@ const char *tree_codes[] = {
(char*)0 (char*)0
}; };
void usage () static void usage PROTO ((void));
static void
usage ()
{ {
fprintf (stderr,"Usage: gencheck\n"); fprintf (stderr,"Usage: gencheck\n");
} }
int main (argc, argv) extern int main PROTO ((int, char **));
int
main (argc, argv)
int argc; int argc;
char *argv[] ATTRIBUTE_UNUSED; char **argv ATTRIBUTE_UNUSED;
{ {
int i; int i;
@ -47,7 +53,7 @@ int main (argc, argv)
default: default:
usage (); usage ();
exit (1); return (1);
} }
printf ("/* This file is generated using gencheck. Do not edit. */\n"); printf ("/* This file is generated using gencheck. Do not edit. */\n");

View File

@ -75,6 +75,8 @@ xrealloc (old, size)
return ptr; return ptr;
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -94,7 +96,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
printf ("/* Generated automatically by the program `gencodes'\n\ printf ("/* Generated automatically by the program `gencodes'\n\
@ -135,15 +137,13 @@ from the machine description file `md'. */\n\n");
printf ("#endif /* MAX_INSN_CODE */\n"); printf ("#endif /* MAX_INSN_CODE */\n");
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char * const char *
get_insn_name (code) get_insn_name (code)
int code; int code ATTRIBUTE_UNUSED;
{ {
return NULL; return NULL;
} }

View File

@ -277,6 +277,8 @@ xrealloc (old, size)
return ptr; return ptr;
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -296,7 +298,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
printf ("/* Generated automatically by the program `genconfig'\n\ printf ("/* Generated automatically by the program `genconfig'\n\
@ -365,15 +367,13 @@ from the machine description file `md'. */\n\n");
printf ("#define HAVE_peephole2\n"); printf ("#define HAVE_peephole2\n");
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char * const char *
get_insn_name (code) get_insn_name (code)
int code; int code ATTRIBUTE_UNUSED;
{ {
return NULL; return NULL;
} }

View File

@ -551,7 +551,7 @@ gen_split (split)
{ {
register int i; register int i;
int operands; int operands;
char *name = "split"; const char *name = "split";
if (GET_CODE (split) == DEFINE_PEEPHOLE2) if (GET_CODE (split) == DEFINE_PEEPHOLE2)
name = "peephole2"; name = "peephole2";
@ -769,6 +769,8 @@ xrealloc (old, size)
return ptr; return ptr;
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -788,7 +790,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
/* Assign sequential codes to all entries in the machine description /* Assign sequential codes to all entries in the machine description
@ -860,15 +862,13 @@ from the machine description file `md'. */\n\n");
output_add_clobbers (); output_add_clobbers ();
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char * const char *
get_insn_name (code) get_insn_name (code)
int code; int code ATTRIBUTE_UNUSED;
{ {
return NULL; return NULL;
} }

View File

@ -95,7 +95,7 @@ static struct code_ptr *peepholes;
static void gen_insn PROTO ((rtx)); static void gen_insn PROTO ((rtx));
static void walk_rtx PROTO ((rtx, const char *)); static void walk_rtx PROTO ((rtx, const char *));
static void print_path PROTO ((char *)); static void print_path PROTO ((const char *));
static void static void
gen_insn (insn) gen_insn (insn)
@ -300,7 +300,7 @@ walk_rtx (x, path)
static void static void
print_path (path) print_path (path)
char *path; const char *path;
{ {
register int len = strlen (path); register int len = strlen (path);
register int i; register int i;
@ -375,6 +375,8 @@ xstrdup (input)
return output; return output;
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -396,7 +398,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
/* Assign sequential codes to all entries in the machine description /* Assign sequential codes to all entries in the machine description
@ -520,15 +522,13 @@ from the machine description file `md'. */\n\n");
printf (" }\n}\n"); printf (" }\n}\n");
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char * const char *
get_insn_name (code) get_insn_name (code)
int code; int code ATTRIBUTE_UNUSED;
{ {
return NULL; return NULL;
} }

View File

@ -195,6 +195,8 @@ xrealloc (old, size)
return ptr; return ptr;
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -220,7 +222,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
printf ("/* Generated automatically by the program `genflags'\n\ printf ("/* Generated automatically by the program `genflags'\n\
@ -271,15 +273,13 @@ from the machine description file `md'. */\n\n");
printf ("#endif /* NO_MD_PROTOTYPES */\n"); printf ("#endif /* NO_MD_PROTOTYPES */\n");
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char * const char *
get_insn_name (code) get_insn_name (code)
int code; int code ATTRIBUTE_UNUSED;
{ {
return NULL; return NULL;
} }

View File

@ -391,6 +391,7 @@ xmalloc (nbytes)
/* This is the main program. We accept only one argument, "-h", which /* This is the main program. We accept only one argument, "-h", which
says we are writing the genrtl.h file. Otherwise we are writing the says we are writing the genrtl.h file. Otherwise we are writing the
genrtl.c file. */ genrtl.c file. */
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
@ -406,7 +407,5 @@ main (argc, argv)
gencode (); gencode ();
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }

View File

@ -60,7 +60,7 @@ struct obstack *rtl_obstack = &obstack;
/* The reason we use \% is to avoid sequences of the form %-capletter-% /* The reason we use \% is to avoid sequences of the form %-capletter-%
which SCCS treats as magic. This gets warnings which you should ignore. */ which SCCS treats as magic. This gets warnings which you should ignore. */
const char *optabs[] = const char * const optabs[] =
{ "extendtab[(int) %B][(int) %A][0] = CODE_FOR_%(extend%a\%b2%)", { "extendtab[(int) %B][(int) %A][0] = CODE_FOR_%(extend%a\%b2%)",
"extendtab[(int) %B][(int) %A][1] = CODE_FOR_%(zero_extend%a\%b2%)", "extendtab[(int) %B][(int) %A][1] = CODE_FOR_%(zero_extend%a\%b2%)",
"fixtab[(int) %A][(int) %B][0] = CODE_FOR_%(fix%F\%a%I\%b2%)", "fixtab[(int) %A][(int) %B][0] = CODE_FOR_%(fix%F\%a%I\%b2%)",
@ -301,6 +301,8 @@ xrealloc (old, size)
return ptr; return ptr;
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -320,7 +322,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
printf ("/* Generated automatically by the program `genopinit'\n\ printf ("/* Generated automatically by the program `genopinit'\n\
@ -356,15 +358,13 @@ from the machine description file `md'. */\n\n");
printf ("}\n"); printf ("}\n");
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char * const char *
get_insn_name (code) get_insn_name (code)
int code; int code ATTRIBUTE_UNUSED;
{ {
return NULL; return NULL;
} }

View File

@ -122,8 +122,8 @@ struct operand_data
{ {
struct operand_data *next; struct operand_data *next;
int index; int index;
char *predicate; const char *predicate;
char *constraint; const char *constraint;
enum machine_mode mode; enum machine_mode mode;
unsigned char n_alternatives; unsigned char n_alternatives;
char address_p; char address_p;
@ -154,8 +154,8 @@ static struct operand_data **odata_end = &null_operand.next;
struct data struct data
{ {
struct data *next; struct data *next;
char *name; const char *name;
char *template; const char *template;
int code_number; int code_number;
int index_number; int index_number;
int n_operands; /* Number of operands this insn recognizes */ int n_operands; /* Number of operands this insn recognizes */
@ -249,7 +249,7 @@ from the machine description file `md'. */\n\n");
static void static void
output_predicate_decls () output_predicate_decls ()
{ {
struct predicate { char *name; struct predicate *next; } *predicates = 0; struct predicate { const char *name; struct predicate *next; } *predicates = 0;
register struct operand_data *d; register struct operand_data *d;
struct predicate *p; struct predicate *p;
@ -545,7 +545,7 @@ static int
compare_operands (d0, d1) compare_operands (d0, d1)
struct operand_data *d0, *d1; struct operand_data *d0, *d1;
{ {
char *p0, *p1; const char *p0, *p1;
p0 = d0->predicate; p0 = d0->predicate;
if (!p0) if (!p0)
@ -909,6 +909,8 @@ xrealloc (old, size)
return ptr; return ptr;
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -928,7 +930,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
output_prologue (); output_prologue ();
@ -965,11 +967,8 @@ main (argc, argv)
output_get_insn_name (); output_get_insn_name ();
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 || have_error return (ferror (stdout) != 0 || have_error
? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
static int static int

View File

@ -404,6 +404,8 @@ xrealloc (old, size)
return ptr; return ptr;
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -425,7 +427,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
printf ("/* Generated automatically by the program `genpeep'\n\ printf ("/* Generated automatically by the program `genpeep'\n\
@ -486,15 +488,13 @@ from the machine description file `md'. */\n\n");
printf ("#endif\n"); printf ("#endif\n");
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
const char * const char *
get_insn_name (code) get_insn_name (code)
int code; int code ATTRIBUTE_UNUSED;
{ {
return NULL; return NULL;
} }

View File

@ -1721,6 +1721,8 @@ write_tree (tree, prevpos, afterward, initial, type)
name_prefix = "recog"; name_prefix = "recog";
call_suffix = ", pnum_clobbers"; call_suffix = ", pnum_clobbers";
break; break;
default:
abort();
} }
if (! initial && tree->subroutine_number > 0) if (! initial && tree->subroutine_number > 0)
{ {
@ -1868,6 +1870,8 @@ xmalloc (size)
return val; return val;
} }
extern int main PROTO ((int, char **));
int int
main (argc, argv) main (argc, argv)
int argc; int argc;
@ -1892,7 +1896,7 @@ main (argc, argv)
if (infile == 0) if (infile == 0)
{ {
perror (argv[1]); perror (argv[1]);
exit (FATAL_EXIT_CODE); return (FATAL_EXIT_CODE);
} }
next_insn_code = 0; next_insn_code = 0;
@ -1987,9 +1991,7 @@ from the machine description file `md'. */\n\n");
} }
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); return (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
} }
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */