trans-decl.c, [...]: Replace all occurences of 'gfc_strlen_type_node' by 'gfc_charlen...
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Tue, 31 Aug 2004 14:06:48 +0000 (16:06 +0200)
committerTobias Schlüter <tobi@gcc.gnu.org>
Tue, 31 Aug 2004 14:06:48 +0000 (16:06 +0200)
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

14 files changed:
gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/fortran/trans-const.c
gcc/fortran/trans-decl.c
gcc/fortran/trans-expr.c
gcc/fortran/trans-io.c
gcc/fortran/trans-types.c
gcc/fortran/trans-types.h
libgfortran/ChangeLog
libgfortran/intrinsics/args.c
libgfortran/intrinsics/env.c
libgfortran/io/io.h
libgfortran/io/transfer.c
libgfortran/libgfortran.h

index 191ed703371d3230be781c8574adefb4a3330ab9..74ada4c8a35d2e06a9c90d6e071a51f6115eb6fa 100644 (file)
@@ -1,3 +1,10 @@
+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.
index 1aa1a67e315f687b5f1128cb0af1818e4f7e8485..4ba5e8c4652419f5349d89d112e0a4fe200ffe5a 100644 (file)
@@ -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;
 
index 10f701aeb6fabc91a4e6c70e228fe43014a3adc0..670e2f5df9c42ad3061bde08526ace6f2d7b83ee 100644 (file)
@@ -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;
 }
index 7ceebcce93cad990f320f7ea62d12c813e16c03b..730448a6595b7223489d57ccde718b222f15a8cd 100644 (file)
@@ -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"),
index 3884c012970e09f9cd6e00940e38a754b9190fa8..94653c95a547306b2f0cc89a6e06908efab61ee3 100644 (file)
@@ -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));
                 }
            }
index 56023b6fc69803addc433d7bafef2719e1d9cd8e..d1bf736c0e74ea5738777a9e823e61524b3f7cf9 100644 (file)
@@ -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,
index faa8ecfed378fb907155ce01774b5791f918c583..f65a9d71c218c4d361cbb14a58db78e358504cc7 100644 (file)
@@ -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);
 
index 6e92359de39ab16a390f13a3ac90bb3bdd0f5967..7a57961941d4b75bfa9fa63c7d24bc32b434990f 100644 (file)
@@ -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 *);
index 49af8438bf21412a4513ca9be8e6cea2a593acc2..ecc104e5ffc9ca81f3c70f72d5ab9962426c58be 100644 (file)
@@ -1,3 +1,10 @@
+2004-08-31  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * 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'.
+
 2004-08-31  Paul Brook  <paul@codesourcery.com>
 
        * libgfortran.h: Add comments.
index caa55d46d8ba9a6163f218ca972bc578b38a9c6e..984fa91d3521f701dcaf3e765cb6ac57ae26fe14 100644 (file)
@@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA.  */
 /* Get a commandline argument.  */
 
 void 
