2004-08-17 Paul Brook <paul@codesourcery.com> Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/13082 * decl.c (get_proc_name): Update mystery comment. (gfc_match_entry): Check for errors earlier. Add entry point to list. * dump-parse-tree.c (gfc_show_code_node): Print EXEC_ENTRY nodes. * gfortran.h (symbol_attribute): Add entry_master. Document entry. (struct gfc_entry_list): Define. (gfc_get_entry_list): Define. (struct gfc_namespace): Add refs and entries. (enum gfc_exec_op): Add EXEC_ENTRY. (struct gfc_code): Add ext.entry. * module.c (ab_attribute, attr_bits): Remove AB_ENTRY. (mio_symbol_attribute): Don't save/reture addr->entry. (mio_namespace_ref): Refcount namespaces. * parse.c (accept_statement): Handle ST_ENTRY. (gfc_fixup_sibling_symbols): Mark symbol as referenced. (parse_contained): Fixup sibling references to entry points after parsing the procedure body. * resolve.c (resolve_contained_fntype): New function. (merge_argument_lists, resolve_entries): New functions. (resolve_contained_functions): Use them. (resolve_code): Handle EXEC_ENTRY. (gfc_resolve): Call resolve_entries. * st.c (gfc_free_statement): Handle EXEC_ENTRY. * symbol.c (gfc_get_namespace): Refcount namespaces. (gfc_free_namespace): Ditto. * trans-array.c (gfc_trans_dummy_array_bias): Treat all args as optional when multiple entry points are present. * trans-decl.c (gfc_get_symbol_decl): Remove incorrect check. (gfc_get_extern_function_decl): Add assertion. Fix coment. (create_function_arglist, trans_function_start, build_entry_thunks): New functions. (gfc_build_function_decl): Rename ... (build_function_decl): ... to this. (gfc_create_function_decl): New function. (gfc_generate_contained_functions): Use it. (gfc_trans_entry_master_switch): New function. (gfc_generate_function_code): Use new functions. * trans-stmt.c (gfc_trans_entry): New function. * trans-stmt.h (gfc_trans_entry): Add prototype. * trans-types.c (gfc_get_function_type): Add entry point argument. * trans.c (gfc_trans_code): Handle EXEC_ENTRY. (gfc_generate_module_code): Call gfc_create_function_decl. * trans.h (gfc_build_function_decl): Remove. (gfc_create_function_decl): Add prototype. testsuite/ * gfortran.dg/entry_1.f90: New test. Co-Authored-By: Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> From-SVN: r86128
67 lines
2.2 KiB
C
67 lines
2.2 KiB
C
/* Header for statement translation functions
|
|
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
|
Contributed by Paul Brook
|
|
|
|
This file is part of GCC.
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
the terms of the GNU General Public License as published by the Free
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
version.
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
|
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
02111-1307, USA. */
|
|
|
|
/* Statement translators (gfc_trans_*) return a fully translated tree.
|
|
Calls gfc_trans_*. */
|
|
tree gfc_trans_code (gfc_code *);
|
|
|
|
/* All other gfc_trans_* should only need be called by gfc_trans_code */
|
|
|
|
/* trans-expr.c */
|
|
tree gfc_trans_assign (gfc_code *);
|
|
tree gfc_trans_pointer_assign (gfc_code *);
|
|
|
|
/* trans-stmt.c */
|
|
tree gfc_trans_cycle (gfc_code *);
|
|
tree gfc_trans_exit (gfc_code *);
|
|
tree gfc_trans_label_assign (gfc_code *);
|
|
tree gfc_trans_label_here (gfc_code *);
|
|
tree gfc_trans_goto (gfc_code *);
|
|
tree gfc_trans_entry (gfc_code *);
|
|
tree gfc_trans_pause (gfc_code *);
|
|
tree gfc_trans_stop (gfc_code *);
|
|
tree gfc_trans_call (gfc_code *);
|
|
tree gfc_trans_return (gfc_code *);
|
|
tree gfc_trans_if (gfc_code *);
|
|
tree gfc_trans_arithmetic_if (gfc_code *);
|
|
tree gfc_trans_do (gfc_code *);
|
|
tree gfc_trans_do_while (gfc_code *);
|
|
tree gfc_trans_select (gfc_code *);
|
|
tree gfc_trans_forall (gfc_code *);
|
|
tree gfc_trans_where (gfc_code *);
|
|
tree gfc_trans_allocate (gfc_code *);
|
|
tree gfc_trans_deallocate (gfc_code *);
|
|
tree gfc_trans_deallocate_array (tree);
|
|
|
|
/* trans-io.c */
|
|
tree gfc_trans_open (gfc_code *);
|
|
tree gfc_trans_close (gfc_code *);
|
|
tree gfc_trans_read (gfc_code *);
|
|
tree gfc_trans_write (gfc_code *);
|
|
tree gfc_trans_iolength (gfc_code *);
|
|
tree gfc_trans_backspace (gfc_code *);
|
|
tree gfc_trans_endfile (gfc_code *);
|
|
tree gfc_trans_inquire (gfc_code *);
|
|
tree gfc_trans_rewind (gfc_code *);
|
|
|
|
tree gfc_trans_transfer (gfc_code *);
|
|
tree gfc_trans_dt_end (gfc_code *);
|