]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Makefile.in (gensupport.o): Compile for the host.
authorRichard Henderson <rth@cygnus.com>
Sat, 6 May 2000 22:30:13 +0000 (15:30 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 6 May 2000 22:30:13 +0000 (15:30 -0700)
* Makefile.in (gensupport.o): Compile for the host.
(host-prefix gensuuprt.o): Remove.
(genflags.o): Depend on gensupport.h and OBSTACK_H.
(genattrtab.o): Likewise.
(gencodes.o): Depend on gensupport.h.
(genemit.o, genopinit.o, genrecog.o, genextract.o): Likewise.
(genpeep.o, genattr.o, genoutput.o): Likewise.

* gensupport.c (obstack, rtl_obstack): New.
(init_md_reader): Initialize rtl_obstack.
* gensupport.h (rtl_obstack): Declare.
(message_with_line): Declare.

* genattr.c: Remove all traces of obstack manipulation.
* gencodes.c, genconfig.c, genemit.c, genextract.c: Likewise.
* genopinit.c, genoutput.c, genpeep.c, genrecog.c: Likewise.

* genattrtab.c (obstack, rtl_obstack): Remove.
(main): Don't init rtl_obstack.
* genflags.c: Likewise.

* genrecog.c (message_with_line): Move ...
* gensupport.c: ... here.

From-SVN: r33742

15 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/genattr.c
gcc/genattrtab.c
gcc/gencodes.c
gcc/genconfig.c
gcc/genemit.c
gcc/genextract.c
gcc/genflags.c
gcc/genopinit.c
gcc/genoutput.c
gcc/genpeep.c
gcc/genrecog.c
gcc/gensupport.c
gcc/gensupport.h

index 9c7525de849c861f26ab56ce6592593684c7a986..f8a6406d363a52a665057be7d6d2024de2f7835d 100644 (file)
@@ -1,3 +1,29 @@
+2000-05-06  Richard Henderson  <rth@cygnus.com>
+
+       * Makefile.in (gensupport.o): Compile for the host.
+       (host-prefix gensuuprt.o): Remove.
+       (genflags.o): Depend on gensupport.h and OBSTACK_H.
+       (genattrtab.o): Likewise.
+       (gencodes.o): Depend on gensupport.h.
+       (genemit.o, genopinit.o, genrecog.o, genextract.o): Likewise.
+       (genpeep.o, genattr.o, genoutput.o): Likewise.
+
+       * gensupport.c (obstack, rtl_obstack): New.
+       (init_md_reader): Initialize rtl_obstack.
+       * gensupport.h (rtl_obstack): Declare.
+       (message_with_line): Declare.
+
+       * genattr.c: Remove all traces of obstack manipulation.
+       * gencodes.c, genconfig.c, genemit.c, genextract.c: Likewise.
+       * genopinit.c, genoutput.c, genpeep.c, genrecog.c: Likewise.
+
+       * genattrtab.c (obstack, rtl_obstack): Remove.
+       (main): Don't init rtl_obstack.
+       * genflags.c: Likewise.
+
+       * genrecog.c (message_with_line): Move ...
+       * gensupport.c: ... here.
+
 2000-05-06  Richard Henderson  <rth@cygnus.com>
 
        * c-typeck.c (build_c_cast): Remove dead code.
index c1eaee80c9d4ca6dc848835e8de09514efa4b0b5..5350b00767a1f6744645857ae9baf2b5489234df 100644 (file)
@@ -590,7 +590,7 @@ HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC)  \
            $(HOST_CLIB)
 
 HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o \
-               $(HOST_PREFIX)ggc-none.o $(HOST_PREFIX)gensupport.o
+               $(HOST_PREFIX)ggc-none.o gensupport.o
 
 HOST_PRINT = $(HOST_PREFIX)print-rtl.o
 HOST_ERRORS = $(HOST_PREFIX)errors.o
@@ -1242,7 +1242,6 @@ toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \
          -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
 
 rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h $(GGC_H) toplev.h
-gensupport.o : gensupport.c $(CONFIG_H) system.h $(RTL_H) 
 
 print-rtl.o : print-rtl.c $(CONFIG_H) system.h $(RTL_H) $(BASIC_BLOCK_H)
 rtlanal.o : rtlanal.c $(CONFIG_H) system.h $(RTL_H)
