From f8b6598ecc2a0594801da4f59f5740b550802244 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 27 Aug 1999 07:47:17 +0000 Subject: errors.c: New file... 1999-08-27 00:27 -0700 Zack Weinberg * errors.c: New file; defines functions error, warning, and fatal, variables have_error and progname. * errors.h: New file; prototypes and decls for stuff in errors.c. * Makefile: Add rules to build errors.o and $(HOST_PREFIX)errors.o. Link genconfig, gencodes, genemit, genopinit, genrecog, genextract, genpeep, genattr, and genoutput with errors.o. Add errors.h to deps of genconfig.o, gencodes.o, genemit.o, genopinit.o, genrecog.o, genextract.o, genpeep.o, genattr.o, and genoutput.o. * genconfig.c, gencodes.c, genemit.c, genopinit.c, genrecog.c, genextract.c, genpeep.c, genattr.c: Include errors.h. Don't define or prototype fatal. Set progname at beginning of main. * genoutput.c: Likewise, and don't define or prototype error either. From-SVN: r28925 --- gcc/genrecog.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'gcc/genrecog.c') diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 748c2a1882a..d8bd74a2f0c 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -50,6 +50,7 @@ Boston, MA 02111-1307, USA. */ #include "system.h" #include "rtl.h" #include "obstack.h" +#include "errors.h" #define OUTPUT_LABEL(INDENT_STRING, LABEL_NUMBER) \ printf("%sL%d: ATTRIBUTE_UNUSED_LABEL\n", (INDENT_STRING), (LABEL_NUMBER)) @@ -193,9 +194,7 @@ static void write_tree PROTO((struct decision *, const char *, struct decision *, int, enum routine_type)); static void change_state PROTO((const char *, const char *, int)); -void fatal PVPROTO((const char *, ...)) - ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; - + /* Construct and return a sequence of decisions that will recognize INSN. @@ -1709,28 +1708,6 @@ xmalloc (size) return val; } -void -fatal VPROTO ((const char *format, ...)) -{ -#ifndef ANSI_PROTOTYPES - const char *format; -#endif - va_list ap; - - VA_START (ap, format); - -#ifndef ANSI_PROTOTYPES - format = va_arg (ap, const char *); -#endif - - fprintf (stderr, "genrecog: "); - vfprintf (stderr, format, ap); - va_end (ap); - fprintf (stderr, "\n"); - fprintf (stderr, "after %d definitions\n", next_index); - exit (FATAL_EXIT_CODE); -} - int main (argc, argv) int argc; @@ -1742,6 +1719,7 @@ main (argc, argv) FILE *infile; register int c; + progname = "genrecog"; obstack_init (rtl_obstack); recog_tree.first = recog_tree.last = split_tree.first = split_tree.last = 0; -- cgit v1.2.1