This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

genfoo obstack cleanup


Make more use of gensupport.c and move rtl_obstack
manipulation there.

Bootstrapped alphaev6-linux.


r~

	* 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.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.440
diff -c -p -d -r1.440 Makefile.in
*** Makefile.in	2000/05/04 23:21:48	1.440
--- Makefile.in	2000/05/06 22:19:50
*************** HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HO
*** 590,596 ****
  	    $(HOST_CLIB)
  
  HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o \
! 		$(HOST_PREFIX)ggc-none.o $(HOST_PREFIX)gensupport.o
  
  HOST_PRINT = $(HOST_PREFIX)print-rtl.o
  HOST_ERRORS = $(HOST_PREFIX)errors.o
--- 590,596 ----
  	    $(HOST_CLIB)
  
  HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o \
! 		$(HOST_PREFIX)ggc-none.o gensupport.o
  
  HOST_PRINT = $(HOST_PREFIX)print-rtl.o
  HOST_ERRORS = $(HOST_PREFIX)errors.o
*************** toplev.o : toplev.c $(CONFIG_H) system.h
*** 1242,1248 ****
  	  -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)
--- 1242,1247 ----
*************** $(MD_FILE): $(MD_DEPS)
*** 1575,1655 ****
  	$(MD_CPP) $(MD_CPPFLAGS) $(md_file) | sed 's/^# /; /g' > tmp-$@
  	mv tmp-$@ $@
  
  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
  	$(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
  	$(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
  	$(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
  	$(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
  	$(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
  
  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
  	$(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
  	$(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
  	$(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)
  	$(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
  	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
  
  gengenrtl : gengenrtl.o $(HOST_LIBDEPS)
--- 1574,1664 ----
  	$(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 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) $(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 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 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 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 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 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 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 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) $(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 gensupport.h
  	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
  
  gengenrtl : gengenrtl.o $(HOST_LIBDEPS)
*************** $(HOST_PREFIX_1)ggc-none.o: ggc-none.c
*** 1726,1736 ****
  	rm -f $(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_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.
--- 1735,1740 ----
Index: genattr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genattr.c,v
retrieving revision 1.34
diff -c -p -d -r1.34 genattr.c
*** genattr.c	2000/05/03 17:45:25	1.34
--- genattr.c	2000/05/06 22:19:50
*************** Boston, MA 02111-1307, USA.  */
*** 23,38 ****
  #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.  */
  
  struct range
--- 23,32 ----
*************** main (argc, argv)
*** 239,245 ****
    init_range (&all_blockage);
  
    progname = "genattr";
-   obstack_init (rtl_obstack);
  
    if (argc <= 1)
      fatal ("No input file name.");
--- 233,238 ----
Index: genattrtab.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genattrtab.c,v
retrieving revision 1.75
diff -c -p -d -r1.75 genattrtab.c
*** genattrtab.c	2000/05/03 17:45:25	1.75
--- genattrtab.c	2000/05/06 22:19:50
*************** Boston, MA 02111-1307, USA.  */
*** 111,118 ****
  #include "obstack.h"
  #include "errors.h"
  
! static struct obstack obstack, obstack1, obstack2;
! struct obstack *rtl_obstack = &obstack;
  struct obstack *hash_obstack = &obstack1;
  struct obstack *temp_obstack = &obstack2;
  
--- 111,117 ----
  #include "obstack.h"
  #include "errors.h"
  
! static struct obstack obstack1, obstack2;
  struct obstack *hash_obstack = &obstack1;
  struct obstack *temp_obstack = &obstack2;
  
*************** main (argc, argv)
*** 5978,5986 ****
    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.  */
    {
--- 5977,5982 ----
*************** main (argc, argv)
*** 5993,6000 ****
    }
  #endif
  
!   progname = "genattrtab";
!   obstack_init (rtl_obstack);
    obstack_init (hash_obstack);
    obstack_init (temp_obstack);
  
--- 5989,5997 ----
    }
  #endif
  
!   if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE)
!     return (FATAL_EXIT_CODE);
! 
    obstack_init (hash_obstack);
    obstack_init (temp_obstack);
  
Index: gencodes.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gencodes.c,v
retrieving revision 1.29
diff -c -p -d -r1.29 gencodes.c
*** gencodes.c	2000/05/03 17:45:25	1.29
--- gencodes.c	2000/05/06 22:19:50
*************** Boston, MA 02111-1307, USA.  */
*** 25,40 ****
  #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;
  
  static void gen_insn PARAMS ((rtx));
--- 25,34 ----
*************** main (argc, argv)
*** 87,93 ****
    rtx desc;
  
    progname = "gencodes";
-   obstack_init (rtl_obstack);
  
    if (argc <= 1)
      fatal ("No input file name.");
--- 81,86 ----
Index: genconfig.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genconfig.c,v
retrieving revision 1.35
diff -c -p -d -r1.35 genconfig.c
*** genconfig.c	2000/05/03 17:45:25	1.35
--- genconfig.c	2000/05/06 22:19:50
*************** Boston, MA 02111-1307, USA.  */
*** 24,39 ****
  #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.  */
  static int max_dup_operands;    /* Largest number of match_dup in any insn.  */
--- 24,33 ----
*************** main (argc, argv)
*** 282,288 ****
    rtx desc;
  
    progname = "genconfig";
-   obstack_init (rtl_obstack);
  
    if (argc <= 1)
      fatal ("No input file name.");
--- 276,281 ----
Index: genemit.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genemit.c,v
retrieving revision 1.54
diff -c -p -d -r1.54 genemit.c
*** genemit.c	2000/05/03 17:45:26	1.54
--- genemit.c	2000/05/06 22:19:50
*************** Boston, MA 02111-1307, USA.  */
*** 23,38 ****
  #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;
  static int max_scratch_opno;
--- 23,32 ----
*************** main (argc, argv)
*** 782,788 ****
    rtx desc;
  
    progname = "genemit";
-   obstack_init (rtl_obstack);
  
    if (argc <= 1)
      fatal ("No input file name.");
--- 776,781 ----
Index: genextract.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genextract.c,v
retrieving revision 1.41
diff -c -p -d -r1.41 genextract.c
*** genextract.c	2000/05/03 17:45:26	1.41
--- genextract.c	2000/05/06 22:19:50
*************** Boston, MA 02111-1307, USA.  */
*** 23,39 ****
  #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 
     one pattern if the operands are in the same place.
--- 23,33 ----
*************** main (argc, argv)
*** 396,402 ****
    const char *name;
  
    progname = "genextract";
-   obstack_init (rtl_obstack);
  
    if (argc <= 1)
      fatal ("No input file name.");
--- 390,395 ----
Index: genflags.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genflags.c,v
retrieving revision 1.32
diff -c -p -d -r1.32 genflags.c
*** genflags.c	2000/05/03 17:45:26	1.32
--- genflags.c	2000/05/06 22:19:50
*************** Boston, MA 02111-1307, USA.  */
*** 29,36 ****
  #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
--- 29,34 ----
*************** main (argc, argv)
*** 230,236 ****
    rtx *insn_ptr;
  
    progname = "genflags";
-   obstack_init (rtl_obstack);
    obstack_init (&call_obstack);
    obstack_init (&normal_obstack);
  
--- 228,233 ----
Index: genopinit.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genopinit.c,v
retrieving revision 1.38
diff -c -p -d -r1.38 genopinit.c
*** genopinit.c	2000/05/03 17:45:26	1.38
--- genopinit.c	2000/05/06 22:19:50
*************** Boston, MA 02111-1307, USA.  */
*** 23,38 ****
  #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
     operation on operands of that mode.
--- 23,32 ----
*************** main (argc, argv)
*** 316,322 ****
    rtx desc;
  
    progname = "genopinit";
-   obstack_init (rtl_obstack);
  
    if (argc <= 1)
      fatal ("No input file name.");
--- 310,315 ----
Index: genoutput.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genoutput.c,v
retrieving revision 1.51
diff -c -p -d -r1.51 genoutput.c
*** genoutput.c	2000/05/03 17:45:26	1.51
--- genoutput.c	2000/05/06 22:19:50
*************** Boston, MA 02111-1307, USA.  */
*** 88,94 ****
  #include "hconfig.h"
  #include "system.h"
  #include "rtl.h"
- #include "obstack.h"
  #include "errors.h"
  #include "gensupport.h"
  
--- 88,93 ----
*************** Boston, MA 02111-1307, USA.  */
*** 98,109 ****
  
  #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 *));
  
--- 97,102 ----
*************** main (argc, argv)
*** 906,912 ****
    rtx desc;
  
    progname = "genoutput";
-   obstack_init (rtl_obstack);
  
    if (argc <= 1)
      fatal ("No input file name.");
--- 899,904 ----
Index: genpeep.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genpeep.c,v
retrieving revision 1.42
diff -c -p -d -r1.42 genpeep.c
*** genpeep.c	2000/05/03 17:45:26	1.42
--- genpeep.c	2000/05/06 22:19:50
*************** Boston, MA 02111-1307, USA.  */
*** 23,38 ****
  #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
     current position.  In each one, POS is the operand number,
--- 23,32 ----
*************** main (argc, argv)
*** 413,419 ****
    max_opno = -1;
  
    progname = "genpeep";
-   obstack_init (rtl_obstack);
  
    if (argc <= 1)
      fatal ("No input file name.");
--- 407,412 ----
Index: genrecog.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genrecog.c,v
retrieving revision 1.79
diff -c -p -d -r1.79 genrecog.c
*** genrecog.c	2000/05/03 17:45:26	1.79
--- genrecog.c	2000/05/06 22:19:50
***************
*** 53,71 ****
  #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;
--- 53,65 ----
  #include "hconfig.h"
  #include "system.h"
  #include "rtl.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))
  
  /* Holds an array of names indexed by insn_code_number.  */
  static char **insn_name_ptr = 0;
  static int insn_name_ptr_size = 0;
*************** static const char * special_mode_pred_ta
*** 231,239 ****
  #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
--- 225,230 ----
*************** extern void debug_decision
*** 317,345 ****
  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 *
--- 308,313 ----
*************** main (argc, argv)
*** 2509,2515 ****
    register int c;
  
    progname = "genrecog";
-   obstack_init (rtl_obstack);
  
    memset (&recog_tree, 0, sizeof recog_tree);
    memset (&split_tree, 0, sizeof split_tree);
--- 2477,2482 ----
Index: gensupport.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gensupport.c,v
retrieving revision 1.3
diff -c -p -d -r1.3 gensupport.c
*** gensupport.c	2000/05/04 17:58:40	1.3
--- gensupport.c	2000/05/06 22:19:50
***************
*** 1,6 ****
! /* Read machine descriptions, return top level rtx for use by the
!    various generation passes. 
! 
     Copyright (C) 2000 Free Software Foundation, Inc.
  
     This file is part of GNU CC.
--- 1,4 ----
! /* Support routines for the various generation passes.
     Copyright (C) 2000 Free Software Foundation, Inc.
  
     This file is part of GNU CC.
***************
*** 23,31 ****
--- 21,37 ----
  #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;
*************** static struct queue_elem *rtx_ready_queu
*** 39,45 ****
--- 45,74 ----
  
  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
*************** process_rtx (desc)
*** 125,147 ****
        rtx_ready_queue = elem;  
      }
  }
! 
  /* The entry point for initializing the reader.  */
  
  int 
  init_md_reader (filename)
      const char *filename;
  {
! 
    input_file = fopen (filename, "r");
- 
    if (input_file == 0)
      {
        perror (filename);
        return FATAL_EXIT_CODE;
      }
  
!   read_rtx_filename = filename;
    sequence_num = 0;
    rtx_ready_queue = NULL; 
  
--- 154,175 ----
        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;
      }
  
!   obstack_init (rtl_obstack);
    sequence_num = 0;
    rtx_ready_queue = NULL; 
  
Index: gensupport.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gensupport.h,v
retrieving revision 1.1
diff -c -p -d -r1.1 gensupport.h
*** gensupport.h	2000/05/03 17:45:26	1.1
--- gensupport.h	2000/05/06 22:19:50
*************** along with GNU CC; see the file COPYING.
*** 18,24 ****
  the Free Software Foundation, 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
  
  extern int init_md_reader	PARAMS ((const char *));
  extern rtx read_md_rtx		PARAMS ((int *, int *));
  
! 
--- 18,28 ----
  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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]