of alloca.
(components_to_record): Likewise.
* gcc-interface/trans.c (gnat_to_gnu): Likewise.
* gcc-interface/utils.c (max_size): Likewise.
(build_vms_descriptor32): Likewise.
(build_vms_descriptor): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162985
138bc75d-0d04-0410-961f-
82ee72b054a4
2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Use XALLOCAVEC instead
+ of alloca.
+ (components_to_record): Likewise.
+ * gcc-interface/trans.c (gnat_to_gnu): Likewise.
+ * gcc-interface/utils.c (max_size): Likewise.
+ (build_vms_descriptor32): Likewise.
+ (build_vms_descriptor): Likewise.
+
+2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
+
* gcc-interface/decl.c (subst_pair): Declare. Declare a VEC of it.
(build_subst_list): Return a VEC instead of a tree.
(build_variant_list): Take a VEC for subst_list. Adjust
tree gnu_template_reference;
tree gnu_ptr_template = build_pointer_type (gnu_template_type);
tree gnu_fat_type = make_node (RECORD_TYPE);
- tree *gnu_index_types = (tree *) alloca (ndim * sizeof (tree));
- tree *gnu_temp_fields = (tree *) alloca (ndim * sizeof (tree));
+ tree *gnu_index_types = XALLOCAVEC (tree, ndim);
+ tree *gnu_temp_fields = XALLOCAVEC (tree, ndim);
tree gnu_max_size = size_one_node, gnu_max_size_unit, tem;
int index;
= (Convention (gnat_entity) == Convention_Fortran);
const int ndim = Number_Dimensions (gnat_entity);
tree gnu_base_type = gnu_type;
- tree *gnu_index_types = (tree *) alloca (ndim * sizeof (tree));
+ tree *gnu_index_types = XALLOCAVEC (tree, ndim);
tree gnu_max_size = size_one_node, gnu_max_size_unit;
bool need_index_type_struct = false;
int index;
tree gnu_rep_type
= (gnu_field_list ? make_node (RECORD_TYPE) : gnu_record_type);
int i, len = list_length (gnu_our_rep_list);
- tree *gnu_arr = (tree *) alloca (sizeof (tree) * len);
+ tree *gnu_arr = XALLOCAVEC (tree, len);
for (gnu_field = gnu_our_rep_list, i = 0;
gnu_field;
ndim++, gnu_type = TREE_TYPE (gnu_type))
;
- gnat_expr_array = (Node_Id *) alloca (ndim * sizeof (Node_Id));
+ gnat_expr_array = XALLOCAVEC (Node_Id, ndim);
if (TYPE_CONVENTION_FORTRAN_P (TREE_TYPE (gnu_array_object)))
for (i = ndim - 1, gnat_temp = First (Expressions (gnat_node));
noutputs = list_length (gnu_outputs);
gnu_inputs = nreverse (gnu_inputs);
ninputs = list_length (gnu_inputs);
- oconstraints
- = (const char **) alloca (noutputs * sizeof (const char *));
+ oconstraints = XALLOCAVEC (const char *, noutputs);
for (i = 0, tail = gnu_outputs; tail; ++i, tail = TREE_CHAIN (tail))
{
n = call_expr_nargs (exp);
gcc_assert (n > 0);
- argarray = (tree *) alloca (n * sizeof (tree));
+ argarray = XALLOCAVEC (tree, n);
for (i = 0; i < n; i++)
argarray[i] = max_size (CALL_EXPR_ARG (exp, i), max_p);
return build_call_array (type, CALL_EXPR_FN (exp), n, argarray);
ndim++, inner_type = TREE_TYPE (inner_type))
;
- idx_arr = (tree *) alloca (ndim * sizeof (tree));
+ idx_arr = XALLOCAVEC (tree, ndim);
if (mech != By_Descriptor_NCA && mech != By_Short_Descriptor_NCA
&& TREE_CODE (type) == ARRAY_TYPE && TYPE_CONVENTION_FORTRAN_P (type))
ndim++, inner_type = TREE_TYPE (inner_type))
;
- idx_arr = (tree *) alloca (ndim * sizeof (tree));
+ idx_arr = XALLOCAVEC (tree, ndim);
if (mech != By_Descriptor_NCA
&& TREE_CODE (type) == ARRAY_TYPE && TYPE_CONVENTION_FORTRAN_P (type))