@@ -1575,81 +1574,91 @@ $(MD_FILE): $(MD_DEPS)
        $(MD_CPP) $(MD_CPPFLAGS) $(md_file) | sed 's/^# /; /g' > tmp-$@
        mv tmp-$@ $@
 
+gensupport.o: gensupport.c $(RTL_H) $(OBSTACK_H) system.h errors.h gensupport.h
+       $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)$(srcdir)/gensupport.c
+
 genconfig : genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
          genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-genconfig.o : genconfig.c $(RTL_H) $(build_xm_file) system.h errors.h
+genconfig.o : genconfig.c $(RTL_H) $(build_xm_file) \
+  system.h errors.h gensupport.h
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
 
 genflags : genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
         genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-genflags.o : genflags.c $(RTL_H) $(build_xm_file) system.h errors.h
+genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(build_xm_file) \
+  system.h errors.h gensupport.h
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
 
 gencodes : gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
         gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-gencodes.o : gencodes.c $(RTL_H) $(build_xm_file) system.h errors.h
+gencodes.o : gencodes.c $(RTL_H) $(build_xm_file) \
+  system.h errors.h gensupport.h
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
 
 genemit : genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
         genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-genemit.o : genemit.c $(RTL_H) $(build_xm_file) system.h errors.h
+genemit.o : genemit.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
 
 genopinit : genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
         genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-genopinit.o : genopinit.c $(RTL_H) $(build_xm_file) system.h errors.h
+genopinit.o : genopinit.c $(RTL_H) $(build_xm_file) \
+  system.h errors.h gensupport.h
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c
 
 genrecog : genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
         genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) system.h errors.h
-       $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
-
+genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) \
+  system.h errors.h gensupport.h
+       $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c 
 genextract : genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
         genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-genextract.o : genextract.c $(RTL_H) $(build_xm_file) system.h insn-config.h errors.h
+genextract.o : genextract.c $(RTL_H) $(build_xm_file) \
+  system.h insn-config.h errors.h gensupport.h
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
 
 genpeep : genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
         genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-genpeep.o : genpeep.c $(RTL_H) $(build_xm_file) system.h errors.h
+genpeep.o : genpeep.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
 
 genattr : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
         genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h errors.h
+genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
 
 genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
         genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-genattrtab.o : genattrtab.c $(RTL_H)  $(build_xm_file) system.h errors.h $(GGC_H)
+genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(build_xm_file) \
+  system.h errors.h $(GGC_H) gensupport.h
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
 
 genoutput : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
        $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
         genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
 
-genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) system.h errors.h
+genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) \
+  system.h errors.h gensupport.h
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
 
 gengenrtl : gengenrtl.o $(HOST_LIBDEPS)
@@ -1727,11 +1736,6 @@ $(HOST_PREFIX_1)ggc-none.o: ggc-none.c
        sed -e 's/config[.]h/hconfig.h/' $(srcdir)/ggc-none.c > $(HOST_PREFIX)ggc-none.c
        $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)ggc-none.c
 
-$(HOST_PREFIX_1)gensupport.o: gensupport.c
-       rm -f $(HOST_PREFIX)gensupport.c
-       $(LN_S) $(srcdir)/gensupport.c $(HOST_PREFIX)gensupport.c
-       $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)gensupport.c
-
 #\f
 # Remake internationalization support.
 
index 36a37b1a40884f844d22592165233e354196b434..9207876e817e5b3c6ae7c6f4b54ab7dfd57a685f 100644 (file)
@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA.  */
 #include "hconfig.h"
 #include "system.h"
 #include "rtl.h"
-#include "obstack.h"
 #include "errors.h"
 #include "gensupport.h"
 
-static struct obstack obstack;
-struct obstack *rtl_obstack = &obstack;
-
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
 
 /* A range of values.  */
 
@@ -239,7 +233,6 @@ main (argc, argv)
   init_range (&all_blockage);
 
   progname = "genattr";
-  obstack_init (rtl_obstack);
 
   if (argc <= 1)
     fatal ("No input file name.");
index b1be9a070e4e9ff8323d547319592d0e7b79a68a..2c09e3d5fb221205be4273fc21657c99c5c1356b 100644 (file)
@@ -111,8 +111,7 @@ Boston, MA 02111-1307, USA.  */
 #include "obstack.h"
 #include "errors.h"
 
