gfc_free_iterator (c->iterator, 1);
mpz_clear (c->offset);
- mpz_clear (c->repeat);
gfc_free (c);
}
c->n.component = src->n.component;
mpz_init_set (c->offset, src->offset);
- mpz_init_set (c->repeat, src->repeat);
return c;
}
c->iterator = NULL;
mpz_init_set_si (c->offset, 0);
- mpz_init_set_si (c->repeat, 0);
return c;
}
gfc_constructor *
gfc_constructor_lookup (gfc_constructor_base base, int offset)
{
- gfc_constructor *c;
splay_tree_node node;
if (!base)
if (node)
return (gfc_constructor*) node->value;
- /* Check if the previous node has a repeat count big enough to
- cover the offset looked for. */
- node = splay_tree_predecessor (base, offset);
- if (!node)
- return NULL;
-
- c = (gfc_constructor*) node->value;
- if (mpz_cmp_si (c->repeat, 1) > 0)
- {
- if (mpz_get_si (c->offset) + mpz_get_si (c->repeat) <= offset)
- c = NULL;
- }
- else
- c = NULL;
-
- return c;
+ return NULL;
}