diff options
author | Janus Weil <janus@gcc.gnu.org> | 2010-05-30 23:56:11 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2010-05-30 23:56:11 +0200 |
commit | 7a08eda1619ac02b31ff4bcf8582a94237424132 (patch) | |
tree | bd664a3b4e0b3ba3499bd2892841cf41c6b4a076 /gcc/fortran/expr.c | |
parent | 66a3e33967b012b5ec524c0c57618fe7408ce440 (diff) | |
download | gcc-7a08eda1619ac02b31ff4bcf8582a94237424132.zip gcc-7a08eda1619ac02b31ff4bcf8582a94237424132.tar.gz gcc-7a08eda1619ac02b31ff4bcf8582a94237424132.tar.bz2 |
gfortran.h (CLASS_DATA): New macro for accessing the $data component of a class container.
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.
From-SVN: r160060
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 6884c90..b645205 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3306,8 +3306,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) } if (!pointer && !proc_pointer - && !(lvalue->ts.type == BT_CLASS - && lvalue->ts.u.derived->components->attr.pointer)) + && !(lvalue->ts.type == BT_CLASS && CLASS_DATA (lvalue)->attr.pointer)) { gfc_error ("Pointer assignment to non-POINTER at %L", &lvalue->where); return FAILURE; @@ -3544,8 +3543,7 @@ gfc_check_assign_symbol (gfc_symbol *sym, gfc_expr *rvalue) lvalue.where = sym->declared_at; if (sym->attr.pointer || sym->attr.proc_pointer - || (sym->ts.type == BT_CLASS - && sym->ts.u.derived->components->attr.pointer + || (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->attr.pointer && rvalue->expr_type == EXPR_NULL)) r = gfc_check_pointer_assign (&lvalue, rvalue); else @@ -4039,14 +4037,14 @@ gfc_has_ultimate_allocatable (gfc_expr *e) last = ref; if (last && last->u.c.component->ts.type == BT_CLASS) - return last->u.c.component->ts.u.derived->components->attr.alloc_comp; + return CLASS_DATA (last->u.c.component)->attr.alloc_comp; else if (last && last->u.c.component->ts.type == BT_DERIVED) return last->u.c.component->ts.u.derived->attr.alloc_comp; else if (last) return false; if (e->ts.type == BT_CLASS) - return e->ts.u.derived->components->attr.alloc_comp; + return CLASS_DATA (e)->attr.alloc_comp; else if (e->ts.type == BT_DERIVED) return e->ts.u.derived->attr.alloc_comp; else @@ -4069,14 +4067,14 @@ gfc_has_ultimate_pointer (gfc_expr *e) last = ref; if (last && last->u.c.component->ts.type == BT_CLASS) - return last->u.c.component->ts.u.derived->components->attr.pointer_comp; + return CLASS_DATA (last->u.c.component)->attr.pointer_comp; else if (last && last->u.c.component->ts.type == BT_DERIVED) return last->u.c.component->ts.u.derived->attr.pointer_comp; else if (last) return false; if (e->ts.type == BT_CLASS) - return e->ts.u.derived->components->attr.pointer_comp; + return CLASS_DATA (e)->attr.pointer_comp; else if (e->ts.type == BT_DERIVED) return e->ts.u.derived->attr.pointer_comp; else |