-static struct obstack obstack, obstack1, obstack2;
-struct obstack *rtl_obstack = &obstack;
+static struct obstack obstack1, obstack2;
 struct obstack *hash_obstack = &obstack1;
 struct obstack *temp_obstack = &obstack2;
 
@@ -5978,9 +5977,6 @@ main (argc, argv)
   if (argc <= 1)
     fatal ("No input file name.");
 
-  if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE)
-    return (FATAL_EXIT_CODE);
-
 #if defined (RLIMIT_STACK) && defined (HAVE_GETRLIMIT) && defined (HAVE_SETRLIMIT)
   /* Get rid of any avoidable limit on stack size.  */
   {
@@ -5993,8 +5989,9 @@ main (argc, argv)
   }
 #endif
 
-  progname = "genattrtab";
-  obstack_init (rtl_obstack);
+  if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE)
+    return (FATAL_EXIT_CODE);
+
   obstack_init (hash_obstack);
   obstack_init (temp_obstack);
 
index 750839b39c8b05ea18da00a10aacf305cad41d07..0e36e9fd52d4f93f73844177f0efe5e85c01e9d7 100644 (file)
@@ -25,15 +25,9 @@ Boston, MA 02111-1307, USA.  */
 #include "hconfig.h"
 #include "system.h"
 #include "rtl.h"
-#include "obstack.h"
 #include "errors.h"
 #include "gensupport.h"
 
-static struct obstack obstack;
-struct obstack *rtl_obstack = &obstack;
-
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
 
 static int insn_code_number;
 
@@ -87,7 +81,6 @@ main (argc, argv)
   rtx desc;
 
   progname = "gencodes";
-  obstack_init (rtl_obstack);
 
   if (argc <= 1)
     fatal ("No input file name.");
index 077216292e99dd7c5125dd80985fb19faa574536..a18f896a5b995cb55f90de6a559553d6b1a47c71 100644 (file)
@@ -24,15 +24,9 @@ Boston, MA 02111-1307, USA.  */
 #include "hconfig.h"
 #include "system.h"
 #include "rtl.h"
-#include "obstack.h"
 #include "errors.h"
 #include "gensupport.h"
 
-static struct obstack obstack;
-struct obstack *rtl_obstack = &obstack;
-
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
 
 /* flags to determine output of machine description dependent #define's.  */
 static int max_recog_operands;  /* Largest operand number seen.  */
@@ -282,7 +276,6 @@ main (argc, argv)
   rtx desc;
 
   progname = "genconfig";
-  obstack_init (rtl_obstack);
 
   if (argc <= 1)
     fatal ("No input file name.");
index 6fc604d7c23ed03ac19d29c1f2dab24a3f307bcd..f559eb978696b8f63580a1fa095d757075a9a097 100644 (file)
@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA.  */
 #include "hconfig.h"
 #include "system.h"
 #include "rtl.h"
-#include "obstack.h"
 #include "errors.h"
 #include "gensupport.h"
 
-static struct obstack obstack;
-struct obstack *rtl_obstack = &obstack;
-
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
 
 static int max_opno;
 static int max_dup_opno;
@@ -782,7 +776,6 @@ main (argc, argv)
   rtx desc;
 
   progname = "genemit";
-  obstack_init (rtl_obstack);
 
   if (argc <= 1)
     fatal ("No input file name.");
index fea04928d24a8cbbfdd319bbe7b5cb5654dce921..1b653600c434960616f089cc043d59ac1f93b715 100644 (file)
@@ -23,16 +23,10 @@ Boston, MA 02111-1307, USA.  */
 #include "hconfig.h"
 #include "system.h"
 #include "rtl.h"
-#include "obstack.h"
 #include "errors.h"
 #include "insn-config.h"
 #include "gensupport.h"
 
-static struct obstack obstack;
-struct obstack *rtl_obstack = &obstack;
-
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
 
 /* This structure contains all the information needed to describe one
    set of extractions methods.  Each method may be used by more than 
@@ -396,7 +390,6 @@ main (argc, argv)
   const char *name;
 
   progname = "genextract";
-  obstack_init (rtl_obstack);
 
   if (argc <= 1)
     fatal ("No input file name.");
index f679dd2c4685c4029f31c72a8ef7a783eb044790..e96ac618e4a8a8246806dd1f03c1dee6a763ea08 100644 (file)
@@ -29,8 +29,6 @@ Boston, MA 02111-1307, USA.  */
 #include "errors.h"
 #include "gensupport.h"
 