-prefix(getarg_i4) (GFC_INTEGER_4 *pos, char  *val, gfc_strlen_type val_len)
+prefix(getarg_i4) (GFC_INTEGER_4 *pos, char  *val, gfc_charlen_type val_len)
 {
   int argc;
   int arglen;
@@ -55,7 +55,7 @@ prefix(getarg_i4) (GFC_INTEGER_4 *pos, char  *val, gfc_strlen_type val_len)
 /* INTEGER*8 wrapper of getarg.  */
 
 void 
-prefix(getarg_i8) (GFC_INTEGER_8 *pos, char  *val, gfc_strlen_type val_len)
+prefix(getarg_i8) (GFC_INTEGER_8 *pos, char  *val, gfc_charlen_type val_len)
 {
   GFC_INTEGER_4 pos4;
 
@@ -103,7 +103,7 @@ prefix(get_command_argument_i4) (GFC_INTEGER_4 *number,
                                 char *value, 
                                 GFC_INTEGER_4 *length, 
                                 GFC_INTEGER_4 *status, 
-                                gfc_strlen_type value_len)
+                                gfc_charlen_type value_len)
 {
   int argc, arglen = 0, stat_flag = GFC_GC_SUCCESS;
   char **argv;
@@ -155,7 +155,7 @@ prefix(get_command_argument_i8) (GFC_INTEGER_8 *number,
                                 char *value, 
                                 GFC_INTEGER_8 *length, 
                                 GFC_INTEGER_8 *status, 
-                                gfc_strlen_type value_len)
+                                gfc_charlen_type value_len)
 {
   GFC_INTEGER_4 number4;
   GFC_INTEGER_4 length4;
@@ -177,7 +177,7 @@ void
 prefix(get_command_i4) (char *command, 
                        GFC_INTEGER_4 *length, 
                        GFC_INTEGER_4 *status,
-                       gfc_strlen_type command_len)
+                       gfc_charlen_type command_len)
 {
   int i, argc, arglen, thisarg;
   int stat_flag = GFC_GC_SUCCESS;
@@ -237,7 +237,7 @@ void
 prefix(get_command_i8) (char *command, 
                        GFC_INTEGER_8 *length, 
                        GFC_INTEGER_8 *status,
-                       gfc_strlen_type command_len)
+                       gfc_charlen_type command_len)
 {
   GFC_INTEGER_4 length4;
   GFC_INTEGER_4 status4;
index 9898471844ae019d37fa7e2312805a8e79d96643..6695d5b9cf66f9f13265d205e90a450263dcf3e9 100644 (file)
@@ -34,8 +34,8 @@ Boston, MA 02111-1307, USA.  */
 void 
 prefix(getenv) (char * name, 
                char * value, 
-               gfc_strlen_type name_len, 
-               gfc_strlen_type value_len)
+               gfc_charlen_type name_len, 
+               gfc_charlen_type value_len)
 {
 
   /* Make a null-terminated copy of the name string so that c library
@@ -99,8 +99,8 @@ prefix(get_environment_variable_i4)
    GFC_INTEGER_4 *length,
    GFC_INTEGER_4 *status,
    GFC_LOGICAL_4 *trim_name,
-   gfc_strlen_type name_len,
-   gfc_strlen_type value_len)
+   gfc_charlen_type name_len,
+   gfc_charlen_type value_len)
 {
   int stat = GFC_SUCCESS, res_len = 0;
   char name_nt[name_len+1], *res;
@@ -164,8 +164,8 @@ prefix(get_environment_variable_i8)
    GFC_INTEGER_8 *length,
    GFC_INTEGER_8 *status,
    GFC_LOGICAL_8 *trim_name,
-   gfc_strlen_type name_len,
-   gfc_strlen_type value_len)
+   gfc_charlen_type name_len,
+   gfc_charlen_type value_len)
 {
   GFC_INTEGER_4 length4, status4;
   GFC_LOGICAL_4 trim_name4;
index d2c15af7ec76621e11e0c8ac8b8dd9a85c659e05..e910fa5878046478ca5958bf376c86fffc36702d 100644 (file)
@@ -549,7 +549,7 @@ void st_set_nml_var_int (void * , char * , int , int );
 void st_set_nml_var_float (void * , char * , int , int );
 
 #define st_set_nml_var_char prefix(st_set_nml_var_char)
-void st_set_nml_var_char (void * , char * , int , int, gfc_strlen_type);
+void st_set_nml_var_char (void * , char * , int , int, gfc_charlen_type);
 
 #define st_set_nml_var_complex prefix(st_set_nml_var_complex)
 void st_set_nml_var_complex (void * , char * , int , int );
index 3800d0b90cb750bd9ce915c93614d65c39614482..5d4dcd592a0e1f1afe1910b4b6fe94018ad8924f 100644 (file)
@@ -1578,7 +1578,7 @@ st_set_nml_var_float (void * var_addr, char * var_name, int var_name_len,
 
 void
 st_set_nml_var_char (void * var_addr, char * var_name, int var_name_len,
-                    int kind, gfc_strlen_type string_length)
+                    int kind, gfc_charlen_type string_length)
 {
 
   st_set_nml_var (var_addr, var_name, var_name_len, kind, BT_CHARACTER,
index 28197033b330a17526ef666439eb5ed9179bea04..463cd60348f1841e673743d5e5bd5a8a7e6474d9 100644 (file)
@@ -91,8 +91,8 @@ typedef complex double GFC_COMPLEX_8;
    by the compiler.  */
 /* The type used of array indices, amongst other things.  */
 typedef size_t index_type;
-/* The type used for string lengths.  Nothing to do with strlen(3).  */
-typedef GFC_INTEGER_4 gfc_strlen_type;
+/* The type used for the lengths of character variables.  */
+typedef GFC_INTEGER_4 gfc_charlen_type;
 
 /* This will be 0 on little-endian machines and one on big-endian machines.  */
 #define l8_to_l4_offset prefix(l8_to_l4_offset)