diff options
author | Janus Weil <janus@gcc.gnu.org> | 2008-08-23 23:04:01 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2008-08-23 23:04:01 +0200 |
commit | d4b7d0f0520f0f91874b1404b53bd6519affe559 (patch) | |
tree | bd962221be72af567e44311a383658a3085306b7 /gcc/fortran/symbol.c | |
parent | 00fc23337d06089d5662383e2f6bdea105055894 (diff) | |
download | gcc-d4b7d0f0520f0f91874b1404b53bd6519affe559.zip gcc-d4b7d0f0520f0f91874b1404b53bd6519affe559.tar.gz gcc-d4b7d0f0520f0f91874b1404b53bd6519affe559.tar.bz2 |
gfortran.h (gfc_component): Add field "symbol_attribute attr"...
2008-08-23 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (gfc_component): Add field "symbol_attribute attr", remove
fields "pointer", "allocatable", "dimension", "access".
Remove functions "gfc_set_component_attr" and "gfc_get_component_attr".
* interface.c (gfc_compare_derived_types): Ditto.
* trans-array.c (gfc_array_allocate,structure_alloc_comps): Ditto.
* trans-expr.c (gfc_conv_component_ref,gfc_trans_subcomponent_assign,
gfc_conv_structure): Ditto.
* symbol.c (gfc_find_component,free_components,gfc_set_component_attr,
gfc_get_component_attr,verify_bind_c_derived_type,
generate_isocbinding_symbol): Ditto.
* decl.c (build_struct): Ditto.
* dump-parse-tree.c (show_components): Ditto.
* trans-stmt.c (gfc_trans_deallocate): Ditto.
* expr.c (gfc_check_assign,gfc_check_pointer_assign,
gfc_default_initializer): Ditto.
* module.c (mio_component): Ditto.
* trans-types.c (copy_dt_decls_ifequal,gfc_get_derived_type): Ditto.
* resolve.c (has_default_initializer,resolve_structure_cons,
gfc_iso_c_func_interface,find_array_spec,resolve_ref,
resolve_deallocate_expr,resolve_allocate_expr,resolve_fl_derived,
resolve_equivalence_derived): Ditto.
* trans-io.c (transfer_expr): Ditto.
* parse.c (parse_derived): Ditto.
* dependency.c (gfc_check_dependency): Ditto.
* primary.c (gfc_variable_attr): Ditto.
From-SVN: r139524
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index e16406d..6244eed 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -1874,7 +1874,7 @@ gfc_find_component (gfc_symbol *sym, const char *name) else if (sym->attr.use_assoc) { - if (p->access == ACCESS_PRIVATE) + if (p->attr.access == ACCESS_PRIVATE) { gfc_error ("Component '%s' at %C is a PRIVATE component of '%s'", name, sym->name); @@ -1883,7 +1883,7 @@ gfc_find_component (gfc_symbol *sym, const char *name) /* If there were components given and all components are private, error out at this place. */ - if (p->access != ACCESS_PUBLIC && sym->component_access == ACCESS_PRIVATE) + if (p->attr.access != ACCESS_PUBLIC && sym->component_access == ACCESS_PRIVATE) { gfc_error ("All components of '%s' are PRIVATE in structure" " constructor at %C", sym->name); @@ -1915,34 +1915,6 @@ free_components (gfc_component *p) } -/* Set component attributes from a standard symbol attribute structure. */ - -void -gfc_set_component_attr (gfc_component *c, symbol_attribute *attr) -{ - - c->dimension = attr->dimension; - c->pointer = attr->pointer; - c->allocatable = attr->allocatable; - c->access = attr->access; -} - - -/* Get a standard symbol attribute structure given the component - structure. */ - -void -gfc_get_component_attr (symbol_attribute *attr, gfc_component *c) -{ - - gfc_clear_attr (attr); - attr->dimension = c->dimension; - attr->pointer = c->pointer; - attr->allocatable = c->allocatable; - attr->access = c->access; -} - - /******************** Statement label management ********************/ /* Comparison function for statement labels, used for managing the @@ -3354,7 +3326,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym) { /* The components cannot be pointers (fortran sense). J3/04-007, Section 15.2.3, C1505. */ - if (curr_comp->pointer != 0) + if (curr_comp->attr.pointer != 0) { gfc_error ("Component '%s' at %L cannot have the " "POINTER attribute because it is a member " @@ -3366,7 +3338,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym) /* The components cannot be allocatable. J3/04-007, Section 15.2.3, C1505. */ - if (curr_comp->allocatable != 0) + if (curr_comp->attr.allocatable != 0) { gfc_error ("Component '%s' at %L cannot have the " "ALLOCATABLE attribute because it is a member " @@ -4081,8 +4053,8 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s, index = get_c_kind ("c_ptr", c_interop_kinds_table); tmp_comp->ts.kind = c_interop_kinds_table[index].value; - tmp_comp->pointer = 0; - tmp_comp->dimension = 0; + tmp_comp->attr.pointer = 0; + tmp_comp->attr.dimension = 0; /* Mark the component as C interoperable. */ tmp_comp->ts.is_c_interop = 1; |