gfortran.h: Renamed 'enum gfc_generic_isym_id' to 'enum gfc_isym_id'...

2007-05-29  Daniel Franke  <franke.daniel@gmail.com>

        * gfortran.h: Renamed 'enum gfc_generic_isym_id' to 'enum gfc_isym_id',
        added missing GFC_ISYM_* enumerators, ordered alphabetically.
        (struct gfc_intrinsic_sym): Renamed 'generic_id' to 'id'.
        (gfc_find_subroutine): New prototype.
        * intrinsic.c (add_sym, add_sym_*): Added argument 'id' and changed all callers.
        (find_subroutine): Renamed to 'gfc_find_subroutine', removed static.
        * dependency.c: Changed usage of isym->generic_id to isym->id.
        * openmp.c: Likewise.
        * resolve.c: Likewise.
        * trans-array.c: Likewise.
        * trans-expr.c: Likewise.
        * trans-intrinsic.c: Likewise.
        * trans-openmp.c: Likewise.

From-SVN: r125168
This commit is contained in:
Daniel Franke 2007-05-29 17:10:48 -04:00 committed by Daniel Franke
parent b7616c4045
commit cd5ecab6a7
10 changed files with 448 additions and 384 deletions

View file

@ -1,3 +1,19 @@
2007-05-29 Daniel Franke <franke.daniel@gmail.com>
* gfortran.h: Renamed 'enum gfc_generic_isym_id' to 'enum gfc_isym_id',
added missing GFC_ISYM_* enumerators, ordered alphabetically.
(struct gfc_intrinsic_sym): Renamed 'generic_id' to 'id'.
(gfc_find_subroutine): New prototype.
* intrinsic.c (add_sym, add_sym_*): Added argument 'id' and changed all callers.
(find_subroutine): Renamed to 'gfc_find_subroutine', removed static.
* dependency.c: Changed usage of isym->generic_id to isym->id.
* openmp.c: Likewise.
* resolve.c: Likewise.
* trans-array.c: Likewise.
* trans-expr.c: Likewise.
* trans-intrinsic.c: Likewise.
* trans-openmp.c: Likewise.
2007-05-28 Tobias Schlüter <tobi@gcc.gnu.org>
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIZEOF.

View file

