Commit 3916d6d8 by Richard Henderson Committed by Richard Henderson

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
parent efdbc6f8
2000-05-06 Richard Henderson <rth@cygnus.com> 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. * c-typeck.c (build_c_cast): Remove dead code.
2000-05-06 Richard Henderson <rth@cygnus.com> 2000-05-06 Richard Henderson <rth@cygnus.com>
......
...@@ -590,7 +590,7 @@ HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \ ...@@ -590,7 +590,7 @@ HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
$(HOST_CLIB) $(HOST_CLIB)
HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o \ 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_PRINT = $(HOST_PREFIX)print-rtl.o
HOST_ERRORS = $(HOST_PREFIX)errors.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 \ ...@@ -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,^\./,,'` -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h $(GGC_H) toplev.h 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) 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) rtlanal.o : rtlanal.c $(CONFIG_H) system.h $(RTL_H)
...@@ -1575,81 +1574,91 @@ $(MD_FILE): $(MD_DEPS) ...@@ -1575,81 +1574,91 @@ $(MD_FILE): $(MD_DEPS)
$(MD_CPP) $(MD_CPPFLAGS) $(md_file) | sed 's/^# /; /g' > tmp-$@ $(MD_CPP) $(MD_CPPFLAGS) $(md_file) | sed 's/^# /; /g' > tmp-$@
mv 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) genconfig : genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) 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 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
genflags : genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) genflags : genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) 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 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
gencodes : gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) gencodes : gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) 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 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
genemit : genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) genemit : genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) 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 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
genopinit : genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) genopinit : genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) 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 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c
genrecog : genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) genrecog : genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) system.h errors.h genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) \
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c 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) genextract : genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) 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 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
genpeep : genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) genpeep : genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) 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 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
genattr : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) genattr : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) 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 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) 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 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
genoutput : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) genoutput : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS) 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 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
gengenrtl : gengenrtl.o $(HOST_LIBDEPS) gengenrtl : gengenrtl.o $(HOST_LIBDEPS)
...@@ -1727,11 +1736,6 @@ $(HOST_PREFIX_1)ggc-none.o: ggc-none.c ...@@ -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 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_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. # Remake internationalization support.
......
...@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h"
#include "errors.h" #include "errors.h"
#include "gensupport.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. */ /* A range of values. */
...@@ -239,7 +233,6 @@ main (argc, argv) ...@@ -239,7 +233,6 @@ main (argc, argv)
init_range (&all_blockage); init_range (&all_blockage);
progname = "genattr"; progname = "genattr";
obstack_init (rtl_obstack);
if (argc <= 1) if (argc <= 1)
fatal ("No input file name."); fatal ("No input file name.");
......
...@@ -111,8 +111,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -111,8 +111,7 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h" #include "obstack.h"
#include "errors.h" #include "errors.h"
static struct obstack obstack, obstack1, obstack2; static struct obstack obstack1, obstack2;
struct obstack *rtl_obstack = &obstack;
struct obstack *hash_obstack = &obstack1; struct obstack *hash_obstack = &obstack1;
struct obstack *temp_obstack = &obstack2; struct obstack *temp_obstack = &obstack2;
...@@ -5978,9 +5977,6 @@ main (argc, argv) ...@@ -5978,9 +5977,6 @@ main (argc, argv)
if (argc <= 1) if (argc <= 1)
fatal ("No input file name."); 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) #if defined (RLIMIT_STACK) && defined (HAVE_GETRLIMIT) && defined (HAVE_SETRLIMIT)
/* Get rid of any avoidable limit on stack size. */ /* Get rid of any avoidable limit on stack size. */
{ {
...@@ -5993,8 +5989,9 @@ main (argc, argv) ...@@ -5993,8 +5989,9 @@ main (argc, argv)
} }
#endif #endif
progname = "genattrtab"; if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE)
obstack_init (rtl_obstack); return (FATAL_EXIT_CODE);
obstack_init (hash_obstack); obstack_init (hash_obstack);
obstack_init (temp_obstack); obstack_init (temp_obstack);
......
...@@ -25,15 +25,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -25,15 +25,9 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h"
#include "errors.h" #include "errors.h"
#include "gensupport.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; static int insn_code_number;
...@@ -87,7 +81,6 @@ main (argc, argv) ...@@ -87,7 +81,6 @@ main (argc, argv)
rtx desc; rtx desc;
progname = "gencodes"; progname = "gencodes";
obstack_init (rtl_obstack);
if (argc <= 1) if (argc <= 1)
fatal ("No input file name."); fatal ("No input file name.");
......
...@@ -24,15 +24,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -24,15 +24,9 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h"
#include "errors.h" #include "errors.h"
#include "gensupport.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. */ /* flags to determine output of machine description dependent #define's. */
static int max_recog_operands; /* Largest operand number seen. */ static int max_recog_operands; /* Largest operand number seen. */
...@@ -282,7 +276,6 @@ main (argc, argv) ...@@ -282,7 +276,6 @@ main (argc, argv)
rtx desc; rtx desc;
progname = "genconfig"; progname = "genconfig";
obstack_init (rtl_obstack);
if (argc <= 1) if (argc <= 1)
fatal ("No input file name."); fatal ("No input file name.");
......
...@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h"
#include "errors.h" #include "errors.h"
#include "gensupport.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_opno;
static int max_dup_opno; static int max_dup_opno;
...@@ -782,7 +776,6 @@ main (argc, argv) ...@@ -782,7 +776,6 @@ main (argc, argv)
rtx desc; rtx desc;
progname = "genemit"; progname = "genemit";
obstack_init (rtl_obstack);
if (argc <= 1) if (argc <= 1)
fatal ("No input file name."); fatal ("No input file name.");
......
...@@ -23,16 +23,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,16 +23,10 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h"
#include "errors.h" #include "errors.h"
#include "insn-config.h" #include "insn-config.h"
#include "gensupport.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 /* This structure contains all the information needed to describe one
set of extractions methods. Each method may be used by more than set of extractions methods. Each method may be used by more than
...@@ -396,7 +390,6 @@ main (argc, argv) ...@@ -396,7 +390,6 @@ main (argc, argv)
const char *name; const char *name;
progname = "genextract"; progname = "genextract";
obstack_init (rtl_obstack);
if (argc <= 1) if (argc <= 1)
fatal ("No input file name."); fatal ("No input file name.");
......
...@@ -29,8 +29,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,8 +29,6 @@ Boston, MA 02111-1307, USA. */
#include "errors.h" #include "errors.h"
#include "gensupport.h" #include "gensupport.h"
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free #define obstack_chunk_free free
...@@ -230,7 +228,6 @@ main (argc, argv) ...@@ -230,7 +228,6 @@ main (argc, argv)
rtx *insn_ptr; rtx *insn_ptr;
progname = "genflags"; progname = "genflags";
obstack_init (rtl_obstack);
obstack_init (&call_obstack); obstack_init (&call_obstack);
obstack_init (&normal_obstack); obstack_init (&normal_obstack);
......
...@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h"
#include "errors.h" #include "errors.h"
#include "gensupport.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 /* 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 contain the insn codes for pattern in the MD file that perform a given
...@@ -316,7 +310,6 @@ main (argc, argv) ...@@ -316,7 +310,6 @@ main (argc, argv)
rtx desc; rtx desc;
progname = "genopinit"; progname = "genopinit";
obstack_init (rtl_obstack);
if (argc <= 1) if (argc <= 1)
fatal ("No input file name."); fatal ("No input file name.");
......
...@@ -88,7 +88,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -88,7 +88,6 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h"
#include "errors.h" #include "errors.h"
#include "gensupport.h" #include "gensupport.h"
...@@ -98,12 +97,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -98,12 +97,6 @@ Boston, MA 02111-1307, USA. */
#define MAX_MAX_OPERANDS 40 #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 int n_occurrences PARAMS ((int, const char *));
static const char *strip_whitespace PARAMS ((const char *)); static const char *strip_whitespace PARAMS ((const char *));
...@@ -906,7 +899,6 @@ main (argc, argv) ...@@ -906,7 +899,6 @@ main (argc, argv)
rtx desc; rtx desc;
progname = "genoutput"; progname = "genoutput";
obstack_init (rtl_obstack);
if (argc <= 1) if (argc <= 1)
fatal ("No input file name."); fatal ("No input file name.");
......
...@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,15 +23,9 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h"
#include "errors.h" #include "errors.h"
#include "gensupport.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 /* While tree-walking an instruction pattern, we keep a chain
of these `struct link's to record how to get down to the of these `struct link's to record how to get down to the
...@@ -413,7 +407,6 @@ main (argc, argv) ...@@ -413,7 +407,6 @@ main (argc, argv)
max_opno = -1; max_opno = -1;
progname = "genpeep"; progname = "genpeep";
obstack_init (rtl_obstack);
if (argc <= 1) if (argc <= 1)
fatal ("No input file name."); fatal ("No input file name.");
......
...@@ -53,19 +53,13 @@ ...@@ -53,19 +53,13 @@
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h"
#include "errors.h" #include "errors.h"
#include "gensupport.h" #include "gensupport.h"
#define OUTPUT_LABEL(INDENT_STRING, LABEL_NUMBER) \ #define OUTPUT_LABEL(INDENT_STRING, LABEL_NUMBER) \
printf("%sL%d: ATTRIBUTE_UNUSED_LABEL\n", (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. */ /* Holds an array of names indexed by insn_code_number. */
static char **insn_name_ptr = 0; static char **insn_name_ptr = 0;
static int insn_name_ptr_size = 0; static int insn_name_ptr_size = 0;
...@@ -231,9 +225,6 @@ static const char * special_mode_pred_table[] = { ...@@ -231,9 +225,6 @@ static const char * special_mode_pred_table[] = {
#define NUM_SPECIAL_MODE_PREDS \ #define NUM_SPECIAL_MODE_PREDS \
(sizeof (special_mode_pred_table) / sizeof (special_mode_pred_table[0])) (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 static struct decision *new_decision
PARAMS ((const char *, struct decision_head *)); PARAMS ((const char *, struct decision_head *));
static struct decision_test *new_decision_test static struct decision_test *new_decision_test
...@@ -317,29 +308,6 @@ extern void debug_decision ...@@ -317,29 +308,6 @@ extern void debug_decision
extern void debug_decision_list extern void debug_decision_list
PARAMS ((struct decision *)); 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. */ /* Create a new node in sequence after LAST. */
static struct decision * static struct decision *
...@@ -2509,7 +2477,6 @@ main (argc, argv) ...@@ -2509,7 +2477,6 @@ main (argc, argv)
register int c; register int c;
progname = "genrecog"; progname = "genrecog";
obstack_init (rtl_obstack);
memset (&recog_tree, 0, sizeof recog_tree); memset (&recog_tree, 0, sizeof recog_tree);
memset (&split_tree, 0, sizeof split_tree); memset (&split_tree, 0, sizeof split_tree);
......
/* Read machine descriptions, return top level rtx for use by the /* Support routines for the various generation passes.
various generation passes.
Copyright (C) 2000 Free Software Foundation, Inc. Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -23,9 +21,17 @@ ...@@ -23,9 +21,17 @@
#include "hconfig.h" #include "hconfig.h"
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h"
#include "errors.h" #include "errors.h"
#include "gensupport.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 FILE *input_file;
static int sequence_num; static int sequence_num;
...@@ -39,7 +45,30 @@ static struct queue_elem *rtx_ready_queue; ...@@ -39,7 +45,30 @@ static struct queue_elem *rtx_ready_queue;
static void remove_constraints PARAMS ((rtx)); static void remove_constraints PARAMS ((rtx));
static void process_rtx 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. */ /* Recursively remove constraints from an rtx. */
static void static void
...@@ -125,23 +154,22 @@ process_rtx (desc) ...@@ -125,23 +154,22 @@ process_rtx (desc)
rtx_ready_queue = elem; rtx_ready_queue = elem;
} }
} }
/* The entry point for initializing the reader. */ /* The entry point for initializing the reader. */
int int
init_md_reader (filename) init_md_reader (filename)
const char *filename; const char *filename;
{ {
read_rtx_filename = filename;
input_file = fopen (filename, "r"); input_file = fopen (filename, "r");
if (input_file == 0) if (input_file == 0)
{ {
perror (filename); perror (filename);
return FATAL_EXIT_CODE; return FATAL_EXIT_CODE;
} }
read_rtx_filename = filename; obstack_init (rtl_obstack);
sequence_num = 0; sequence_num = 0;
rtx_ready_queue = NULL; rtx_ready_queue = NULL;
......
...@@ -18,7 +18,11 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -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, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
struct obstack;
extern struct obstack *rtl_obstack;
extern int init_md_reader PARAMS ((const char *)); extern int init_md_reader PARAMS ((const char *));
extern rtx read_md_rtx PARAMS ((int *, int *)); extern rtx read_md_rtx PARAMS ((int *, int *));
extern void message_with_line PARAMS ((int, const char *, ...))
ATTRIBUTE_PRINTF_2;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment