diff options
author | Janus Weil <janus@gcc.gnu.org> | 2018-09-20 21:33:05 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2018-09-20 21:33:05 +0200 |
commit | 2eb3745a7bcd7f326b44f784d2f0ca6a2fd4080d (patch) | |
tree | 230e5d690dc909163e13b97662b3920ae08ffa7b /gcc/fortran/trans-intrinsic.c | |
parent | 5596651acde99a5826a6ebf63afaf1a9fabc36e7 (diff) | |
download | gcc-2eb3745a7bcd7f326b44f784d2f0ca6a2fd4080d.zip gcc-2eb3745a7bcd7f326b44f784d2f0ca6a2fd4080d.tar.gz gcc-2eb3745a7bcd7f326b44f784d2f0ca6a2fd4080d.tar.bz2 |
gfortran.h (gfc_str_startswith): New macro.
2018-09-20 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (gfc_str_startswith): New macro.
* decl.c (variable_decl, gfc_match_end): Use it.
* iresolve.c (is_trig_resolved): Ditto.
* module.c (load_omp_udrs, read_module): Ditto.
* options.c (gfc_handle_runtime_check_option): Ditto.
* primary.c (match_arg_list_function): Ditto.
* trans-decl.c (gfc_get_symbol_decl): Ditto.
* trans-expr.c (gfc_conv_procedure_call): Ditto.
* interface.c (dtio_op): Replace strncmp by strcmp.
* resolve.c (resolve_actual_arglist, resolve_function): Ditto.
* trans-expr.c (conv_arglist_function): Ditto.
* trans-intrinsic.c (gfc_conv_ieee_arithmetic_function): Replace macro
STARTS_WITH by gfc_str_startswith.
From-SVN: r264448
Diffstat (limited to 'gcc/fortran/trans-intrinsic.c')
-rw-r--r-- | gcc/fortran/trans-intrinsic.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index 0c83f47..d068e01 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -8938,37 +8938,33 @@ gfc_conv_ieee_arithmetic_function (gfc_se * se, gfc_expr * expr) { const char *name = expr->value.function.name; -#define STARTS_WITH(A,B) (strncmp((A), (B), strlen(B)) == 0) - - if (STARTS_WITH (name, "_gfortran_ieee_is_nan")) + if (gfc_str_startswith (name, "_gfortran_ieee_is_nan")) conv_intrinsic_ieee_builtin (se, expr, BUILT_IN_ISNAN, 1); - else if (STARTS_WITH (name, "_gfortran_ieee_is_finite")) + else if (gfc_str_startswith (name, "_gfortran_ieee_is_finite")) conv_intrinsic_ieee_builtin (se, expr, BUILT_IN_ISFINITE, 1); - else if (STARTS_WITH (name, "_gfortran_ieee_unordered")) + else if (gfc_str_startswith (name, "_gfortran_ieee_unordered")) conv_intrinsic_ieee_builtin (se, expr, BUILT_IN_ISUNORDERED, 2); - else if (STARTS_WITH (name, "_gfortran_ieee_is_normal")) + else if (gfc_str_startswith (name, "_gfortran_ieee_is_normal")) conv_intrinsic_ieee_is_normal (se, expr); - else if (STARTS_WITH (name, "_gfortran_ieee_is_negative")) + else if (gfc_str_startswith (name, "_gfortran_ieee_is_negative")) conv_intrinsic_ieee_is_negative (se, expr); - else if (STARTS_WITH (name, "_gfortran_ieee_copy_sign")) + else if (gfc_str_startswith (name, "_gfortran_ieee_copy_sign")) conv_intrinsic_ieee_copy_sign (se, expr); - else if (STARTS_WITH (name, "_gfortran_ieee_scalb")) + else if (gfc_str_startswith (name, "_gfortran_ieee_scalb")) conv_intrinsic_ieee_scalb (se, expr); - else if (STARTS_WITH (name, "_gfortran_ieee_next_after")) + else if (gfc_str_startswith (name, "_gfortran_ieee_next_after")) conv_intrinsic_ieee_next_after (se, expr); - else if (STARTS_WITH (name, "_gfortran_ieee_rem")) + else if (gfc_str_startswith (name, "_gfortran_ieee_rem")) conv_intrinsic_ieee_rem (se, expr); - else if (STARTS_WITH (name, "_gfortran_ieee_logb")) + else if (gfc_str_startswith (name, "_gfortran_ieee_logb")) conv_intrinsic_ieee_logb_rint (se, expr, BUILT_IN_LOGB); - else if (STARTS_WITH (name, "_gfortran_ieee_rint")) + else if (gfc_str_startswith (name, "_gfortran_ieee_rint")) conv_intrinsic_ieee_logb_rint (se, expr, BUILT_IN_RINT); else /* It is not among the functions we translate directly. We return false, so a library function call is emitted. */ return false; -#undef STARTS_WITH - return true; } |