diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-05-06 22:30:13 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-05-06 22:30:13 +0000 |
commit | 96d905e54aa10708be91d109782d9718ae6d2415 (patch) | |
tree | 51eb3b35d4bfb3e523bdf3eb12a95f8b995170ba /gcc | |
parent | 41d97855537eb82afe92fd74f982bc012626b8db (diff) | |
download | gcc-96d905e54aa10708be91d109782d9718ae6d2415.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33742 138bc75d-0d04-0410-961f-82ee72b054a4
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 9c7525de849..f8a6406d363 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 c1eaee80c9d..5350b00767a 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 36a37b1a408..9207876e817 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 b1be9a070e4..2c09e3d5fb2 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 750839b39c8..0e36e9fd52d 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 077216292e9..a18f896a5b9 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 6fc604d7c23..f559eb97869 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 fea04928d24..1b653600c43 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 f679dd2c468..e96ac618e4a 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 2cd5d8edb1c..4bcabc61a5c 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 922359dbc6d..ce93da79836 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 b8ef9aae62b..dc90c73e2c8 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 1f0c331b67b..3cc438ca49b 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 9e77a97c057..2de3f4481c3 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 3dbec6b7420..6202f524a24 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; |