diff options
author | Richard Henderson <rth@cygnus.com> | 2000-05-06 15:30:13 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-05-06 15:30:13 -0700 |
commit | 3916d6d89c004a2e8b59b99ec2dd0b7ae3a01972 (patch) | |
tree | 51eb3b35d4bfb3e523bdf3eb12a95f8b995170ba /gcc | |
parent | efdbc6f8fd6bfb88a8dfe05a3e8bf0c1347e2f4d (diff) | |
download | gcc-3916d6d89c004a2e8b59b99ec2dd0b7ae3a01972.zip gcc-3916d6d89c004a2e8b59b99ec2dd0b7ae3a01972.tar.gz gcc-3916d6d89c004a2e8b59b99ec2dd0b7ae3a01972.tar.bz2 |
Makefile.in (gensupport.o): Compile for the host.
* 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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 26 | ||||
-rw-r--r-- | gcc/Makefile.in | 44 | ||||
-rw-r--r-- | gcc/genattr.c | 7 | ||||
-rw-r--r-- | gcc/genattrtab.c | 11 | ||||
-rw-r--r-- | gcc/gencodes.c | 7 | ||||
-rw-r--r-- | gcc/genconfig.c | 7 | ||||
-rw-r--r-- | gcc/genemit.c | 7 | ||||
-rw-r--r-- | gcc/genextract.c | 7 | ||||
-rw-r--r-- | gcc/genflags.c | 3 | ||||
-rw-r--r-- | gcc/genopinit.c | 7 | ||||
-rw-r--r-- | gcc/genoutput.c | 8 | ||||
-rw-r--r-- | gcc/genpeep.c | 7 | ||||
-rw-r--r-- | gcc/genrecog.c | 35 | ||||
-rw-r--r-- | gcc/gensupport.c | 42 | ||||
-rw-r--r-- | gcc/gensupport.h | 6 |
15 files changed, 95 insertions, 129 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9c7525d..f8a6406 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,31 @@ 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. 2000-05-06 Richard Henderson <rth@cygnus.com> diff --git a/gcc/Makefile.in b/gcc/Makefile.in index c1eaee8..5350b00 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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 - # # Remake internationalization support. diff --git a/gcc/genattr.c b/gcc/genattr.c index 36a37b1..9207876 100644 --- a/gcc/genattr.c +++ b/gcc/genattr.c @@ -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."); diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index b1be9a0..2c09e3d 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -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); diff --git a/gcc/gencodes.c b/gcc/gencodes.c index 750839b..0e36e9f 100644 --- a/gcc/gencodes.c +++ b/gcc/gencodes.c @@ -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."); diff --git a/gcc/genconfig.c b/gcc/genconfig.c index 0772162..a18f896 100644 --- a/gcc/genconfig.c +++ b/gcc/genconfig.c @@ -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."); diff --git a/gcc/genemit.c b/gcc/genemit.c index 6fc604d..f559eb9 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -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."); diff --git a/gcc/genextract.c b/gcc/genextract.c index fea0492..1b65360 100644 --- a/gcc/genextract.c +++ b/gcc/genextract.c @@ -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."); diff --git a/gcc/genflags.c b/gcc/genflags.c index f679dd2..e96ac61 100644 --- a/gcc/genflags.c +++ b/gcc/genflags.c @@ -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); diff --git a/gcc/genopinit.c b/gcc/genopinit.c index 2cd5d8e..4bcabc6 100644 --- a/gcc/genopinit.c +++ b/gcc/genopinit.c @@ -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."); diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 922359db..ce93da7 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -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."); diff --git a/gcc/genpeep.c b/gcc/genpeep.c index b8ef9aa..dc90c73 100644 --- a/gcc/genpeep.c +++ b/gcc/genpeep.c @@ -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."); diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 1f0c331..3cc438c 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -53,19 +53,13 @@ #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 *)); -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); -} - /* 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); diff --git a/gcc/gensupport.c b/gcc/gensupport.c index 9e77a97..2de3f44 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -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. @@ -23,9 +21,17 @@ #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 *)); + +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); +} + /* Recursively remove constraints from an rtx. */ static void @@ -125,23 +154,22 @@ process_rtx (desc) rtx_ready_queue = elem; } } - + /* 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; diff --git a/gcc/gensupport.h b/gcc/gensupport.h index 3dbec6b..6202f52 100644 --- a/gcc/gensupport.h +++ b/gcc/gensupport.h @@ -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; |