]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
trans-array.h (gfc_conv_descriptor_rank): New prototype.
authorMikael Morin <mikael@gcc.gnu.org>
Thu, 2 Aug 2012 19:20:43 +0000 (19:20 +0000)
committerMikael Morin <mikael@gcc.gnu.org>
Thu, 2 Aug 2012 19:20:43 +0000 (19:20 +0000)
* trans-array.h (gfc_conv_descriptor_rank): New prototype.
* trans-array.c (gfc_conv_descriptor_rank): New function moved and
renamed ...
* trans-intrinsic.c (get_rank_from_desc): ... from this one.
(gfc_conv_intrinsic_rank, gfc_conv_intrinsic_bound,
gfc_conv_associated): Also rename function calls.

From-SVN: r190095

gcc/fortran/ChangeLog
gcc/fortran/trans-array.c
gcc/fortran/trans-array.h
gcc/fortran/trans-intrinsic.c

index 94bb958aa5f1998f00ef79639e18eefbfcde4d7e..036e973bcf132c9d9f38633fd8f7d06cae54a837 100644 (file)
@@ -1,3 +1,12 @@
+2012-08-02  Mikael Morin  <mikael@gcc.gnu.org>
+
+       * trans-array.h (gfc_conv_descriptor_rank): New prototype.
+       * trans-array.c (gfc_conv_descriptor_rank): New function moved and
+       renamed ...
+       * trans-intrinsic.c (get_rank_from_desc): ... from this one.
+       (gfc_conv_intrinsic_rank, gfc_conv_intrinsic_bound,
+       gfc_conv_associated): Also rename function calls.
+
 2012-08-02  Mikael Morin  <mikael@gcc.gnu.org>
 
        * iresolve.c (resolve_bound, gfc_resolve_shape):
index 555d69696bb829d51409f9b23a6a51b7959d4e2b..abdb9eabd4fb132be316eaa9bb14ff84ce1a4b1e 100644 (file)
@@ -248,6 +248,20 @@ gfc_conv_descriptor_dtype (tree desc)
 }
 
 
+tree
+gfc_conv_descriptor_rank (tree desc)
+{
+  tree tmp;
+  tree dtype;
+
+  dtype = gfc_conv_descriptor_dtype (desc);
+  tmp = build_int_cst (TREE_TYPE (dtype), GFC_DTYPE_RANK_MASK);
+  tmp = fold_build2_loc (input_location, BIT_AND_EXPR, TREE_TYPE (dtype),
+                        dtype, tmp);
+  return fold_convert (gfc_get_int_type (gfc_default_integer_kind), tmp);
+}
+
+
 tree
 gfc_get_descriptor_dimension (tree desc)
 {
index b7ab806fd18f021c5d6561efca495ac8b2f0a158..5ad794ad752f779cd3c9393998a42379414bf04e 100644 (file)
@@ -154,6 +154,7 @@ tree gfc_conv_descriptor_data_get (tree);
 tree gfc_conv_descriptor_data_addr (tree);
 tree gfc_conv_descriptor_offset_get (tree);
 tree gfc_conv_descriptor_dtype (tree);
+tree gfc_conv_descriptor_rank (tree);
 tree gfc_get_descriptor_dimension (tree);
 tree gfc_conv_descriptor_stride_get (tree, tree);
 tree gfc_conv_descriptor_lbound_get (tree, tree);
index 7bcfda9301d3f9d44a42340503a3befc03a92cc8..fac29c7f5f60a5b6f459b65f00c22a45a82b0d41 100644 (file)
@@ -1315,20 +1315,6 @@ trans_num_images (gfc_se * se)
 }
 
 
-static tree
-get_rank_from_desc (tree desc)
-{
-  tree tmp;
-  tree dtype;
-
-  dtype = gfc_conv_descriptor_dtype (desc);
-  tmp = build_int_cst (TREE_TYPE (dtype), GFC_DTYPE_RANK_MASK);
-  tmp = fold_build2_loc (input_location, BIT_AND_EXPR, TREE_TYPE (dtype),
-                        dtype, tmp);
-  return fold_convert (gfc_get_int_type (gfc_default_integer_kind), tmp);
-}
-
-
 static void
 gfc_conv_intrinsic_rank (gfc_se *se, gfc_expr *expr)
 {
@@ -1345,7 +1331,7 @@ gfc_conv_intrinsic_rank (gfc_se *se, gfc_expr *expr)
   gfc_add_block_to_block (&se->pre, &argse.pre);
   gfc_add_block_to_block (&se->post, &argse.post);
 
-  se->expr = get_rank_from_desc (argse.expr);
+  se->expr = gfc_conv_descriptor_rank (argse.expr);
 }
 
 
@@ -1434,7 +1420,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
           cond = fold_build2_loc (input_location, LT_EXPR, boolean_type_node,
                                  bound, build_int_cst (TREE_TYPE (bound), 0));
          if (as && as->type == AS_ASSUMED_RANK)
-           tmp = get_rank_from_desc (desc);
+           tmp = gfc_conv_descriptor_rank (desc);
          else
            tmp = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (TREE_TYPE (desc))];
           tmp = fold_build2_loc (input_location, GE_EXPR, boolean_type_node,
@@ -5895,7 +5881,7 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr)
          gfc_conv_expr_lhs (&arg1se, arg1->expr);
          if (arg1->expr->rank == -1)
            {
-             tmp = get_rank_from_desc (arg1se.expr);
+             tmp = gfc_conv_descriptor_rank (arg1se.expr);
              tmp = fold_build2_loc (input_location, MINUS_EXPR,
                                     TREE_TYPE (tmp), tmp, gfc_index_one_node);
            }