diff options
author | Janus Weil <janus@gcc.gnu.org> | 2013-08-09 21:26:07 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2013-08-09 21:26:07 +0200 |
commit | 11e5274a4bb2ae1338c8b447c9880ace43aac129 (patch) | |
tree | 0ac9c4560a8ad95d76c1854f90668bda6feda0ad /gcc/fortran/resolve.c | |
parent | 2fa3d31bd6bb9274abaa3a7d59cc88e9a6112194 (diff) | |
download | gcc-11e5274a4bb2ae1338c8b447c9880ace43aac129.zip gcc-11e5274a4bb2ae1338c8b447c9880ace43aac129.tar.gz gcc-11e5274a4bb2ae1338c8b447c9880ace43aac129.tar.bz2 |
gfortran.h (gfc_get_code): Modified prototype.
2013-08-09 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (gfc_get_code): Modified prototype.
* class.c (finalize_component, finalization_scalarizer,
finalization_get_offset, finalizer_insert_packed_call,
generate_finalization_wrapper, gfc_find_derived_vtab,
gfc_find_intrinsic_vtab): Use 'gfc_get_code'.
* io.c (match_io_iterator, match_io_element, terminate_io, get_io_list,
gfc_match_inquire): Call 'gfc_get_code' with argument.
* match.c (match_simple_forall, gfc_match_forall, gfc_match_goto,
gfc_match_nullify, gfc_match_call, match_simple_where, gfc_match_where):
Ditto.
* parse.c (new_level): Ditto.
(add_statement): Use XCNEW.
* resolve.c (resolve_entries, resolve_allocate_expr,
resolve_select_type, build_assignment, build_init_assign): Call
'gfc_get_code' with argument.
* st.c (gfc_get_code): Add argument 'op'.
* trans-expr.c (gfc_trans_class_array_init_assign): Call 'gfc_get_code'
with argument.
* trans-stmt.c (gfc_trans_allocate): Ditto.
From-SVN: r201635
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 90b7c0a..837bf15 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -723,8 +723,7 @@ resolve_entries (gfc_namespace *ns) el = ns->entries; /* Add an entry statement for it. */ - c = gfc_get_code (); - c->op = EXEC_ENTRY; + c = gfc_get_code (EXEC_ENTRY); c->ext.entry = el; c->next = ns->code; ns->code = c; @@ -6880,9 +6879,8 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code) if (ts.type == BT_DERIVED && (init_e = gfc_default_initializer (&ts))) { - gfc_code *init_st = gfc_get_code (); + gfc_code *init_st = gfc_get_code (EXEC_INIT_ASSIGN); init_st->loc = code->loc; - init_st->op = EXEC_INIT_ASSIGN; init_st->expr1 = gfc_expr_to_initialize (e); init_st->expr2 = init_e; init_st->next = code->next; @@ -8020,8 +8018,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns) code->ext.block.assoc = NULL; /* Add EXEC_SELECT to switch on type. */ - new_st = gfc_get_code (); - new_st->op = code->op; + new_st = gfc_get_code (code->op); new_st->expr1 = code->expr1; new_st->expr2 = code->expr2; new_st->block = code->block; @@ -8087,8 +8084,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns) if (c->ts.type != BT_CLASS && c->ts.type != BT_UNKNOWN) gfc_add_data_component (st->n.sym->assoc->target); - new_st = gfc_get_code (); - new_st->op = EXEC_BLOCK; + new_st = gfc_get_code (EXEC_BLOCK); new_st->ext.block.ns = gfc_build_block_ns (ns); new_st->ext.block.ns->code = body->next; body->next = new_st; @@ -8139,9 +8135,8 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns) { /* Add a default case to hold the CLASS IS cases. */ for (tail = code; tail->block; tail = tail->block) ; - tail->block = gfc_get_code (); + tail->block = gfc_get_code (EXEC_SELECT_TYPE); tail = tail->block; - tail->op = EXEC_SELECT_TYPE; tail->ext.block.case_list = gfc_get_case (); tail->ext.block.case_list->ts.type = BT_UNKNOWN; tail->next = NULL; @@ -8184,14 +8179,12 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns) } /* Generate IF chain. */ - if_st = gfc_get_code (); - if_st->op = EXEC_IF; + if_st = gfc_get_code (EXEC_IF); new_st = if_st; for (body = class_is; body; body = body->block) { - new_st->block = gfc_get_code (); + new_st->block = gfc_get_code (EXEC_IF); new_st = new_st->block; - new_st->op = EXEC_IF; /* Set up IF condition: Call _gfortran_is_extension_of. */ new_st->expr1 = gfc_get_expr (); new_st->expr1->expr_type = EXPR_FUNCTION; @@ -8213,9 +8206,8 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns) } if (default_case->next) { - new_st->block = gfc_get_code (); + new_st->block = gfc_get_code (EXEC_IF); new_st = new_st->block; - new_st->op = EXEC_IF; new_st->next = default_case->next; } @@ -9241,8 +9233,7 @@ build_assignment (gfc_exec_op op, gfc_expr *expr1, gfc_expr *expr2, { gfc_code *this_code; - this_code = gfc_get_code (); - this_code->op = op; + this_code = gfc_get_code (op); this_code->next = NULL; this_code->expr1 = gfc_copy_expr (expr1); this_code->expr2 = gfc_copy_expr (expr2); @@ -10281,13 +10272,12 @@ build_init_assign (gfc_symbol *sym, gfc_expr *init) lval = gfc_lval_expr_from_sym (sym); /* Add the code at scope entry. */ - init_st = gfc_get_code (); + init_st = gfc_get_code (EXEC_INIT_ASSIGN); init_st->next = ns->code; ns->code = init_st; /* Assign the default initializer to the l-value. */ init_st->loc = sym->declared_at; - init_st->op = EXEC_INIT_ASSIGN; init_st->expr1 = lval; init_st->expr2 = init; } |