aboutsummaryrefslogtreecommitdiff
path: root/gcc/genflags.c
diff options
context:
space:
mode:
authorClinton Popetz <cpopetz@cygnus.com>2000-05-03 17:45:26 +0000
committerClinton Popetz <cpopetz@gcc.gnu.org>2000-05-03 13:45:26 -0400
commitc88c0d42a1ac718915fcd7c79ebe517baa624348 (patch)
tree51d16ed3ff5a009c7dd29449525fd4e9a6dc37c1 /gcc/genflags.c
parent18ca529b1976bfdc7f84b96f93d0ac3f483bf7f8 (diff)
downloadgcc-c88c0d42a1ac718915fcd7c79ebe517baa624348.zip
gcc-c88c0d42a1ac718915fcd7c79ebe517baa624348.tar.gz
gcc-c88c0d42a1ac718915fcd7c79ebe517baa624348.tar.bz2
gensupport.c: New file.
* gensupport.c: New file. * gensupport.h: New file. * Makefile.in (HOST_RTL): Depend on gensupport. (gensupport.o) New rule. * genattr.c: Use gensupport for reading .md files. * genattrtab.c: Ditto. * gencodes.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * genopinit.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * rtl.def (define_insn_and_split): New DEF_RTL_EXPR. * md.texi (Insn Splitting): Document define_insn_and_split. From-SVN: r33633
Diffstat (limited to 'gcc/genflags.c')
-rw-r--r--gcc/genflags.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/gcc/genflags.c b/gcc/genflags.c
index 39b5354..f679dd2 100644
--- a/gcc/genflags.c
+++ b/gcc/genflags.c
@@ -27,6 +27,7 @@ Boston, MA 02111-1307, USA. */
#include "rtl.h"
#include "obstack.h"
#include "errors.h"
+#include "gensupport.h"
static struct obstack obstack;
struct obstack *rtl_obstack = &obstack;
@@ -227,8 +228,6 @@ main (argc, argv)
rtx *call_insns;
rtx *normal_insns;
rtx *insn_ptr;
- FILE *infile;
- register int c;
progname = "genflags";
obstack_init (rtl_obstack);
@@ -238,14 +237,9 @@ main (argc, argv)
if (argc <= 1)
fatal ("No input file name.");
- infile = fopen (argv[1], "r");
- if (infile == 0)
- {
- perror (argv[1]);
- return (FATAL_EXIT_CODE);
- }
- read_rtx_filename = argv[1];
-
+ if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE)
+ return (FATAL_EXIT_CODE);
+
printf ("/* Generated automatically by the program `genflags'\n\
from the machine description file `md'. */\n\n");
@@ -253,12 +247,11 @@ from the machine description file `md'. */\n\n");
while (1)
{
- c = read_skip_spaces (infile);
- if (c == EOF)
- break;
- ungetc (c, infile);
+ int line_no, insn_code_number = 0;
- desc = read_rtx (infile);
+ desc = read_md_rtx (&line_no, &insn_code_number);
+ if (desc == NULL)
+ break;
if (GET_CODE (desc) == DEFINE_INSN || GET_CODE (desc) == DEFINE_EXPAND)
gen_insn (desc);
}