OSDN Git Service

* loop.c (regs_patch_p): Add prototype.
[pf3gnuchains/gcc-fork.git] / gcc / genemit.c
index 08023f4..209fe09 100644 (file)
@@ -19,29 +19,23 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 
-#include <stdio.h>
 #include "hconfig.h"
+#include "system.h"
 #include "rtl.h"
 #include "obstack.h"
 
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
 static struct obstack obstack;
 struct obstack *rtl_obstack = &obstack;
 
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-#ifdef NEED_DECLARATION_FREE
-extern void free ();
-#endif
-extern rtx read_rtx ();
-
-char *xmalloc ();
+char *xmalloc PROTO((unsigned));
 static void fatal ();
-void fancy_abort ();
+void fancy_abort PROTO((void));
+
+/* Define this so we can link with print-rtl.o to get debug_rtx function.  */
+char **insn_name_ptr = 0;
 
 static int max_opno;
 static int max_dup_opno;
@@ -69,6 +63,17 @@ struct clobber_ent
   struct clobber_ent *next;
 };
 
+static void max_operand_1              PROTO((rtx));
+static int max_operand_vec             PROTO((rtx, int));
+static void print_code                 PROTO((RTX_CODE));
+static void gen_exp                    PROTO((rtx));
+static void gen_insn                   PROTO((rtx));
+static void gen_expand                 PROTO((rtx));
+static void gen_split                  PROTO((rtx));
+static void output_add_clobbers                PROTO((void));
+static void output_init_mov_optab      PROTO((void));
+
+\f
 static void
 max_operand_1 (x)
      rtx x;
@@ -505,9 +510,7 @@ gen_expand (expand)
   /* Call `gen_sequence' to make a SEQUENCE out of all the
      insns emitted within this gen_... function.  */
 
-  printf (" _done:\n");
   printf ("  _val = gen_sequence ();\n");
-  printf (" _fail:\n");
   printf ("  end_sequence ();\n");
   printf ("  return _val;\n}\n\n");
 }
@@ -595,9 +598,7 @@ gen_split (split)
   /* Call `gen_sequence' to make a SEQUENCE out of all the
      insns emitted within this gen_... function.  */
 
-  printf (" _done:\n");
   printf ("  _val = gen_sequence ();\n");
-  printf (" _fail:\n");
   printf ("  end_sequence ();\n");
   printf ("  return _val;\n}\n\n");
 }
@@ -650,7 +651,7 @@ output_init_mov_optab ()
 #ifdef EXTRA_CC_NAMES
   static char *cc_names[] = { EXTRA_CC_NAMES };
   char *p;
-  int i;
+  size_t i;
 
   printf ("\nvoid\ninit_mov_optab ()\n{\n");
 
@@ -750,7 +751,7 @@ main (argc, argv)
 from the machine description file `md'.  */\n\n");
 
   printf ("#include \"config.h\"\n");
-  printf ("#include <stdio.h>\n");
+  printf ("#include \"system.h\"\n");
   printf ("#include \"rtl.h\"\n");
   printf ("#include \"expr.h\"\n");
   printf ("#include \"real.h\"\n");
@@ -762,8 +763,8 @@ from the machine description file `md'.  */\n\n");
   printf ("extern char *insn_operand_constraint[][MAX_RECOG_OPERANDS];\n\n");
   printf ("extern rtx recog_operand[];\n");
   printf ("#define operands emit_operand\n\n");
-  printf ("#define FAIL goto _fail\n\n");
-  printf ("#define DONE goto _done\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");
 
   /* Read the machine description.  */