aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2004-08-31 16:06:48 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2004-08-31 16:06:48 +0200
commitd7177ab25e9cfef12aa2b0e2a2f68d7f3c81735a (patch)
tree03f0761ea8c07c55c2cd86b5b996c3027f155857 /gcc
parentf36327db85b62d102049ee46db8ee4d39df045e2 (diff)
downloadgcc-d7177ab25e9cfef12aa2b0e2a2f68d7f3c81735a.zip
gcc-d7177ab25e9cfef12aa2b0e2a2f68d7f3c81735a.tar.gz
gcc-d7177ab25e9cfef12aa2b0e2a2f68d7f3c81735a.tar.bz2
trans-decl.c, [...]: Replace all occurences of 'gfc_strlen_type_node' by 'gfc_charlen_type_node'.
fortran/ * trans-decl.c, trans-expr.c, trans-io.c, trans-types.c: Replace all occurences of 'gfc_strlen_type_node' by 'gfc_charlen_type_node'. * trans-types.h: Same. Also update comment accordingly. libgfortran/ * libgfortran.h: Replace 'gfc_strlen_type' by 'gfc_charlen_type'. Update comment accordingly. * intrinsics/args.c, intrinsics/env.c, io/io.h, io/transfer.c: Replace all occurences of 'gfc_strlen_type' by 'gfc_charlen_type'. From-SVN: r86828
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/trans-array.c2
-rw-r--r--gcc/fortran/trans-const.c2
-rw-r--r--gcc/fortran/trans-decl.c48
-rw-r--r--gcc/fortran/trans-expr.c24
-rw-r--r--gcc/fortran/trans-io.c2
-rw-r--r--gcc/fortran/trans-types.c8
-rw-r--r--gcc/fortran/trans-types.h7
8 files changed, 53 insertions, 47 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 191ed70..74ada4c 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,12 @@
2004-08-31 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
+ * trans-decl.c, trans-expr.c, trans-io.c, trans-types.c: Replace
+ all occurences of 'gfc_strlen_type_node' by
+ 'gfc_charlen_type_node'.
+ * trans-types.h: Same. Also update comment accordingly.
+
+2004-08-31 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
+
* primary.c: Update copyright boilerplate to say GCC.
* f95-lang.c: Change initial comment to say gfortran.
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 1aa1a67..4ba5e8c 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -1072,7 +1072,7 @@ get_array_ctor_strlen (gfc_constructor * c, tree * len)
{
case EXPR_CONSTANT:
if (!(*len && INTEGER_CST_P (*len)))
- *len = build_int_cstu (gfc_strlen_type_node,
+ *len = build_int_cstu (gfc_charlen_type_node,
c->expr->value.character.length);
break;
diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c
index 10f701a..670e2f5 100644
--- a/gcc/fortran/trans-const.c
+++ b/gcc/fortran/trans-const.c
@@ -85,7 +85,7 @@ gfc_build_string_const (int length, const char *s)
len = build_int_cst (NULL_TREE, length);
TREE_TYPE (str) =
build_array_type (gfc_character1_type_node,
- build_range_type (gfc_strlen_type_node,
+ build_range_type (gfc_charlen_type_node,
integer_one_node, len));
return str;
}
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 7ceebcc..730448a 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -670,7 +670,7 @@ gfc_create_string_length (gfc_symbol * sym)
strcpy (&name[1], sym->name);
name[0] = '.';
length = build_decl (VAR_DECL, get_identifier (name),
- gfc_strlen_type_node);
+ gfc_charlen_type_node);
DECL_ARTIFICIAL (length) = 1;
TREE_USED (length) = 1;
gfc_defer_symbol_init (sym);
@@ -781,7 +781,7 @@ gfc_get_symbol_decl (gfc_symbol * sym)
{
gfc_allocate_lang_decl (decl);
GFC_DECL_ASSIGN (decl) = 1;
- length = gfc_create_var (gfc_strlen_type_node, sym->name);
+ length = gfc_create_var (gfc_charlen_type_node, sym->name);
GFC_DECL_STRING_LEN (decl) = length;
GFC_DECL_ASSIGN_ADDR (decl) = gfc_create_var (pvoid_type_node, sym->name);
/* TODO: Need to check we don't change TREE_STATIC (decl) later. */
@@ -1130,7 +1130,7 @@ create_function_arglist (gfc_symbol * sym)
/* Length of character result. */
type = TREE_VALUE (typelist);
- assert (type == gfc_strlen_type_node);
+ assert (type == gfc_charlen_type_node);
length = build_decl (PARM_DECL,
get_identifier (".__result"),
@@ -1192,7 +1192,7 @@ create_function_arglist (gfc_symbol * sym)
parm = f->sym->backend_decl;
type = TREE_VALUE (typelist);
- assert (type == gfc_strlen_type_node);
+ assert (type == gfc_charlen_type_node);
strcpy (&name[1], f->sym->name);
name[0] = '_';
@@ -1383,7 +1383,7 @@ build_entry_thunks (gfc_namespace * ns)
args = tree_cons (NULL_TREE, null_pointer_node, args);
if (formal->sym->ts.type == BT_CHARACTER)
{
- tmp = convert (gfc_strlen_type_node, integer_zero_node);
+ tmp = convert (gfc_charlen_type_node, integer_zero_node);
string_args = tree_cons (NULL_TREE, tmp, string_args);
}
}
@@ -1572,58 +1572,58 @@ gfc_build_intrinsic_function_decls (void)
gfc_build_library_function_decl (get_identifier (PREFIX("copy_string")),
void_type_node,
4,
- gfc_strlen_type_node, pchar_type_node,
- gfc_strlen_type_node, pchar_type_node);
+ gfc_charlen_type_node, pchar_type_node,
+ gfc_charlen_type_node, pchar_type_node);
gfor_fndecl_compare_string =
gfc_build_library_function_decl (get_identifier (PREFIX("compare_string")),
gfc_int4_type_node,
4,
- gfc_strlen_type_node, pchar_type_node,
- gfc_strlen_type_node, pchar_type_node);
+ gfc_charlen_type_node, pchar_type_node,
+ gfc_charlen_type_node, pchar_type_node);
gfor_fndecl_concat_string =
gfc_build_library_function_decl (get_identifier (PREFIX("concat_string")),
void_type_node,
6,
- gfc_strlen_type_node, pchar_type_node,
- gfc_strlen_type_node, pchar_type_node,
- gfc_strlen_type_node, pchar_type_node);
+ gfc_charlen_type_node, pchar_type_node,
+ gfc_charlen_type_node, pchar_type_node,
+ gfc_charlen_type_node, pchar_type_node);
gfor_fndecl_string_len_trim =
gfc_build_library_function_decl (get_identifier (PREFIX("string_len_trim")),
gfc_int4_type_node,
- 2, gfc_strlen_type_node,
+ 2, gfc_charlen_type_node,
pchar_type_node);
gfor_fndecl_string_index =
gfc_build_library_function_decl (get_identifier (PREFIX("string_index")),
gfc_int4_type_node,
- 5, gfc_strlen_type_node, pchar_type_node,
- gfc_strlen_type_node, pchar_type_node,
+ 5, gfc_charlen_type_node, pchar_type_node,
+ gfc_charlen_type_node, pchar_type_node,
gfc_logical4_type_node);
gfor_fndecl_string_scan =
gfc_build_library_function_decl (get_identifier (PREFIX("string_scan")),
gfc_int4_type_node,
- 5, gfc_strlen_type_node, pchar_type_node,
- gfc_strlen_type_node, pchar_type_node,
+ 5, gfc_charlen_type_node, pchar_type_node,
+ gfc_charlen_type_node, pchar_type_node,
gfc_logical4_type_node);
gfor_fndecl_string_verify =
gfc_build_library_function_decl (get_identifier (PREFIX("string_verify")),
gfc_int4_type_node,
- 5, gfc_strlen_type_node, pchar_type_node,
- gfc_strlen_type_node, pchar_type_node,
+ 5, gfc_charlen_type_node, pchar_type_node,
+ gfc_charlen_type_node, pchar_type_node,
gfc_logical4_type_node);
gfor_fndecl_string_trim =
gfc_build_library_function_decl (get_identifier (PREFIX("string_trim")),
void_type_node,
4,
- build_pointer_type (gfc_strlen_type_node),
+ build_pointer_type (gfc_charlen_type_node),
ppvoid_type_node,
- gfc_strlen_type_node,
+ gfc_charlen_type_node,
pchar_type_node);
gfor_fndecl_string_repeat =
@@ -1631,7 +1631,7 @@ gfc_build_intrinsic_function_decls (void)
void_type_node,
4,
pchar_type_node,
- gfc_strlen_type_node,
+ gfc_charlen_type_node,
pchar_type_node,
gfc_int4_type_node);
@@ -1640,14 +1640,14 @@ gfc_build_intrinsic_function_decls (void)
void_type_node,
3,
pchar_type_node,
- gfc_strlen_type_node, pchar_type_node);
+ gfc_charlen_type_node, pchar_type_node);
gfor_fndecl_adjustr =
gfc_build_library_function_decl (get_identifier (PREFIX("adjustr")),
void_type_node,
3,
pchar_type_node,
- gfc_strlen_type_node, pchar_type_node);
+ gfc_charlen_type_node, pchar_type_node);
gfor_fndecl_si_kind =
gfc_build_library_function_decl (get_identifier ("selected_int_kind"),
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 3884c01..94653c9 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -151,7 +151,7 @@ gfc_trans_init_string_length (gfc_charlen * cl, stmtblock_t * pblock)
tree tmp;
gfc_init_se (&se, NULL);
- gfc_conv_expr_type (&se, cl->length, gfc_strlen_type_node);
+ gfc_conv_expr_type (&se, cl->length, gfc_charlen_type_node);
gfc_add_block_to_block (pblock, &se.pre);
tmp = cl->backend_decl;
@@ -173,7 +173,7 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind)
var = NULL_TREE;
gfc_init_se (&start, se);
- gfc_conv_expr_type (&start, ref->u.ss.start, gfc_strlen_type_node);
+ gfc_conv_expr_type (&start, ref->u.ss.start, gfc_charlen_type_node);
gfc_add_block_to_block (&se->pre, &start.pre);
if (integer_onep (start.expr))
@@ -195,14 +195,14 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind)
end.expr = se->string_length;
else
{
- gfc_conv_expr_type (&end, ref->u.ss.end, gfc_strlen_type_node);
+ gfc_conv_expr_type (&end, ref->u.ss.end, gfc_charlen_type_node);
gfc_add_block_to_block (&se->pre, &end.pre);
}
tmp =
- build2 (MINUS_EXPR, gfc_strlen_type_node,
- fold_convert (gfc_strlen_type_node, integer_one_node),
+ build2 (MINUS_EXPR, gfc_charlen_type_node,
+ fold_convert (gfc_charlen_type_node, integer_one_node),
start.expr);
- tmp = build2 (PLUS_EXPR, gfc_strlen_type_node, end.expr, tmp);
+ tmp = build2 (PLUS_EXPR, gfc_charlen_type_node, end.expr, tmp);
se->string_length = fold (tmp);
}
@@ -688,14 +688,14 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len)
tree tmp;
tree args;
- if (TREE_TYPE (len) != gfc_strlen_type_node)
+ if (TREE_TYPE (len) != gfc_charlen_type_node)
abort ();
if (gfc_can_put_var_on_stack (len))
{
/* Create a temporary variable to hold the result. */
- tmp = fold (build2 (MINUS_EXPR, gfc_strlen_type_node, len,
- convert (gfc_strlen_type_node,
+ tmp = fold (build2 (MINUS_EXPR, gfc_charlen_type_node, len,
+ convert (gfc_charlen_type_node,
integer_one_node)));
tmp = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp);
tmp = build_array_type (gfc_character1_type_node, tmp);
@@ -1067,8 +1067,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
var = gfc_conv_string_tmp (se, type, len);
arglist = gfc_chainon_list (arglist, var);
- arglist = gfc_chainon_list (arglist, convert (gfc_strlen_type_node,
- len));
+ arglist = gfc_chainon_list (arglist,
+ convert (gfc_charlen_type_node, len));
}
else /* TODO: derived type function return values. */
abort ();
@@ -1101,7 +1101,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
{
stringargs =
gfc_chainon_list (stringargs,
- convert (gfc_strlen_type_node,
+ convert (gfc_charlen_type_node,
integer_zero_node));
}
}
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 56023b6..d1bf736 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -333,7 +333,7 @@ gfc_build_io_library_fndecls (void)
void_type_node, 5,
pvoid_type_node, pvoid_type_node,
gfc_int4_type_node, gfc_int4_type_node,
- gfc_strlen_type_node);
+ gfc_charlen_type_node);
iocall_set_nml_val_complex =
gfc_build_library_function_decl (get_identifier (PREFIX("st_set_nml_var_complex")),
void_type_node, 4,
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index faa8ecf..f65a9d7 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -55,7 +55,7 @@ tree pvoid_type_node;
tree ppvoid_type_node;
tree pchar_type_node;
tree gfc_character1_type_node;
-tree gfc_strlen_type_node;
+tree gfc_charlen_type_node;
static GTY(()) tree gfc_desc_dim_type;
static GTY(()) tree gfc_max_array_element_size;
@@ -541,7 +541,7 @@ gfc_init_types (void)
boolean_false_node = build_int_cst (boolean_type_node, 0);
/* ??? Shouldn't this be based on gfc_index_integer_kind or so? */
- gfc_strlen_type_node = gfc_get_int_type (4);
+ gfc_charlen_type_node = gfc_get_int_type (4);
}
/* Get the type node for the given type and kind. */
@@ -1502,7 +1502,7 @@ gfc_get_function_type (gfc_symbol * sym)
typelist = gfc_chainon_list (typelist, type);
if (arg->ts.type == BT_CHARACTER)
- typelist = gfc_chainon_list (typelist, gfc_strlen_type_node);
+ typelist = gfc_chainon_list (typelist, gfc_charlen_type_node);
}
/* Build the argument types for the function. */
@@ -1551,7 +1551,7 @@ gfc_get_function_type (gfc_symbol * sym)
/* Add hidden string length parameters. */
while (nstr--)
- typelist = gfc_chainon_list (typelist, gfc_strlen_type_node);
+ typelist = gfc_chainon_list (typelist, gfc_charlen_type_node);
typelist = gfc_chainon_list (typelist, void_type_node);
diff --git a/gcc/fortran/trans-types.h b/gcc/fortran/trans-types.h
index 6e92359..7a57961 100644
--- a/gcc/fortran/trans-types.h
+++ b/gcc/fortran/trans-types.h
@@ -45,12 +45,11 @@ extern GTY(()) tree gfc_character1_type_node;
extern GTY(()) tree ppvoid_type_node;
extern GTY(()) tree pvoid_type_node;
extern GTY(()) tree pchar_type_node;
-/* This is the type used to hold string lengths. It has nothing to do with
- the C strlen(3) function. It must be the same as the corresponding
- definition in gfortran.h. */
+/* This is the type used to hold the lengths of character variables.
+ It must be the same as the corresponding definition in gfortran.h. */
/* TODO: This is still hardcoded as kind=4 in some bits of the compiler
and runtime library. */
-extern GTY(()) tree gfc_strlen_type_node;
+extern GTY(()) tree gfc_charlen_type_node;
/* be-function.c */
void gfc_convert_function_code (gfc_namespace *);