-static struct obstack obstack;
-struct obstack *rtl_obstack = &obstack;
 
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
@@ -230,7 +228,6 @@ main (argc, argv)
   rtx *insn_ptr;
 
   progname = "genflags";
-  obstack_init (rtl_obstack);
   obstack_init (&call_obstack);
   obstack_init (&normal_obstack);
 
index 2cd5d8edb1c1aa588ae93afd14579571a6a08af7..4bcabc61a5cb78498a4dd8a1ed7cd6839daeaf93 100644 (file)
@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA.  */
 #include "hconfig.h"
 #include "system.h"
 #include "rtl.h"
-#include "obstack.h"
 #include "errors.h"
 #include "gensupport.h"
 
-static struct obstack obstack;
-struct obstack *rtl_obstack = &obstack;
-
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
 
 /* Many parts of GCC use arrays that are indexed by machine mode and
    contain the insn codes for pattern in the MD file that perform a given
@@ -316,7 +310,6 @@ main (argc, argv)
   rtx desc;
 
   progname = "genopinit";
-  obstack_init (rtl_obstack);
 
   if (argc <= 1)
     fatal ("No input file name.");
index 922359dbc6d6d4e1f969849c0d4b82481abd2a85..ce93da798361b9e0185bfeefc99c1bbd2e289b8a 100644 (file)
@@ -88,7 +88,6 @@ Boston, MA 02111-1307, USA.  */
 #include "hconfig.h"
 #include "system.h"
 #include "rtl.h"
-#include "obstack.h"
 #include "errors.h"
 #include "gensupport.h"
 
@@ -98,12 +97,6 @@ Boston, MA 02111-1307, USA.  */
 
 #define MAX_MAX_OPERANDS 40
 
-static struct obstack obstack;
-struct obstack *rtl_obstack = &obstack;
-
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
-
 static int n_occurrences               PARAMS ((int, const char *));
 static const char *strip_whitespace    PARAMS ((const char *));
 
@@ -906,7 +899,6 @@ main (argc, argv)
   rtx desc;
 
   progname = "genoutput";
-  obstack_init (rtl_obstack);
 
   if (argc <= 1)
     fatal ("No input file name.");
index b8ef9aae62bf964df9419511cd9f06f14fc0a1d7..dc90c73e2c8336c83997dc2fb6a909ded347140b 100644 (file)
@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA.  */
 #include "hconfig.h"
 #include "system.h"
 #include "rtl.h"
-#include "obstack.h"
 #include "errors.h"
 #include "gensupport.h"
 
-static struct obstack obstack;
-struct obstack *rtl_obstack = &obstack;
-
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
 
 /* While tree-walking an instruction pattern, we keep a chain
    of these `struct link's to record how to get down to the
@@ -413,7 +407,6 @@ main (argc, argv)
   max_opno = -1;
 
   progname = "genpeep";
-  obstack_init (rtl_obstack);
 
   if (argc <= 1)
     fatal ("No input file name.");
index 1f0c331b67b00f8832d7229821ca9dfdbbcdcb30..3cc438ca49b087b486b1510755585809205fbeb4 100644 (file)
 #include "hconfig.h"
 #include "system.h"
 #include "rtl.h"
-#include "obstack.h"
 #include "errors.h"
 #include "gensupport.h"
 
+
 #define OUTPUT_LABEL(INDENT_STRING, LABEL_NUMBER) \
   printf("%sL%d: ATTRIBUTE_UNUSED_LABEL\n", (INDENT_STRING), (LABEL_NUMBER))
 
-static struct obstack obstack;
-struct obstack *rtl_obstack = &obstack;
-
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
-
 /* Holds an array of names indexed by insn_code_number.  */
 static char **insn_name_ptr = 0;
 static int insn_name_ptr_size = 0;
