diff options
author | Janus Weil <janus@gcc.gnu.org> | 2010-11-09 11:39:46 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2010-11-09 11:39:46 +0100 |
commit | b04533af33ccf91e2874b24dd3e678d195c83587 (patch) | |
tree | 14d1f54316ef0bc517c72a674952cb7d233fd288 /gcc/fortran/trans-stmt.c | |
parent | 6496e42f8734797b1a5613585c47e51398419547 (diff) | |
download | gcc-b04533af33ccf91e2874b24dd3e678d195c83587.zip gcc-b04533af33ccf91e2874b24dd3e678d195c83587.tar.gz gcc-b04533af33ccf91e2874b24dd3e678d195c83587.tar.bz2 |
re PR fortran/46313 ([OOP] class container naming collisions)
2010-11-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/46313
* gfortran.h (gfc_add_data_component,gfc_add_vptr_component,
gfc_add_hash_component,gfc_add_size_component,
gfc_add_def_init_component): New macros.
* class.c (gfc_add_component_ref): Renamed data component.
(get_unique_type_string): New function.
(gfc_build_class_symbol): Use 'get_unique_type_string' to construct
uniques names for the class containers. Rename components.
(gfc_find_derived_vtab): Use 'get_unique_type_string' to construct
uniques names for the vtab symbols. Rename components.
* decl.c (attr_decl1): Renamed class container components.
* iresolve.c (gfc_resolve_extends_type_of): Ditto.
* match.c (select_type_set_tmp): Renamed temporaries.
* module.c (read_module): Renamed vtab and vtype symbols.
* resolve.c (resolve_structure_cons,resolve_typebound_function,
resolve_typebound_subroutine,resolve_deallocate_expr,
resolve_select_type,resolve_fl_derived): Renamed class container and
vtab components.
* trans-array.c (structure_alloc_comps): Ditto.
* trans-decl.c (gfc_trans_deferred_vars): Ditto.
* trans-expr.c (gfc_conv_derived_to_class,gfc_conv_structure,
gfc_trans_class_init_assign,gfc_trans_class_assign): Ditto.
* trans-intrinsic.c (gfc_conv_intrinsic_sizeof,
gfc_conv_intrinsic_storage_size,gfc_conv_allocated,gfc_conv_associated,
gfc_conv_same_type_as): Ditto.
* trans-stmt.c (gfc_trans_allocate): Ditto.
2010-11-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/46313
* gfortran.dg/class_29.f03: New.
From-SVN: r166480
Diffstat (limited to 'gcc/fortran/trans-stmt.c')
-rw-r--r-- | gcc/fortran/trans-stmt.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index d075ac8..1fd4254 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -4388,7 +4388,7 @@ gfc_trans_allocate (gfc_code * code) expr = gfc_copy_expr (al->expr); if (expr->ts.type == BT_CLASS) - gfc_add_component_ref (expr, "$data"); + gfc_add_data_component (expr); gfc_init_se (&se, NULL); gfc_start_block (&se.pre); @@ -4409,8 +4409,8 @@ gfc_trans_allocate (gfc_code * code) gfc_expr *sz; gfc_se se_sz; sz = gfc_copy_expr (code->expr3); - gfc_add_component_ref (sz, "$vptr"); - gfc_add_component_ref (sz, "$size"); + gfc_add_vptr_component (sz); + gfc_add_size_component (sz); gfc_init_se (&se_sz, NULL); gfc_conv_expr (&se_sz, sz); gfc_free_expr (sz); @@ -4497,18 +4497,18 @@ gfc_trans_allocate (gfc_code * code) actual = gfc_get_actual_arglist (); actual->expr = gfc_copy_expr (rhs); if (rhs->ts.type == BT_CLASS) - gfc_add_component_ref (actual->expr, "$data"); + gfc_add_data_component (actual->expr); actual->next = gfc_get_actual_arglist (); actual->next->expr = gfc_copy_expr (al->expr); - gfc_add_component_ref (actual->next->expr, "$data"); + gfc_add_data_component (actual->next->expr); if (rhs->ts.type == BT_CLASS) { ppc = gfc_copy_expr (rhs); - gfc_add_component_ref (ppc, "$vptr"); + gfc_add_vptr_component (ppc); } else ppc = gfc_lval_expr_from_sym (gfc_find_derived_vtab (rhs->ts.u.derived)); - gfc_add_component_ref (ppc, "$copy"); + gfc_add_component_ref (ppc, "_copy"); gfc_conv_procedure_call (&call, ppc->symtree->n.sym, actual, ppc, NULL); gfc_add_expr_to_block (&call.pre, call.expr); @@ -4527,8 +4527,8 @@ gfc_trans_allocate (gfc_code * code) /* Default-initialization via MOLD (polymorphic). */ gfc_expr *rhs = gfc_copy_expr (code->expr3); gfc_se dst,src; - gfc_add_component_ref (rhs, "$vptr"); - gfc_add_component_ref (rhs, "$def_init"); + gfc_add_vptr_component (rhs); + gfc_add_def_init_component (rhs); gfc_init_se (&dst, NULL); gfc_init_se (&src, NULL); gfc_conv_expr (&dst, expr); @@ -4549,13 +4549,13 @@ gfc_trans_allocate (gfc_code * code) /* Initialize VPTR for CLASS objects. */ lhs = gfc_expr_to_initialize (expr); - gfc_add_component_ref (lhs, "$vptr"); + gfc_add_vptr_component (lhs); rhs = NULL; if (code->expr3 && code->expr3->ts.type == BT_CLASS) { /* Polymorphic SOURCE: VPTR must be determined at run time. */ rhs = gfc_copy_expr (code->expr3); - gfc_add_component_ref (rhs, "$vptr"); + gfc_add_vptr_component (rhs); tmp = gfc_trans_pointer_assignment (lhs, rhs); gfc_add_expr_to_block (&block, tmp); gfc_free_expr (rhs); |