@ -222,7 +222,7 @@ gfc_dep_compare_expr (gfc_expr *e1, gfc_expr *e2)
/* We should list the "constant" intrinsic functions. Those
without side-effects that provide equal results given equal
argument lists. */
switch (e1->value.function.isym->generic_id)
switch (e1->value.function.isym->id)
{
case GFC_ISYM_CONVERSION:
/* Handle integer extensions specially, as __convert_i4_i8
@ -373,7 +373,7 @@ gfc_get_noncopying_intrinsic_argument (gfc_expr *expr)
if (expr->expr_type != EXPR_FUNCTION || !expr->value.function.isym)
return NULL;
switch (expr->value.function.isym->generic_id)
switch (expr->value.function.isym->id)
{
case GFC_ISYM_TRANSPOSE:
return expr->value.function.actual->expr;

View file

@ -303,11 +303,12 @@ extern const mstring ifsrc_types[];
/* Enumeration of all the generic intrinsic functions. Used by the
backend for identification of a function. */
enum gfc_generic_isym_id
enum gfc_isym_id
{
/* GFC_ISYM_NONE is used for intrinsics which will never be seen by
the backend (eg. KIND). */
GFC_ISYM_NONE = 0,
GFC_ISYM_ABORT,
GFC_ISYM_ABS,
GFC_ISYM_ACCESS,
GFC_ISYM_ACHAR,
@ -317,23 +318,19 @@ enum gfc_generic_isym_id
GFC_ISYM_ADJUSTR,
GFC_ISYM_AIMAG,
GFC_ISYM_AINT,
GFC_ISYM_ALARM,
GFC_ISYM_ALL,
GFC_ISYM_ALLOCATED,
GFC_ISYM_ANINT,
GFC_ISYM_AND,
GFC_ISYM_ANINT,
GFC_ISYM_ANY,
GFC_ISYM_ASIN,
GFC_ISYM_ASINH,
GFC_ISYM_ASSOCIATED,
GFC_ISYM_ATAN,
GFC_ISYM_ATANH,
GFC_ISYM_ATAN2,
GFC_ISYM_J0,
GFC_ISYM_J1,
GFC_ISYM_JN,
GFC_ISYM_Y0,
GFC_ISYM_Y1,
GFC_ISYM_YN,
GFC_ISYM_ATANH,
GFC_ISYM_BIT_SIZE,
GFC_ISYM_BTEST,
GFC_ISYM_CEILING,
GFC_ISYM_CHAR,
@ -343,36 +340,55 @@ enum gfc_generic_isym_id
GFC_ISYM_COMMAND_ARGUMENT_COUNT,
GFC_ISYM_COMPLEX,
GFC_ISYM_CONJG,
GFC_ISYM_CONVERSION,
GFC_ISYM_COS,
GFC_ISYM_COSH,
GFC_ISYM_COUNT,
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ET_EXPONENT,
GFC_ISYM_SHAPE,
GFC_ISYM_SI_KIND,
GFC_ISYM_SIGN,
GFC_ISYM_SIGNAL,
GFC_ISYM_SI_KIND,
GFC_ISYM_SIN,
GFC_ISYM_SINH,
GFC_ISYM_SIZE,
GFC_ISYM_SLEEP,
GFC_ISYM_SIZEOF,
GFC_ISYM_SPACING,
GFC_ISYM_SPREAD,
GFC_ISYM_SQRT,
GFC_ISYM_SRAND,
GFC_ISYM_SR_KIND,
GFC_ISYM_STAT,
GFC_ISYM_SUM,
GFC_ISYM_SYMLINK,
GFC_ISYM_SYMLNK,
GFC_ISYM_SYSTEM,
GFC_ISYM_SYSTEM_CLOCK,
GFC_ISYM_TAN,
GFC_ISYM_TANH,
GFC_ISYM_TIME,
GFC_ISYM_TIME8,
GFC_ISYM_TINY,
GFC_ISYM_TRANSFER,
GFC_ISYM_TRANSPOSE,
GFC_ISYM_TRIM,
@ -469,9 +509,11 @@ enum gfc_generic_isym_id
GFC_ISYM_UNPACK,
GFC_ISYM_VERIFY,
GFC_ISYM_XOR,
GFC_ISYM_CONVERSION
GFC_ISYM_Y0,
GFC_ISYM_Y1,
GFC_ISYM_YN
};
typedef enum gfc_generic_isym_id gfc_generic_isym_id;
typedef enum gfc_isym_id gfc_isym_id;
/* Runtime errors. The EOR and EOF errors are required to be negative.
These codes must be kept synchronized with their equivalents in
@ -1252,7 +1294,7 @@ typedef struct gfc_intrinsic_sym
gfc_check_f check;
gfc_resolve_f resolve;
struct gfc_intrinsic_sym *specific_head, *next;
gfc_generic_isym_id generic_id;
gfc_isym_id id;
}
gfc_intrinsic_sym;
@ -2020,6 +2062,7 @@ int gfc_specific_intrinsic (const char *);
int gfc_intrinsic_name (const char *, int);
int gfc_intrinsic_actual_ok (const char *, const bool);
gfc_intrinsic_sym *gfc_find_function (const char *);
gfc_intrinsic_sym *gfc_find_subroutine (const char *);
match gfc_intrinsic_func_interface (gfc_expr *, int);
match gfc_intrinsic_sub_interface (gfc_code *, int);

File diff suppressed because it is too large Load diff

View file

@ -942,7 +942,7 @@ is_conversion (gfc_expr *expr, bool widening)
if (expr->expr_type != EXPR_FUNCTION
|| expr->value.function.isym == NULL
|| expr->value.function.esym != NULL
|| expr->value.function.isym->generic_id != GFC_ISYM_CONVERSION)
|| expr->value.function.isym->id != GFC_ISYM_CONVERSION)
return NULL;
if (widening)
@ -1130,7 +1130,7 @@ resolve_omp_atomic (gfc_code *code)
{
gfc_actual_arglist *arg, *var_arg;
switch (expr2->value.function.isym->generic_id)
switch (expr2->value.function.isym->id)
{
case GFC_ISYM_MIN:
case GFC_ISYM_MAX:

View file

@ -1179,7 +1179,7 @@ resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
&& formal_optional
&& arg->expr->rank
&& (set_by_optional || arg->expr->rank != rank)
&& !(isym && isym->generic_id == GFC_ISYM_CONVERSION))
&& !(isym && isym->id == GFC_ISYM_CONVERSION))
{
gfc_warning ("'%s' at %L is an array and OPTIONAL; IF IT IS "
"MISSING, it cannot be the actual argument of an "
@ -1653,7 +1653,7 @@ resolve_function (gfc_expr *expr)
t = FAILURE;
}
#define GENERIC_ID expr->value.function.isym->generic_id
#define GENERIC_ID expr->value.function.isym->id
else if (expr->value.function.actual != NULL
&& expr->value.function.isym != NULL
&& GENERIC_ID != GFC_ISYM_LBOUND

View file

@ -2736,7 +2736,7 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
/* As usual, lbound and ubound are exceptions!. */
case GFC_SS_INTRINSIC:
switch (ss->expr->value.function.isym->generic_id)
switch (ss->expr->value.function.isym->id)
{
case GFC_ISYM_LBOUND:
case GFC_ISYM_UBOUND:
@ -2772,7 +2772,7 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
break;
case GFC_SS_INTRINSIC:
switch (ss->expr->value.function.isym->generic_id)
switch (ss->expr->value.function.isym->id)
{
/* Fall through to supply start and stride. */
case GFC_ISYM_LBOUND:

View file

@ -1655,7 +1655,7 @@ gfc_apply_interface_mapping_to_expr (gfc_interface_mapping * mapping,
case EXPR_FUNCTION:
if (expr->value.function.esym == NULL
&& expr->value.function.isym != NULL
&& expr->value.function.isym->generic_id == GFC_ISYM_LEN
&& expr->value.function.isym->id == GFC_ISYM_LEN
&& expr->value.function.actual->expr->expr_type == EXPR_VARIABLE
&& gfc_apply_interface_mapping_to_expr (mapping,
expr->value.function.actual->expr))

View file

@ -49,7 +49,7 @@ typedef struct gfc_intrinsic_map_t GTY(())
{
/* The explicit enum is required to work around inadequacies in the
garbage collection/gengtype parsing mechanism. */
enum gfc_generic_isym_id id;
enum gfc_isym_id id;
/* Enum value from the "language-independent", aka C-centric, part
of gcc, or END_BUILTINS of no such value set. */
@ -649,9 +649,9 @@ gfc_conv_intrinsic_lib_function (gfc_se * se, gfc_expr * expr)
gfc_intrinsic_map_t *m;
tree args;
tree fndecl;
gfc_generic_isym_id id;
gfc_isym_id id;
id = expr->value.function.isym->generic_id;
id = expr->value.function.isym->id;
/* Find the entry for this function. */
for (m = gfc_intrinsic_map; m->id != GFC_ISYM_NONE; m++)
{
@ -1468,7 +1468,7 @@ gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr)
/* Calls to libgfortran_matmul need to be appended special arguments,
to be able to call the BLAS ?gemm functions if required and possible. */
append_args = NULL_TREE;
if (expr->value.function.isym->generic_id == GFC_ISYM_MATMUL
if (expr->value.function.isym->id == GFC_ISYM_MATMUL
&& sym->ts.type != BT_LOGICAL)
{
tree cint = gfc_get_int_type (gfc_c_int_kind);
@ -3634,7 +3634,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
}
}
switch (expr->value.function.isym->generic_id)
switch (expr->value.function.isym->id)
{
case GFC_ISYM_NONE:
gcc_unreachable ();
@ -4035,7 +4035,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
void
gfc_add_intrinsic_ss_code (gfc_loopinfo * loop ATTRIBUTE_UNUSED, gfc_ss * ss)
{
switch (ss->expr->value.function.isym->generic_id)
switch (ss->expr->value.function.isym->id)
{
case GFC_ISYM_UBOUND:
case GFC_ISYM_LBOUND:
@ -4098,7 +4098,7 @@ gfc_is_intrinsic_libcall (gfc_expr * expr)
gcc_assert (expr->expr_type == EXPR_FUNCTION && expr->value.function.isym);
gcc_assert (expr->rank > 0);
switch (expr->value.function.isym->generic_id)
switch (expr->value.function.isym->id)
{
case GFC_ISYM_ALL:
case GFC_ISYM_ANY:
@ -4146,7 +4146,7 @@ gfc_walk_intrinsic_function (gfc_ss * ss, gfc_expr * expr,
return gfc_walk_intrinsic_libfunc (ss, expr);
/* Special cases. */
switch (isym->generic_id)
switch (isym->id)
{
case GFC_ISYM_LBOUND:
case GFC_ISYM_UBOUND:

View file

@ -733,7 +733,7 @@ gfc_trans_omp_atomic (gfc_code *code)
expr2 = code->expr2;
if (expr2->expr_type == EXPR_FUNCTION
&& expr2->value.function.isym->generic_id == GFC_ISYM_CONVERSION)
&& expr2->value.function.isym->id == GFC_ISYM_CONVERSION)
expr2 = expr2->value.function.actual->expr;
if (expr2->expr_type == EXPR_OP)
@ -773,7 +773,7 @@ gfc_trans_omp_atomic (gfc_code *code)
}
e = expr2->value.op.op1;
if (e->expr_type == EXPR_FUNCTION
&& e->value.function.isym->generic_id == GFC_ISYM_CONVERSION)
&& e->value.function.isym->id == GFC_ISYM_CONVERSION)
e = e->value.function.actual->expr;
if (e->expr_type == EXPR_VARIABLE
&& e->symtree != NULL
@ -786,7 +786,7 @@ gfc_trans_omp_atomic (gfc_code *code)
{
e = expr2->value.op.op2;
if (e->expr_type == EXPR_FUNCTION
&& e->value.function.isym->generic_id == GFC_ISYM_CONVERSION)
&& e->value.function.isym->id == GFC_ISYM_CONVERSION)
e = e->value.function.actual->expr;
gcc_assert (e->expr_type == EXPR_VARIABLE
&& e->symtree != NULL
@ -800,7 +800,7 @@ gfc_trans_omp_atomic (gfc_code *code)
else
{
gcc_assert (expr2->expr_type == EXPR_FUNCTION);
switch (expr2->value.function.isym->generic_id)
switch (expr2->value.function.isym->id)
{
case GFC_ISYM_MIN:
op = MIN_EXPR;