diff options
author | janus <janus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-30 21:56:11 +0000 |
---|---|---|
committer | janus <janus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-30 21:56:11 +0000 |
commit | 50b4b37ba4128b5e02d6b8af5f872770063c1d2b (patch) | |
tree | bd664a3b4e0b3ba3499bd2892841cf41c6b4a076 /gcc/fortran/primary.c | |
parent | 151000185c0403bf828986583afef0bf6b4f80b7 (diff) | |
download | gcc-50b4b37ba4128b5e02d6b8af5f872770063c1d2b.tar.gz |
2010-05-30 Janus Weil <janus@gcc.gnu.org>
* gcc/fortran/gfortran.h (CLASS_DATA): New macro for accessing the
$data component of a class container.
* gcc/fortran/decl.c (attr_decl1): Use macro CLASS_DATA.
* gcc/fortran/expr.c (gfc_check_pointer_assign,gfc_check_assign_symbol,
gfc_has_ultimate_allocatable,gfc_has_ultimate_pointer): Ditto.
* gcc/fortran/interface.c (matching_typebound_op): Ditto.
* gcc/fortran/match.c (gfc_match_allocate, gfc_match_deallocate): Ditto.
* gcc/fortran/parse.c (parse_derived): Ditto.
* gcc/fortran/primary.c (gfc_match_varspec, gfc_variable_attr,
gfc_expr_attr): Ditto.
* gcc/fortran/resolve.c (resolve_structure_cons, find_array_spec,
resolve_deallocate_expr, resolve_allocate_expr, resolve_select_type,
resolve_fl_var_and_proc, resolve_typebound_procedure,
resolve_fl_derived): Ditto.
* gcc/fortran/symbol.c (gfc_type_compatible): Restructured.
* gcc/fortran/trans-array.c (structure_alloc_comps): Use macro
CLASS_DATA.
* gcc/fortran/trans-decl.c (gfc_get_symbol_decl,
gfc_trans_deferred_vars): Ditto.
* gcc/fortran/trans-stmt.c (gfc_trans_allocate): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160060 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 53da762e2ef..68b6a437360 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1754,8 +1754,7 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, && !gfc_is_proc_ptr_comp (primary, NULL) && !(gfc_matching_procptr_assignment && sym->attr.flavor == FL_PROCEDURE)) - || (sym->ts.type == BT_CLASS - && sym->ts.u.derived->components->attr.dimension)) + || (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->attr.dimension)) { /* In EQUIVALENCE, we don't know yet whether we are seeing an array, character variable or array of character @@ -1890,16 +1889,15 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, return m; } else if (component->ts.type == BT_CLASS - && component->ts.u.derived->components->as != NULL + && CLASS_DATA (component)->as != NULL && !component->attr.proc_pointer) { tail = extend_ref (primary, tail); tail->type = REF_ARRAY; - m = gfc_match_array_ref (&tail->u.ar, - component->ts.u.derived->components->as, + m = gfc_match_array_ref (&tail->u.ar, CLASS_DATA (component)->as, equiv_flag, - component->ts.u.derived->components->as->corank); + CLASS_DATA (component)->as->corank); if (m != MATCH_YES) return m; } @@ -2000,9 +1998,9 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts) if (sym->ts.type == BT_CLASS) { - dimension = sym->ts.u.derived->components->attr.dimension; - pointer = sym->ts.u.derived->components->attr.pointer; - allocatable = sym->ts.u.derived->components->attr.allocatable; + dimension = CLASS_DATA (sym)->attr.dimension; + pointer = CLASS_DATA (sym)->attr.pointer; + allocatable = CLASS_DATA (sym)->attr.allocatable; } else { @@ -2061,8 +2059,8 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts) if (comp->ts.type == BT_CLASS) { - pointer = comp->ts.u.derived->components->attr.pointer; - allocatable = comp->ts.u.derived->components->attr.allocatable; + pointer = CLASS_DATA (comp)->attr.pointer; + allocatable = CLASS_DATA (comp)->attr.allocatable; } else { @@ -2110,9 +2108,9 @@ gfc_expr_attr (gfc_expr *e) attr = sym->attr; if (sym->ts.type == BT_CLASS) { - attr.dimension = sym->ts.u.derived->components->attr.dimension; - attr.pointer = sym->ts.u.derived->components->attr.pointer; - attr.allocatable = sym->ts.u.derived->components->attr.allocatable; + attr.dimension = CLASS_DATA (sym)->attr.dimension; + attr.pointer = CLASS_DATA (sym)->attr.pointer; + attr.allocatable = CLASS_DATA (sym)->attr.allocatable; } } else |