OSDN Git Service

[pf3gnuchains/gcc-fork.git] / gcc / genemit.c
index e4341b8..7e55623 100644 (file)
@@ -20,11 +20,6 @@ Boston, MA 02111-1307, USA.  */
 
 
 #include "hconfig.h"
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
 #include "system.h"
 #include "rtl.h"
 #include "obstack.h"
@@ -35,9 +30,9 @@ struct obstack *rtl_obstack = &obstack;
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-char *xmalloc PROTO((unsigned));
-static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
-void fancy_abort PROTO((void));
+static void fatal PVPROTO ((char *, ...))
+  ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
 
 /* Define this so we can link with print-rtl.o to get debug_rtx function.  */
 char **insn_name_ptr = 0;
@@ -683,11 +678,11 @@ output_init_mov_optab ()
 #endif
 }
 \f
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
@@ -695,12 +690,12 @@ xmalloc (size)
   return val;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
@@ -709,14 +704,14 @@ xrealloc (ptr, size)
 static void
 fatal VPROTO ((char *format, ...))
 {
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
   char *format;
 #endif
   va_list ap;
 
   VA_START (ap, format);
 
-#ifndef __STDC__
+#ifndef ANSI_PROTOTYPES
   format = va_arg (ap, char *);
 #endif
 
@@ -775,15 +770,15 @@ from the machine description file `md'.  */\n\n");
   printf ("#include \"real.h\"\n");
   printf ("#include \"flags.h\"\n");
   printf ("#include \"output.h\"\n");
-  printf ("#include \"insn-config.h\"\n\n");
-  printf ("#include \"insn-flags.h\"\n\n");
-  printf ("#include \"insn-codes.h\"\n\n");
-  printf ("#include \"reload.h\"\n");
-  printf ("extern char *insn_operand_constraint[][MAX_RECOG_OPERANDS];\n\n");
+  printf ("#include \"insn-config.h\"\n");
+  printf ("#include \"insn-flags.h\"\n");
+  printf ("#include \"insn-codes.h\"\n");
+  printf ("#include \"recog.h\"\n");
+  printf ("#include \"reload.h\"\n\n");
   printf ("extern rtx recog_operand[];\n");
   printf ("#define operands emit_operand\n\n");
-  printf ("#define FAIL do {end_sequence (); return _val;} while (0)\n");
-  printf ("#define DONE do {_val = gen_sequence (); end_sequence (); return _val;} while (0)\n");
+  printf ("#define FAIL return (end_sequence (), _val)\n");
+  printf ("#define DONE return (_val = gen_sequence (), end_sequence (), _val)\n");
 
   /* Read the machine description.  */