diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-11-03 14:51:51 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-11-03 14:51:51 +0000 |
commit | ecf24057f806d6766df43f146ceceac651469430 (patch) | |
tree | 0b205366f000dcc61123d9d05537464c13b0f625 /gcc/fortran/trans-decl.c | |
parent | 9d85b4853be3eb11746748e20918a9b57480fbab (diff) | |
download | gcc-ecf24057f806d6766df43f146ceceac651469430.zip gcc-ecf24057f806d6766df43f146ceceac651469430.tar.gz gcc-ecf24057f806d6766df43f146ceceac651469430.tar.bz2 |
gfortran.h: Shorten comment.
* gfortran.h: Shorten comment.
* trans-types.c (gfc_get_function_type): Allow argument to have
flavor FL_PROGRAM.
* trans-decl.c (gfc_sym_mangled_function_id): Mangle main program
name into MAIN__.
(build_function_decl): Fix comment.
* parse.c (main_program_symbol): Give the main program its proper
name, if any. Set its flavor to FL_PROGRAM.
(gfc_parse_file): Likewise.
From-SVN: r129869
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r-- | gcc/fortran/trans-decl.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 5b6b88b..4b114df 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -324,8 +324,12 @@ gfc_sym_mangled_function_id (gfc_symbol * sym) || (sym->module != NULL && (sym->attr.external || sym->attr.if_source == IFSRC_IFBODY))) { - if (strcmp (sym->name, "MAIN__") == 0 - || sym->attr.proc == PROC_INTRINSIC) + /* Main program is mangled into MAIN__. */ + if (sym->attr.is_main_program) + return get_identifier ("MAIN__"); + + /* Intrinsic procedures are never mangled. */ + if (sym->attr.proc == PROC_INTRINSIC) return get_identifier (sym->name); if (gfc_option.flag_underscoring) @@ -1321,7 +1325,7 @@ build_function_decl (gfc_symbol * sym) TREE_SIDE_EFFECTS (fndecl) = 0; } - /* For -fwhole-program to work well, MAIN__ needs to have the + /* For -fwhole-program to work well, the main program needs to have the "externally_visible" attribute. */ if (attr.is_main_program) DECL_ATTRIBUTES (fndecl) |