@@ -231,9 +225,6 @@ static const char * special_mode_pred_table[] = {
 #define NUM_SPECIAL_MODE_PREDS \
   (sizeof (special_mode_pred_table) / sizeof (special_mode_pred_table[0]))
 
-static void message_with_line
-  PARAMS ((int, const char *, ...)) ATTRIBUTE_PRINTF_2;
-
 static struct decision *new_decision
   PARAMS ((const char *, struct decision_head *));
 static struct decision_test *new_decision_test
@@ -317,29 +308,6 @@ extern void debug_decision
 extern void debug_decision_list
   PARAMS ((struct decision *));
 \f
-static void
-message_with_line VPARAMS ((int lineno, const char *msg, ...))
-{
-#ifndef ANSI_PROTOTYPES
-  int lineno;
-  const char *msg;
-#endif
-  va_list ap;
-
-  VA_START (ap, msg);
-
-#ifndef ANSI_PROTOTYPES
-  lineno = va_arg (ap, int);
-  msg = va_arg (ap, const char *);
-#endif
-
-  fprintf (stderr, "%s:%d: ", read_rtx_filename, lineno);
-  vfprintf (stderr, msg, ap);
-  fputc ('\n', stderr);
-
-  va_end (ap);
-}
-\f
 /* Create a new node in sequence after LAST.  */
 
 static struct decision *
@@ -2509,7 +2477,6 @@ main (argc, argv)
   register int c;
 
   progname = "genrecog";
-  obstack_init (rtl_obstack);
 
   memset (&recog_tree, 0, sizeof recog_tree);
   memset (&split_tree, 0, sizeof split_tree);
index 9e77a97c057f1f6d507e99c398343a33f1ca1d0d..2de3f4481c3a57463f23477b4ae5f50333b541a3 100644 (file)
@@ -1,6 +1,4 @@
-/* Read machine descriptions, return top level rtx for use by the
-   various generation passes. 
-
+/* Support routines for the various generation passes.
    Copyright (C) 2000 Free Software Foundation, Inc.
 
    This file is part of GNU CC.
 #include "hconfig.h"
 #include "system.h"
 #include "rtl.h"
+#include "obstack.h"
 #include "errors.h"
 #include "gensupport.h"
 
+
+static struct obstack obstack;
+struct obstack *rtl_obstack = &obstack;
+
+#define obstack_chunk_alloc xmalloc
+#define obstack_chunk_free free
+
 static FILE *input_file;
 
 static int sequence_num;
@@ -39,7 +45,30 @@ static struct queue_elem *rtx_ready_queue;
 
 static void remove_constraints PARAMS ((rtx));
 static void process_rtx PARAMS ((rtx *));
+\f
+void
+message_with_line VPARAMS ((int lineno, const char *msg, ...))
+{
+#ifndef ANSI_PROTOTYPES
+  int lineno;
+  const char *msg;
+#endif
+  va_list ap;
+
+  VA_START (ap, msg);
+
+#ifndef ANSI_PROTOTYPES
+  lineno = va_arg (ap, int);
+  msg = va_arg (ap, const char *);
+#endif
 
+  fprintf (stderr, "%s:%d: ", read_rtx_filename, lineno);
+  vfprintf (stderr, msg, ap);
+  fputc ('\n', stderr);
+
+  va_end (ap);
+}
+\f
 /* Recursively remove constraints from an rtx.  */
 
 static void
@@ -125,23 +154,22 @@ process_rtx (desc)
       rtx_ready_queue = elem;  
     }
 }
-
+\f
 /* The entry point for initializing the reader.  */
 
 int 
 init_md_reader (filename)
     const char *filename;
 {
-
+  read_rtx_filename = filename;
   input_file = fopen (filename, "r");
-
   if (input_file == 0)
     {
       perror (filename);
       return FATAL_EXIT_CODE;
     }
 
-  read_rtx_filename = filename;
+  obstack_init (rtl_obstack);
   sequence_num = 0;
   rtx_ready_queue = NULL; 
 
index 3dbec6b74200140167c26568c20ce66bff60151e..6202f524a244f46c842e374acdc2d7d727238170 100644 (file)
@@ -18,7 +18,11 @@ along with GNU CC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+struct obstack;
+extern struct obstack *rtl_obstack;
+
 extern int init_md_reader      PARAMS ((const char *));
 extern rtx read_md_rtx         PARAMS ((int *, int *));
 
-
+extern void message_with_line  PARAMS ((int, const char *, ...))
+     ATTRIBUTE_PRINTF_2;