diff options
author | Daniel Franke <franke.daniel@gmail.com> | 2008-05-25 18:37:41 -0400 |
---|---|---|
committer | Daniel Franke <dfranke@gcc.gnu.org> | 2008-05-25 18:37:41 -0400 |
commit | 670637ee80cf6a86884d3ac1317992e991482a1e (patch) | |
tree | 9d6609dea095d4ea5b2bebb6f1ba50daa94929f5 /gcc/fortran/f95-lang.c | |
parent | 4cea6c02f134f16f8704767f0ce6435a13eec371 (diff) | |
download | gcc-670637ee80cf6a86884d3ac1317992e991482a1e.zip gcc-670637ee80cf6a86884d3ac1317992e991482a1e.tar.gz gcc-670637ee80cf6a86884d3ac1317992e991482a1e.tar.bz2 |
re PR fortran/18428 (No preprocessing option -cpp for gfortran)
gcc:
2008-05-26 Daniel Franke <franke.daniel@gmail.com>
PR fortran/18428
* c.opt: Removed undocumented option '-lang-fortran'.
* c-common.h: Removed global variable 'lang_fortran'.
* c-opts.c (c_common_handle_option): Removed code to handle
option '-lang-fortran'. Updated includes.
* c-cppbuiltin.c (c_cpp_builtins): Removed conditional
definition of '__GFORTRAN__'.
(define__GNUC__): Reimplemented to use BASEVER and
cpp_define_formatted.
(builtin_define_with_value_n): Removed.
* c-incpath.h: Renamed to ...
* incpath.h: ... this.
* c-incpath.c: Renamed to ...
* incpath.c: ... this. Updated includes.
* fix-header.c: Updated includes.
* Makefile.in: Replaced c-incpath.[ch] by incpath.[ch].
(c-cppbuiltin.o): Added dependency on and definition of BASEVER.
(OBJ-archive): Added cppdefault.o, incpath.o and prefix.o.
gcc/cp:
2008-05-26 Daniel Franke <franke.daniel@gmail.com>
* Makefile.in: Adjusted dependencies on c-incpath.o.
gcc/fortran:
2008-05-26 Daniel Franke <franke.daniel@gmail.com>
PR fortran/18428
* lang.opt (A, C, CC, D, E, H, P, U, cpp, d, fworking-directory,
imultilib, iprefix, iquote, isysroot, isystem, nocpp, nostdinc,
o, undef, v): New options.
* options.c (gfc_init_options): Also initialize preprocessor
options.
(gfc_post_options): Also handle post-initialization of preprocessor
options.
(gfc_handle_option): Check if option is a preprocessor option.
If yes, let gfc_cpp_handle_option() handle the option.
* lang-specs.h: Reorganized to handle new options.
* scanner.c (gfc_new_file): Read temporary file instead of
input source if preprocessing is enabled.
* f95-lang.c (gfc_init): Initialize preprocessor.
(gfc_finish): Clean up preprocessor.
* cpp.c: New.
* cpp.h: New.
* Make-lang.in: Added new objects and dependencies.
* gfortran.texi: Updated section "Preprocessing and
conditional compilation".
* invoke.texi: Added new section "Preprocessing Options",
listed and documented the preprocessing options handled by gfortran.
From-SVN: r135882
Diffstat (limited to 'gcc/fortran/f95-lang.c')
-rw-r--r-- | gcc/fortran/f95-lang.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index 58e3127..63c380b 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -45,6 +45,7 @@ along with GCC; see the file COPYING3. If not see #include "cgraph.h" #include "gfortran.h" +#include "cpp.h" #include "trans.h" #include "trans-types.h" #include "trans-const.h" @@ -275,18 +276,25 @@ gfc_be_parse_file (int set_yydebug ATTRIBUTE_UNUSED) static bool gfc_init (void) { - linemap_add (line_table, LC_ENTER, false, gfc_source_file, 1); - linemap_add (line_table, LC_RENAME, false, "<built-in>", 0); + if (!gfc_cpp_enabled ()) + { + linemap_add (line_table, LC_ENTER, false, gfc_source_file, 1); + linemap_add (line_table, LC_RENAME, false, "<built-in>", 0); + } + else + gfc_cpp_init_0 (); - /* First initialize the backend. */ gfc_init_decl_processing (); gfc_static_ctors = NULL_TREE; - /* Then the frontend. */ + if (gfc_cpp_enabled ()) + gfc_cpp_init (); + gfc_init_1 (); if (gfc_new_file () != SUCCESS) fatal_error ("can't open input file: %s", gfc_source_file); + return true; } @@ -294,6 +302,7 @@ gfc_init (void) static void gfc_finish (void) { + gfc_cpp_done (); gfc_done_1 (); gfc_release_include_path (); return; |