summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-03-24 10:16:53 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-03-24 10:16:53 +0000
commit0b93b64e20444a5a105b0cb9935b7841486559aa (patch)
tree8e8fe251c2a002a4dde07af7250735032cb7cb48
parent4c5f3fcd5a8c167c4e780243f68bab8ffccf0dc2 (diff)
downloadgcc-0b93b64e20444a5a105b0cb9935b7841486559aa.tar.gz
Cutover various gen*.c files to using system.h:
* Makefile.in (genconfig.o, genflags.o, gencodes.o, genemit.o, genopinit.o, genrecog.o, genextract.o, genpeep.o, genattr.o, genattrtab.o, genoutput.o): Depend on system.h. * genattr.c: Include system.h. Add arguments to various function prototypes. Remove redundant prototype of read_rtx(). * genattrtab.c: Likewise. * gencodes.c: Likewise. * genconfig.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * genopinit.c: Likewise. * genoutput.c: Likewise. * genpeep.c: Likewise. * genrecog.c: Likewise. From-SVN: r18794
-rw-r--r--gcc/ChangeLog19
-rw-r--r--gcc/Makefile.in22
-rw-r--r--gcc/genattr.c11
-rw-r--r--gcc/genattrtab.c24
-rw-r--r--gcc/gencodes.c9
-rw-r--r--gcc/genconfig.c15
-rw-r--r--gcc/genemit.c15
-rw-r--r--gcc/genextract.c23
-rw-r--r--gcc/genflags.c15
-rw-r--r--gcc/genopinit.c17
-rw-r--r--gcc/genoutput.c17
-rw-r--r--gcc/genpeep.c21
-rw-r--r--gcc/genrecog.c11
13 files changed, 66 insertions, 153 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 896f0be059c..fae898a9089 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,22 @@
+Tue Mar 24 12:13:18 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (genconfig.o, genflags.o, gencodes.o, genemit.o,
+ genopinit.o, genrecog.o, genextract.o, genpeep.o, genattr.o,
+ genattrtab.o, genoutput.o): Depend on system.h.
+
+ * genattr.c: Include system.h. Add arguments to various function
+ prototypes. Remove redundant prototype of read_rtx().
+ * genattrtab.c: Likewise.
+ * gencodes.c: Likewise.
+ * genconfig.c: Likewise.
+ * genemit.c: Likewise.
+ * genextract.c: Likewise.
+ * genflags.c: Likewise.
+ * genopinit.c: Likewise.
+ * genoutput.c: Likewise.
+ * genpeep.c: Likewise.
+ * genrecog.c: Likewise.
+
1998-03-24 Martin von Loewis <loewis@informatik.hu-berlin.de>
* c-lang.c (lang_print_xnode): New function.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 08fc6d5dbd5..ab0a84e6e2e 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1617,77 +1617,77 @@ genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genconfig.o $(HOST_RTL) $(HOST_LIBS)
-genconfig.o : genconfig.c $(RTL_H) $(build_xm_file)
+genconfig.o : genconfig.c $(RTL_H) $(build_xm_file) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genflags.o $(HOST_RTL) $(HOST_LIBS)
-genflags.o : genflags.c $(RTL_H) $(build_xm_file)
+genflags.o : genflags.c $(RTL_H) $(build_xm_file) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
gencodes.o $(HOST_RTL) $(HOST_LIBS)
-gencodes.o : gencodes.c $(RTL_H) $(build_xm_file)
+gencodes.o : gencodes.c $(RTL_H) $(build_xm_file) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genemit.o $(HOST_RTL) $(HOST_LIBS)
-genemit.o : genemit.c $(RTL_H) $(build_xm_file)
+genemit.o : genemit.c $(RTL_H) $(build_xm_file) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
genopinit : genopinit.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genopinit.o $(HOST_RTL) $(HOST_LIBS)
-genopinit.o : genopinit.c $(RTL_H) $(build_xm_file)
+genopinit.o : genopinit.c $(RTL_H) $(build_xm_file) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c
genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genrecog.o $(HOST_RTL) $(HOST_LIBS)
-genrecog.o : genrecog.c $(RTL_H) $(build_xm_file)
+genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genextract.o $(HOST_RTL) $(HOST_LIBS)
-genextract.o : genextract.c $(RTL_H) $(build_xm_file) insn-config.h
+genextract.o : genextract.c $(RTL_H) $(build_xm_file) system.h insn-config.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genpeep.o $(HOST_RTL) $(HOST_LIBS)
-genpeep.o : genpeep.c $(RTL_H) $(build_xm_file)
+genpeep.o : genpeep.c $(RTL_H) $(build_xm_file) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genattr.o $(HOST_RTL) $(HOST_LIBS)
-genattr.o : genattr.c $(RTL_H) $(build_xm_file)
+genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)
-genattrtab.o : genattrtab.c $(RTL_H) $(build_xm_file) insn-config.h
+genattrtab.o : genattrtab.c $(RTL_H) $(build_xm_file) system.h insn-config.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genoutput.o $(HOST_RTL) $(HOST_LIBS)
-genoutput.o : genoutput.c $(RTL_H) $(build_xm_file)
+genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) system.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
gengenrtl : gengenrtl.o $(HOST_LIBDEPS)
diff --git a/gcc/genattr.c b/gcc/genattr.c
index afeaeb43179..525dce0c2bb 100644
--- a/gcc/genattr.c
+++ b/gcc/genattr.c
@@ -20,26 +20,17 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef NEED_DECLARATION_FREE
-extern void free PROTO((void *));
-#endif
-extern rtx read_rtx PROTO((FILE *));
-
char *xmalloc PROTO((unsigned));
static void fatal ();
void fancy_abort PROTO((void));
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 49a62445776..d2b2412c485 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -102,29 +102,14 @@ Boston, MA 02111-1307, USA. */
#else
#include <varargs.h>
#endif
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "insn-config.h" /* For REGISTER_CONSTRAINTS */
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-#endif
-#endif
-
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
/* We must include obstack.h after <sys/time.h>, to avoid lossage with
/usr/include/sys/stdtypes.h on Sun OS 4.x. */
#include "obstack.h"
@@ -140,13 +125,8 @@ struct obstack *temp_obstack = &obstack2;
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
char **insn_name_ptr = 0;
-#ifdef NEED_DECLARATION_FREE
-extern void free ();
-#endif
-extern rtx read_rtx ();
-
static void fatal ();
-void fancy_abort ();
+void fancy_abort PROTO((void));
/* enough space to reserve for printing out ints */
#define MAX_DIGITS (HOST_BITS_PER_INT * 3 / 10 + 3)
diff --git a/gcc/gencodes.c b/gcc/gencodes.c
index 8baf3b83e0b..1ef7b337740 100644
--- a/gcc/gencodes.c
+++ b/gcc/gencodes.c
@@ -22,8 +22,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
@@ -33,12 +33,9 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-extern void free ();
-extern rtx read_rtx ();
-
-char *xmalloc ();
+char *xmalloc PROTO((unsigned));
static void fatal ();
-void fancy_abort ();
+void fancy_abort PROTO((void));
static int insn_code_number;
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index 0476295aecf..69f9240983f 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -20,26 +20,17 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef NEED_DECLARATION_FREE
-extern void free ();
-#endif
-extern rtx read_rtx ();
-
/* 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. */
@@ -55,9 +46,9 @@ static int max_insns_per_split = 1;
static int clobbers_seen_this_insn;
static int dup_operands_seen_this_insn;
-char *xmalloc ();
+char *xmalloc PROTO((unsigned));
static void fatal ();
-void fancy_abort ();
+void fancy_abort PROTO((void));
/* RECOG_P will be non-zero if this pattern was seen in a context where it will
be used to recognize, rather than just generate an insn.
diff --git a/gcc/genemit.c b/gcc/genemit.c
index dc5eca1502b..ddfaf383085 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -19,29 +19,20 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef NEED_DECLARATION_FREE
-extern void free ();
-#endif
-extern rtx read_rtx ();
-
-char *xmalloc ();
+char *xmalloc PROTO((unsigned));
static void fatal ();
-void fancy_abort ();
+void fancy_abort PROTO((void));
static int max_opno;
static int max_dup_opno;
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 63ab2a5fbd8..3236cde6bd1 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -19,27 +19,18 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
#include "insn-config.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef NEED_DECLARATION_FREE
-extern void free ();
-#endif
-extern rtx read_rtx ();
-
/* Names for patterns. Need to allow linking with print-rtl. */
char **insn_name_ptr;
@@ -104,14 +95,14 @@ static int dupnums[MAX_DUP_OPERANDS];
static struct code_ptr *peepholes;
-static void walk_rtx ();
-static void print_path ();
-char *xmalloc ();
-char *xrealloc ();
+static void walk_rtx PROTO ((rtx, char *));
+static void print_path PROTO ((char *));
+char *xmalloc PROTO ((unsigned));
+char *xrealloc PROTO ((char *, unsigned));
static void fatal ();
-static char *copystr ();
+static char *copystr PROTO ((char *));
static void mybzero ();
-void fancy_abort ();
+void fancy_abort PROTO ((void));
static void
gen_insn (insn)
diff --git a/gcc/genflags.c b/gcc/genflags.c
index 85aa7b07ca8..9a9db0209a5 100644
--- a/gcc/genflags.c
+++ b/gcc/genflags.c
@@ -22,29 +22,20 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef NEED_DECLARATION_FREE
-extern void free ();
-#endif
-extern rtx read_rtx ();
-
-char *xmalloc ();
+char *xmalloc PROTO((unsigned));
static void fatal ();
-void fancy_abort ();
+void fancy_abort PROTO((void));
/* Names for patterns. Need to allow linking with print-rtl. */
char **insn_name_ptr;
diff --git a/gcc/genopinit.c b/gcc/genopinit.c
index d143e2de8fd..0320c29fc0d 100644
--- a/gcc/genopinit.c
+++ b/gcc/genopinit.c
@@ -19,16 +19,10 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
-#include <ctype.h>
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
@@ -36,14 +30,9 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef NEED_DECLARATION_FREE
-extern void free ();
-#endif
-extern rtx read_rtx ();
-
-char *xmalloc ();
+char *xmalloc PROTO((unsigned));
static void fatal ();
-void fancy_abort ();
+void fancy_abort PROTO((void));
/* 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
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index 88858ed1cdc..a2d7c713b0d 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -90,15 +90,11 @@ insn_template[24] to be "clrd %0", and insn_n_operands[24] to be 1.
It would not make an case in output_insn_hairy because the template
given in the entry is a constant (it does not start with `*'). */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
/* No instruction can have more operands than this.
Sorry for this arbitrary limit, but what machine will
have an instruction with this many operands? */
@@ -111,18 +107,13 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef NEED_DECLARATION_FREE
-extern void free ();
-#endif
-extern rtx read_rtx ();
-
-char *xmalloc ();
+char *xmalloc PROTO((unsigned));
static void fatal ();
-void fancy_abort ();
+void fancy_abort PROTO((void));
static void error ();
static void mybcopy ();
static void mybzero ();
-static int n_occurrences ();
+static int n_occurrences PROTO((int, char *));
/* insns in the machine description are assigned sequential code numbers
that are used by insn-recog.c (produced by genrecog) to communicate
diff --git a/gcc/genpeep.c b/gcc/genpeep.c
index df03042551a..46646d3402b 100644
--- a/gcc/genpeep.c
+++ b/gcc/genpeep.c
@@ -19,26 +19,17 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef NEED_DECLARATION_FREE
-extern void free ();
-#endif
-extern rtx read_rtx ();
-
/* 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,
@@ -52,10 +43,10 @@ struct link
int vecelt;
};
-char *xmalloc ();
-static void match_rtx ();
+char *xmalloc PROTO((unsigned));
+static void match_rtx PROTO((rtx, struct link *, int));
static void fatal ();
-void fancy_abort ();
+void fancy_abort PROTO((void));
static int max_opno;
@@ -68,8 +59,8 @@ static int n_operands;
static int insn_code_number = 0;
-static void print_path ();
-static void print_code ();
+static void print_path PROTO((struct link *));
+static void print_code PROTO((RTX_CODE));
static void
gen_peephole (peep)
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 6e9877bf1cc..e938298f275 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -46,26 +46,17 @@ Boston, MA 02111-1307, USA. */
which returns 0 if the rtl could not be split, or
it returns the split rtl in a SEQUENCE. */
-#include <stdio.h>
#include "hconfig.h"
+#include "system.h"
#include "rtl.h"
#include "obstack.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
-#ifdef NEED_DECLARATION_FREE
-extern void free ();
-#endif
-extern rtx read_rtx ();
-
/* Data structure for a listhead of decision trees. The alternatives
to a node are kept in a doublely-linked list so we can easily add nodes
to the proper place when merging. */