From da9b36b02f21a7c928496290d18041bbbe05e6d4 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sat, 19 Mar 2016 02:58:57 -0400 Subject: [PATCH 04/39] FIXME: call read_md_files from rtl-frontend.c --- gcc/rtl/Make-lang.in | 4 +++- gcc/rtl/rtl-errors.c | 32 ++++++++++++++++++++++++++++++++ gcc/rtl/rtl-frontend.c | 30 +++++++++++++++++++++--------- 3 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 gcc/rtl/rtl-errors.c diff --git a/gcc/rtl/Make-lang.in b/gcc/rtl/Make-lang.in index f92ec24..19d5842 100644 --- a/gcc/rtl/Make-lang.in +++ b/gcc/rtl/Make-lang.in @@ -29,7 +29,9 @@ rtl: rtl1$(exeext) rtl-warn = $(STRICT_WARN) RTL_OBJS = \ - rtl/rtl-frontend.o + rtl/rtl-errors.o \ + rtl/rtl-frontend.o \ + read-md.o rtl1$(exeext): $(RTL_OBJS) attribs.o $(BACKEND) $(LIBDEPS) +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ diff --git a/gcc/rtl/rtl-errors.c b/gcc/rtl/rtl-errors.c new file mode 100644 index 0000000..106295f --- /dev/null +++ b/gcc/rtl/rtl-errors.c @@ -0,0 +1,32 @@ +/* rtl-error.c - Replacement for errors.c for use by RTL frontend + Copyright (C) 2016 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "errors.h" + +void fatal (const char *, ...) +{ + // TODO + abort (); +} + +int have_error; + diff --git a/gcc/rtl/rtl-frontend.c b/gcc/rtl/rtl-frontend.c index 44ef921..14ff81a 100644 --- a/gcc/rtl/rtl-frontend.c +++ b/gcc/rtl/rtl-frontend.c @@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" #include "langhooks-def.h" #include "common/common-target.h" - +#include "read-md.h" #include /* Language-dependent contents of a type. */ @@ -107,8 +107,9 @@ rtl_langhook_option_lang_mask (void) /* Initialize the options structure. */ static void -rtl_langhook_init_options_struct (struct gcc_options *opts) +rtl_langhook_init_options_struct (struct gcc_options */*opts*/) { +#if 0 /* Go says that signed overflow is precisely defined. */ opts->x_flag_wrapv = 1; @@ -138,18 +139,29 @@ rtl_langhook_init_options_struct (struct gcc_options *opts) by default. In post_options we will set the debug type if the debug info level was not set back to 0 on the command line. */ opts->x_debug_info_level = DINFO_LEVEL_TERSE; +#endif } static void -rtl_langhook_parse_file (void) +directive_handler (file_location loc, const char *name) { -#if 0 - rtl_parse_input_files (in_fnames, num_in_fnames, flag_syntax_only, - rtl_require_return_statement); + fprintf (stderr, "directive: %s\n", name); +} - /* Final processing of globals and early debug info generation. */ - rtl_write_globals (); -#endif +static void +rtl_langhook_parse_file (void) +{ + auto_vec argv (num_in_fnames + 1); + argv.safe_push (progname); + for (unsigned i = 0; i < num_in_fnames; i++) + argv.safe_push (in_fnames[i]); + if (read_md_files (argv.length (), argv.address (), NULL, + directive_handler)) + { + } + else + { + } } static tree -- 1.8.5.3