aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2011-05-11 15:53:50 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2011-05-11 15:53:50 +0000
commite5b00edff55b11ccb722f6a14f6449b68bec8069 (patch)
tree6fb9c0ffbdccf1ed60971b3840c943116318e364 /gcc/ada
parentd034095964209d6ee81c5f0cf93420b0f011fec4 (diff)
downloadgcc-e5b00edff55b11ccb722f6a14f6449b68bec8069.zip
gcc-e5b00edff55b11ccb722f6a14f6449b68bec8069.tar.gz
gcc-e5b00edff55b11ccb722f6a14f6449b68bec8069.tar.bz2
don't use build_function_type in the Ada FE
don't use build_function_type in the Ada FE * gcc-interface/utils.c (def_fn_type): Don't call build_function_type; call build_function_type_array or build_varargs_function_type_array instead. (create_subprog_type): Don't call build_function_type; call build_function_type_vec instead. From-SVN: r173664
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog8
-rw-r--r--gcc/ada/gcc-interface/utils.c34
2 files changed, 21 insertions, 21 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index ad72768..2c022fe 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,13 @@
2011-05-11 Nathan Froyd <froydnj@codesourcery.com>
+ * gcc-interface/utils.c (def_fn_type): Don't call build_function_type;
+ call build_function_type_array or build_varargs_function_type_array
+ instead.
+ (create_subprog_type): Don't call build_function_type; call
+ build_function_type_vec instead.
+
+2011-05-11 Nathan Froyd <froydnj@codesourcery.com>
+
* gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE): Use TYPE_MINVAL.
(TYPE_GCC_MIN_VALUE): Use TYPE_MINVAL.
(TYPE_GCC_MAX_VALUE): Use TYPE_MAXVAL.
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index cfa58b9..efeceea 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1181,24 +1181,16 @@ create_subprog_type (tree return_type, tree param_decl_list, tree cico_list,
bool return_unconstrained_p, bool return_by_direct_ref_p,
bool return_by_invisi_ref_p)
{
- /* A chain of TREE_LIST nodes whose TREE_VALUEs are the data type nodes of
- the subprogram formal parameters. This list is generated by traversing
- the input list of PARM_DECL nodes. */
- tree param_type_list = NULL_TREE;
+ /* A list of the data type nodes of the subprogram formal parameters.
+ This list is generated by traversing the input list of PARM_DECL
+ nodes. */
+ VEC(tree,gc) *param_type_list = NULL;
tree t, type;
for (t = param_decl_list; t; t = DECL_CHAIN (t))
- param_type_list = tree_cons (NULL_TREE, TREE_TYPE (t), param_type_list);
+ VEC_safe_push (tree, gc, param_type_list, TREE_TYPE (t));
- /* The list of the function parameter types has to be terminated by the void
- type to signal to the back-end that we are not dealing with a variable
- parameter subprogram, but that it has a fixed number of parameters. */
- param_type_list = tree_cons (NULL_TREE, void_type_node, param_type_list);
-
- /* The list of argument types has been created in reverse so reverse it. */
- param_type_list = nreverse (param_type_list);
-
- type = build_function_type (return_type, param_type_list);
+ type = build_function_type_vec (return_type, param_type_list);
/* TYPE may have been shared since GCC hashes types. If it has a different
CICO_LIST, make a copy. Likewise for the various flags. */
@@ -4959,7 +4951,8 @@ static GTY(()) tree builtin_types[(int) BT_LAST + 1];
static void
def_fn_type (builtin_type def, builtin_type ret, bool var, int n, ...)
{
- tree args = NULL, t;
+ tree t;
+ tree *args = XALLOCAVEC (tree, n);
va_list list;
int i;
@@ -4970,18 +4963,17 @@ def_fn_type (builtin_type def, builtin_type ret, bool var, int n, ...)
t = builtin_types[a];
if (t == error_mark_node)
goto egress;
- args = tree_cons (NULL_TREE, t, args);
+ args[i] = t;
}
va_end (list);
- args = nreverse (args);
- if (!var)
- args = chainon (args, void_list_node);
-
t = builtin_types[ret];
if (t == error_mark_node)
goto egress;
- t = build_function_type (t, args);
+ if (var)
+ t = build_varargs_function_type_array (t, n, args);
+ else
+ t = build_function_type_array (t, n, args);
egress:
builtin_types[def] = t;