diff options
author | Tobias Burnus <burnus@net-b.de> | 2014-12-17 07:29:30 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2014-12-17 07:29:30 +0100 |
commit | f19626cf3086867bd69b25c5113e159289107ce4 (patch) | |
tree | 32e51ec198310663e2c4886fe09010eaa133946a /gcc/fortran/options.c | |
parent | 69044fa9eb7eac6f9176861154b7e06125209671 (diff) | |
download | gcc-f19626cf3086867bd69b25c5113e159289107ce4.tar.gz |
re PR fortran/54687 (Use gcc option machinery for gfortran)
2014-12-17 Tobias Burnus <burnus@net-b.de>
PR fortran/54687
gcc/
* flag-types.h (gfc_init_local_real, gfc_fcoarray,
gfc_convert): New enums; moved from fortran/.
gcc/fortran/
* gfortran.h (gfc_option_t): Remove flags which now
have a Var().
(init_local_real, gfc_fcoarray): Moved to ../flag-types.h.
* libgfortran.h (unit_convert): Add comment.
* lang.opt (flag-convert, flag-init_real, flag-coarray):
Add Var() and Enum().
* options.c (gfc_handle_coarray_option): Remove.
(gfc_init_options, gfc_post_options, gfc_handle_option):
Update for *.opt changes.
* array.c: Update for flag-variable name changes.
* check.c: Ditto.
* match.c: Ditto.
* resolve.c: Ditto.
* simplify.c: Ditto.
* trans-array.c: Ditto.
* trans-decl.c: Ditto.
* trans-expr.c: Ditto.
* trans-intrinsic.c: Ditto.
* trans-stmt.c: Ditto.
* trans-types.c: Ditto.
* trans.c: Ditto.
From-SVN: r218808
Diffstat (limited to 'gcc/fortran/options.c')
-rw-r--r-- | gcc/fortran/options.c | 55 |
1 files changed, 1 insertions, 54 deletions
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index 5dcb5d84b09..307688a1b69 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -84,14 +84,12 @@ gfc_init_options (unsigned int decoded_options_count, gfc_option.max_continue_fixed = 255; gfc_option.max_continue_free = 255; gfc_option.max_identifier_length = GFC_MAX_SYMBOL_LEN; - gfc_option.convert = GFC_CONVERT_NATIVE; gfc_option.max_errors = 25; gfc_option.flag_preprocessed = 0; gfc_option.flag_d_lines = -1; gfc_option.flag_init_integer = GFC_INIT_INTEGER_OFF; gfc_option.flag_init_integer_value = 0; - gfc_option.flag_init_real = GFC_INIT_REAL_OFF; gfc_option.flag_init_logical = GFC_INIT_LOGICAL_OFF; gfc_option.flag_init_character = GFC_INIT_CHARACTER_OFF; gfc_option.flag_init_character_value = (char)0; @@ -102,7 +100,6 @@ gfc_init_options (unsigned int decoded_options_count, | GFC_FPE_ZERO | GFC_FPE_OVERFLOW | GFC_FPE_UNDERFLOW; gfc_option.rtcheck = 0; - gfc_option.coarray = GFC_FCOARRAY_NONE; /* ??? Wmissing-include-dirs is disabled by default in C/C++ but enabled by default in Fortran. Ideally, we should express this @@ -469,20 +466,6 @@ gfc_handle_fpe_option (const char *arg, bool trap) static void -gfc_handle_coarray_option (const char *arg) -{ - if (strcmp (arg, "none") == 0) - gfc_option.coarray = GFC_FCOARRAY_NONE; - else if (strcmp (arg, "single") == 0) - gfc_option.coarray = GFC_FCOARRAY_SINGLE; - else if (strcmp (arg, "lib") == 0) - gfc_option.coarray = GFC_FCOARRAY_LIB; - else - gfc_fatal_error ("Argument to %<-fcoarray%> is not valid: %s", arg); -} - - -static void gfc_handle_runtime_check_option (const char *arg) { int result, pos = 0, n; @@ -596,7 +579,7 @@ gfc_handle_option (size_t scode, const char *arg, int value, case OPT_finit_local_zero: gfc_option.flag_init_integer = GFC_INIT_INTEGER_ON; gfc_option.flag_init_integer_value = 0; - gfc_option.flag_init_real = GFC_INIT_REAL_ZERO; + flag_init_real = GFC_INIT_REAL_ZERO; gfc_option.flag_init_logical = GFC_INIT_LOGICAL_FALSE; gfc_option.flag_init_character = GFC_INIT_CHARACTER_ON; gfc_option.flag_init_character_value = (char)0; @@ -612,22 +595,6 @@ gfc_handle_option (size_t scode, const char *arg, int value, arg); break; - case OPT_finit_real_: - if (!strcasecmp (arg, "zero")) - gfc_option.flag_init_real = GFC_INIT_REAL_ZERO; - else if (!strcasecmp (arg, "nan")) - gfc_option.flag_init_real = GFC_INIT_REAL_NAN; - else if (!strcasecmp (arg, "snan")) - gfc_option.flag_init_real = GFC_INIT_REAL_SNAN; - else if (!strcasecmp (arg, "inf")) - gfc_option.flag_init_real = GFC_INIT_REAL_INF; - else if (!strcasecmp (arg, "-inf")) - gfc_option.flag_init_real = GFC_INIT_REAL_NEG_INF; - else - gfc_fatal_error ("Unrecognized option to %<-finit-real%>: %s", - arg); - break; - case OPT_finit_integer_: gfc_option.flag_init_integer = GFC_INIT_INTEGER_ON; gfc_option.flag_init_integer_value = atoi (arg); @@ -712,29 +679,9 @@ gfc_handle_option (size_t scode, const char *arg, int value, /* Handled in language-independent code. */ break; - case OPT_fconvert_little_endian: - gfc_option.convert = GFC_CONVERT_LITTLE; - break; - - case OPT_fconvert_big_endian: - gfc_option.convert = GFC_CONVERT_BIG; - break; - - case OPT_fconvert_native: - gfc_option.convert = GFC_CONVERT_NATIVE; - break; - - case OPT_fconvert_swap: - gfc_option.convert = GFC_CONVERT_SWAP; - break; - case OPT_fcheck_: gfc_handle_runtime_check_option (arg); break; - - case OPT_fcoarray_: - gfc_handle_coarray_option (arg); - break; } Fortran_handle_option_auto (&global_options, &global_options_set, |