aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2019-05-08 21:55:13 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2019-05-08 21:55:13 +0000
commit6328ce1f83c260ac7728f9490870c326944b17d8 (patch)
tree6b41257889c17529a03ad9bc8a581c7080a3a748 /gcc/fortran/parse.c
parent8ba2bda8e4b4276770901b720dee4f3d297dda3c (diff)
downloadgcc-6328ce1f83c260ac7728f9490870c326944b17d8.zip
gcc-6328ce1f83c260ac7728f9490870c326944b17d8.tar.gz
gcc-6328ce1f83c260ac7728f9490870c326944b17d8.tar.bz2
re PR fortran/90351 (-fc-prototypes does not dump prototypes for external procedures)
2019-05-08 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/90351 PR fortran/90329 * gfortran.dg/dump-parse-tree.c: Include version.h. (gfc_dump_external_c_prototypes): New function. (get_c_type_name): Select "char" as a name for a simple char. Adjust to handling external functions. Also handle complex. (write_decl): Add argument bind_c. Adjust for dumping of external procedures. (write_proc): Likewise. (write_interop_decl): Add bind_c argument to call of write_proc. * gfortran.h: Add prototype for gfc_dump_external_c_prototypes. * lang.opt: Add -fc-prototypes-external flag. * parse.c (gfc_parse_file): Move dumping of BIND(C) prototypes. Call gfc_dump_external_c_prototypes if option is set. * invoke.texi: Document -fc-prototypes-external. From-SVN: r271018
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 14cda5f..9d69359 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -6278,9 +6278,6 @@ loop:
if (flag_dump_fortran_original)
gfc_dump_parse_tree (gfc_current_ns, stdout);
- if (flag_c_prototypes)
- gfc_dump_c_prototypes (gfc_current_ns, stdout);
-
gfc_get_errors (NULL, &errors);
if (s.state == COMP_MODULE || s.state == COMP_SUBMODULE)
{
@@ -6333,6 +6330,18 @@ done:
fputs ("------------------------------------------\n\n", stdout);
}
+ /* Dump C prototypes. */
+ if (flag_c_prototypes)
+ {
+ for (gfc_current_ns = gfc_global_ns_list; gfc_current_ns;
+ gfc_current_ns = gfc_current_ns->sibling)
+ gfc_dump_c_prototypes (gfc_current_ns, stdout);
+ }
+
+ /* Dump external prototypes. */
+ if (flag_c_prototypes_external)
+ gfc_dump_external_c_prototypes (stdout);
+
/* Do the translation. */
translate_all_program_units (gfc_global_ns_list);