+2008-05-01 Janus Weil <jaydub66@gmail.com>
+
+ * gfortran.h (struct gfc_symbol): Moving "interface" member to
+ gfc_typespec (plus fixing a small docu error).
+ * interface.c (gfc_procedure_use): Ditto.
+ * decl.c (match_procedure_decl): Ditto.
+ * resolve.c (resolve_specific_f0,
+ resolve_specific_f0, resolve_symbol): Ditto.
+
2008-04-30 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.
/* Resolve interface if possible. That way, attr.procedure is only set
if it is declared by a later procedure-declaration-stmt, which is
invalid per C1212. */
- while (proc_if->interface)
- proc_if = proc_if->interface;
+ while (proc_if->ts.interface)
+ proc_if = proc_if->ts.interface;
if (proc_if->generic)
{
/* Set interface. */
if (proc_if != NULL)
{
- sym->interface = proc_if;
+ sym->ts.interface = proc_if;
sym->attr.untyped = 1;
}
else if (current_ts.type != BT_UNKNOWN)
{
- sym->interface = gfc_new_symbol ("", gfc_current_ns);
- sym->interface->ts = current_ts;
- sym->interface->attr.function = 1;
- sym->ts = sym->interface->ts;
- sym->attr.function = sym->interface->attr.function;
+ sym->ts = current_ts;
+ sym->ts.interface = gfc_new_symbol ("", gfc_current_ns);
+ sym->ts.interface->ts = current_ts;
+ sym->ts.interface->attr.function = 1;
+ sym->attr.function = sym->ts.interface->attr.function;
}
if (gfc_match_eos () == MATCH_YES)
int kind;
struct gfc_symbol *derived;
gfc_charlen *cl; /* For character types only. */
+ struct gfc_symbol *interface; /* For PROCEDURE declarations. */
int is_c_interop;
int is_iso_c;
bt f90_type;
gfc_typespec ts;
symbol_attribute attr;
- /* The interface member points to the formal argument list if the
+ /* The formal member points to the formal argument list if the
symbol is a function or subroutine name. If the symbol is a
generic name, the generic member points to the list of
interfaces. */
struct gfc_symbol *result; /* function result symbol */
gfc_component *components; /* Derived type components */
- struct gfc_symbol *interface; /* For PROCEDURE declarations. */
-
/* Defined only for Cray pointees; points to their pointer. */
struct gfc_symbol *cp_pointer;
gfc_warning ("Procedure '%s' called with an implicit interface at %L",
sym->name, where);
- if (sym->interface && sym->interface->attr.intrinsic)
+ if (sym->ts.interface && sym->ts.interface->attr.intrinsic)
{
gfc_intrinsic_sym *isym;
- isym = gfc_find_function (sym->interface->name);
+ isym = gfc_find_function (sym->ts.interface->name);
if (isym != NULL)
{
- if (compare_actual_formal_intr (ap, sym->interface))
+ if (compare_actual_formal_intr (ap, sym->ts.interface))
return;
gfc_error ("Type/rank mismatch in argument '%s' at %L",
sym->name, where);
/* See if we have an intrinsic interface. */
- if (sym->interface != NULL && sym->interface->attr.intrinsic)
+ if (sym->ts.interface != NULL && sym->ts.interface->attr.intrinsic)
{
gfc_intrinsic_sym *isym;
- isym = gfc_find_function (sym->interface->name);
+ isym = gfc_find_function (sym->ts.interface->name);
/* Existance of isym should be checked already. */
gcc_assert (isym);
match m;
/* See if we have an intrinsic interface. */
- if (sym->interface != NULL && !sym->interface->attr.abstract
- && !sym->interface->attr.subroutine)
+ if (sym->ts.interface != NULL && !sym->ts.interface->attr.abstract
+ && !sym->ts.interface->attr.subroutine)
{
gfc_intrinsic_sym *isym;
- isym = gfc_find_function (sym->interface->name);
+ isym = gfc_find_function (sym->ts.interface->name);
/* Existance of isym should be checked already. */
gcc_assert (isym);
}
}
- if (sym->attr.procedure && sym->interface
+ if (sym->attr.procedure && sym->ts.interface
&& sym->attr.if_source != IFSRC_DECL)
{
- if (sym->interface->attr.procedure)
+ if (sym->ts.interface->attr.procedure)
gfc_error ("Interface '%s', used by procedure '%s' at %L, is declared "
- "in a later PROCEDURE statement", sym->interface->name,
+ "in a later PROCEDURE statement", sym->ts.interface->name,
sym->name,&sym->declared_at);
/* Get the attributes from the interface (now resolved). */
- if (sym->interface->attr.if_source || sym->interface->attr.intrinsic)
+ if (sym->ts.interface->attr.if_source || sym->ts.interface->attr.intrinsic)
{
- sym->ts = sym->interface->ts;
- sym->attr.function = sym->interface->attr.function;
- sym->attr.subroutine = sym->interface->attr.subroutine;
- copy_formal_args (sym, sym->interface);
+ sym->ts.type = sym->ts.interface->ts.type;
+ sym->ts.kind = sym->ts.interface->ts.kind;
+ sym->attr.function = sym->ts.interface->attr.function;
+ sym->attr.subroutine = sym->ts.interface->attr.subroutine;
+ copy_formal_args (sym, sym->ts.interface);
}
- else if (sym->interface->name[0] != '\0')
+ else if (sym->ts.interface->name[0] != '\0')
{
gfc_error ("Interface '%s' of procedure '%s' at %L must be explicit",
- sym->interface->name, sym->name, &sym->declared_at);
+ sym->ts.interface->name, sym->name, &sym->declared_at);
return;
}
}