/* Deal with interfaces.
- Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
/* Deal with interfaces. An explicit interface is represented as a
Generic interfaces:
The generic name points to a linked list of symbols. Each symbol
- has an explicit interface. Each explicit interface has it's own
+ has an explicit interface. Each explicit interface has its own
namespace containing the arguments. Module procedures are symbols in
which the interface is added later when the module procedure is parsed.
if (gfc_get_symbol (name, NULL, &sym))
return MATCH_ERROR;
- if (!sym->attr.generic && gfc_add_generic (&sym->attr, NULL) == FAILURE)
+ if (!sym->attr.generic
+ && gfc_add_generic (&sym->attr, sym->name, NULL) == FAILURE)
return MATCH_ERROR;
current_interface.sym = gfc_new_block = sym;
true names and module names are the same and the module name is
nonnull, then they are equal. */
if (strcmp (ts1->derived->name, ts2->derived->name) == 0
- && ts1->derived->module[0] != '\0'
- && strcmp (ts1->derived->module, ts2->derived->module) == 0)
+ && ((ts1->derived->module == NULL && ts2->derived->module == NULL)
+ || (ts1->derived != NULL && ts2->derived != NULL
+ && strcmp (ts1->derived->module, ts2->derived->module) == 0)))
return 1;
/* Compare type via the rules of the standard. Both types must have
/* Perform the correspondence test in rule 2 of section 14.1.2.3.
- Returns zero if no argument is found that satisifes rule 2, nonzero
+ Returns zero if no argument is found that satisfies rule 2, nonzero
otherwise.
This test is also not symmetric in f1 and f2 and must be called
if (p->sym == q->sym)
continue; /* Duplicates OK here */
- if (strcmp (p->sym->name, q->sym->name) == 0
- && strcmp (p->sym->module, q->sym->module) == 0)
+ if (p->sym->name == q->sym->name && p->sym->module == q->sym->module)
continue;
if (compare_interfaces (p->sym, q->sym, generic_flag))
return compare_interfaces (formal, actual->symtree->n.sym, 0);
}
- if (actual->expr_type != EXPR_NULL
+ if ((actual->expr_type != EXPR_NULL || actual->ts.type != BT_UNKNOWN)
&& !gfc_compare_types (&formal->ts, &actual->ts))
return 0;
for (a = actual; a; a = a->next, f = f->next)
{
- if (a->name[0] != '\0')
+ if (a->name != NULL)
{
i = 0;
for (f = formal; f; f = f->next, i++)
sym = NULL;
actual = gfc_get_actual_arglist ();
- actual->expr = e->op1;
+ actual->expr = e->value.op.op1;
- if (e->op2 != NULL)
+ if (e->value.op.op2 != NULL)
{
actual->next = gfc_get_actual_arglist ();
- actual->next->expr = e->op2;
+ actual->next->expr = e->value.op.op2;
}
- i = fold_unary (e->operator);
+ i = fold_unary (e->value.op.operator);
if (i == INTRINSIC_USER)
{
for (ns = gfc_current_ns; ns; ns = ns->parent)
{
- uop = gfc_find_uop (e->uop->name, ns);
+ uop = gfc_find_uop (e->value.op.uop->name, ns);
if (uop == NULL)
continue;
e->expr_type = EXPR_FUNCTION;
e->symtree = find_sym_in_symtree (sym);
e->value.function.actual = actual;
+ e->value.function.esym = NULL;
+ e->value.function.isym = NULL;
if (gfc_pure (NULL) && !gfc_pure (sym))
{