Re: [PATCH] make Ada runtime function building use build_function_type_list

2011-04-27 Thread Nathan Froyd
On Wed, Apr 20, 2011 at 10:08:21AM -0700, Nathan Froyd wrote:
 This patch changes most of the uses of build_function_type in the Ada to
 use build_function_type_list.  There are a handful of
 build_function_type calls left; replacing those will have to wait until
 we get a build_function_type_{n,vec} interface.
 
 Tested on x86_64-unknown-linux-gnu.  OK to commit?

Ping.  http://gcc.gnu.org/ml/gcc-patches/2011-04/msg01675.html

-Nathan


[PATCH] make Ada runtime function building use build_function_type_list

2011-04-20 Thread Nathan Froyd
This patch changes most of the uses of build_function_type in the Ada to
use build_function_type_list.  There are a handful of
build_function_type calls left; replacing those will have to wait until
we get a build_function_type_{n,vec} interface.

Tested on x86_64-unknown-linux-gnu.  OK to commit?

-Nathan

* gcc-interface/trans.c (gigi): Call build_function_type_list
instead of build_function_type.  Adjust calls to...
(build_raise_check): ...this.  Do not take a void_tree parameter.
Call build_function_type_list instead of build_function_type.

diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 378f88c..05e2842 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -214,7 +214,7 @@ static void set_expr_location_from_node (tree, Node_Id);
 static bool set_end_locus_from_node (tree, Node_Id);
 static void set_gnu_expr_location_from_node (tree, Node_Id);
 static int lvalue_required_p (Node_Id, tree, bool, bool, bool);
-static tree build_raise_check (int, tree, enum exception_info_kind);
+static tree build_raise_check (int, enum exception_info_kind);
 
 /* Hooks for debug info back-ends, only supported and used in a restricted set
of configurations.  */
@@ -236,7 +236,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name 
ATTRIBUTE_UNUSED,
   Entity_Id standard_exception_type, Int gigi_operating_mode)
 {
   Entity_Id gnat_literal;
-  tree long_long_float_type, exception_type, t;
+  tree long_long_float_type, exception_type, t, ftype;
   tree int64_type = gnat_type_for_size (64, 0);
   struct elab_info *info;
   int i;
@@ -344,47 +344,39 @@ gigi (Node_Id gnat_root, int max_gnat_node, int 
number_name ATTRIBUTE_UNUSED,
   DECL_IGNORED_P (t) = 1;
   save_gnu_tree (gnat_literal, t, false);
 
-  void_ftype = build_function_type (void_type_node, NULL_TREE);
+  void_ftype = build_function_type_list (void_type_node, NULL_TREE);
   ptr_void_ftype = build_pointer_type (void_ftype);
 
   /* Now declare run-time functions.  */
-  t = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
 
+  ftype = build_function_type_list (ptr_void_type_node, sizetype, NULL_TREE);
   /* malloc is a function declaration tree for a function to allocate
  memory.  */
   malloc_decl
 = create_subprog_decl (get_identifier (__gnat_malloc), NULL_TREE,
-  build_function_type (ptr_void_type_node,
-   tree_cons (NULL_TREE,
-  sizetype, t)),
-  NULL_TREE, false, true, true, NULL, Empty);
+  ftype, NULL_TREE, false, true, true, NULL, Empty);
   DECL_IS_MALLOC (malloc_decl) = 1;
 
   /* malloc32 is a function declaration tree for a function to allocate
  32-bit memory on a 64-bit system.  Needed only on 64-bit VMS.  */
   malloc32_decl
 = create_subprog_decl (get_identifier (__gnat_malloc32), NULL_TREE,
-  build_function_type (ptr_void_type_node,
-   tree_cons (NULL_TREE,
-  sizetype, t)),
-  NULL_TREE, false, true, true, NULL, Empty);
+  ftype, NULL_TREE, false, true, true, NULL, Empty);
   DECL_IS_MALLOC (malloc32_decl) = 1;
 
   /* free is a function declaration tree for a function to free memory.  */
+  ftype = build_function_type_list (void_type_node,
+   ptr_void_type_node, NULL_TREE);
   free_decl
 = create_subprog_decl (get_identifier (__gnat_free), NULL_TREE,
-  build_function_type (void_type_node,
-   tree_cons (NULL_TREE,
-  ptr_void_type_node,
-  t)),
-  NULL_TREE, false, true, true, NULL, Empty);
+  ftype, NULL_TREE, false, true, true, NULL, Empty);
 
   /* This is used for 64-bit multiplication with overflow checking.  */
+  ftype = build_function_type_list (int64_type,
+   int64_type, int64_type, NULL_TREE);
   mulv64_decl
 = create_subprog_decl (get_identifier (__gnat_mulv64), NULL_TREE,
-  build_function_type_list (int64_type, int64_type,
-int64_type, NULL_TREE),
-  NULL_TREE, false, true, true, NULL, Empty);
+  ftype, NULL_TREE, false, true, true, NULL, Empty);
 
   /* Name of the _Parent field in tagged record types.  */
   parent_name_id = get_identifier (Get_Name_String (Name_uParent));
@@ -401,61 +393,54 @@ gigi (Node_Id gnat_root, int max_gnat_node, int 
number_name ATTRIBUTE_UNUSED,
   jmpbuf_ptr_type = build_pointer_type (jmpbuf_type);
 
   /*