This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, fortran] decl.c, trans-decl.c misc trivia
- From: Bernhard Fischer <rep dot dot dot nop at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org, rep dot dot dot nop at gmail dot com
- Date: Wed, 22 Aug 2007 23:52:55 +0200
- Subject: [patch, fortran] decl.c, trans-decl.c misc trivia
Hi,
gcc/fortran/ChangeLog
2007-08-22 Bernhard Fischer <me>
* decl.c (match_prefix): Make seen_type bool.
(add_global_entry): Cache type.
* trans-decl.c: Whitespace cleanup.
Ok for (4.3/)trunk ?
Index: gcc-4.3/gcc/fortran/decl.c
===================================================================
--- gcc-4.3/gcc/fortran/decl.c (revision 127717)
+++ gcc-4.3/gcc/fortran/decl.c (working copy)
@@ -3337,7 +3337,7 @@ cleanup:
static match
match_prefix (gfc_typespec *ts)
{
- int seen_type;
+ bool seen_type;
gfc_clear_attr (¤t_attr);
seen_type = 0;
@@ -3761,16 +3761,18 @@ static bool
add_global_entry (const char *name, int sub)
{
gfc_gsymbol *s;
+ int type;
s = gfc_get_gsymbol(name);
+ type = sub ? GSYM_SUBROUTINE : GSYM_FUNCTION;
if (s->defined
|| (s->type != GSYM_UNKNOWN
- && s->type != (sub ? GSYM_SUBROUTINE : GSYM_FUNCTION)))
+ && s->type != type))
global_used(s, NULL);
else
{
- s->type = sub ? GSYM_SUBROUTINE : GSYM_FUNCTION;
+ s->type = type;
s->where = gfc_current_locus;
s->defined = 1;
return true;
Index: gcc-4.3/gcc/fortran/trans-decl.c
===================================================================
--- gcc-4.3/gcc/fortran/trans-decl.c (revision 127717)
+++ gcc-4.3/gcc/fortran/trans-decl.c (working copy)
@@ -2043,7 +2043,7 @@ gfc_build_intrinsic_function_decls (void
gfc_charlen_type_node, pchar_type_node,
gfc_logical4_type_node);
- gfor_fndecl_string_trim =
+ gfor_fndecl_string_trim =
gfc_build_library_function_decl (get_identifier (PREFIX("string_trim")),
void_type_node,
4,
@@ -2104,7 +2104,7 @@ gfc_build_intrinsic_function_decls (void
pvoid_type_node);
gfor_fndecl_sr_kind =
- gfc_build_library_function_decl (get_identifier
+ gfc_build_library_function_decl (get_identifier
(PREFIX("selected_real_kind")),
gfc_int4_type_node,
2, pvoid_type_node,
@@ -3092,7 +3092,7 @@ gfc_trans_entry_master_switch (gfc_entry
val = build_int_cst (gfc_array_index_type, el->id);
tmp = build3_v (CASE_LABEL_EXPR, val, NULL_TREE, label);
gfc_add_expr_to_block (&block, tmp);
-
+
/* And jump to the actual entry point. */
label = gfc_build_label_decl (NULL_TREE);
tmp = build1_v (GOTO_EXPR, label);
@@ -3174,7 +3174,7 @@ gfc_generate_function_code (gfc_namespac
gfc_generate_contained_functions (ns);
generate_local_vars (ns);
-
+
/* Keep the parent fake result declaration in module functions
or external procedures. */
if ((ns->parent && ns->parent->proc_name->attr.flavor == FL_MODULE)