aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-07-13 18:46:25 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-07-13 18:46:25 +0000
commit3bb06db415181f6027ac0f99520ced47069d6499 (patch)
tree435ae90e4b6eed76766475f3f0c7083b8c6f6502 /gcc/fortran/trans-decl.c
parent3f34855a08b426c05d3c462fd4563c649ad15476 (diff)
downloadgcc-3bb06db415181f6027ac0f99520ced47069d6499.zip
gcc-3bb06db415181f6027ac0f99520ced47069d6499.tar.gz
gcc-3bb06db415181f6027ac0f99520ced47069d6499.tar.bz2
tree.h (build_function_call_expr): Delete.
gcc/ * tree.h (build_function_call_expr): Delete. (build_call_expr_loc_array): New function. (build_call_expr_loc_vec): New function. * tree-flow.h (struct omp_region): Change type of ws_args field to a VEC. * builtins.c (build_function_call_expr): Delete. (build_call_expr_loc_array): New function. (build_call_expr_loc): Call it. Use XALLOCAVEC. (build_call_expr): Likewise. (build_call_expr_loc_vec): New function. * cgraphunit.c (build_cdtor): Call build_call_expr instead of build_function_call_expr. * expr.c (emutls_var_address): Likewise. * varasm.c (emutls_common_1): Likewise. * omp-low.c (expand_omp_atomic_mutex): Likewise. (expand_omp_taskreg): Adjust for new type of region->ws_args. (get_ws_args_for): Return a VEC instead of a tree. (expand_parallel_call): Call build_call_expr_loc_vec instead of build_function_call_expr. * stor-layout.c (self_referential_size): Likewise. gcc/fortran/ * trans-decl.c (build_entry_thunks): Call build_call_expr_loc_vec instead of build_function_call_expr. * trans-intrinsic.c (gfc_conv_intrinsic_sr_kind): Likewise. From-SVN: r162148
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r--gcc/fortran/trans-decl.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 99cccde..2cc055d 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1981,8 +1981,6 @@ build_entry_thunks (gfc_namespace * ns)
gfc_symbol *thunk_sym;
stmtblock_t body;
tree thunk_fndecl;
- tree args;
- tree string_args;
tree tmp;
locus old_loc;
@@ -1992,6 +1990,9 @@ build_entry_thunks (gfc_namespace * ns)
gfc_get_backend_locus (&old_loc);
for (el = ns->entries; el; el = el->next)
{
+ VEC(tree,gc) *args = NULL;
+ VEC(tree,gc) *string_args = NULL;
+
thunk_sym = el->sym;
build_function_decl (thunk_sym);
@@ -2005,18 +2006,16 @@ build_entry_thunks (gfc_namespace * ns)
/* Pass extra parameter identifying this entry point. */
tmp = build_int_cst (gfc_array_index_type, el->id);
- args = tree_cons (NULL_TREE, tmp, NULL_TREE);
- string_args = NULL_TREE;
+ VEC_safe_push (tree, gc, args, tmp);
if (thunk_sym->attr.function)
{
if (gfc_return_by_reference (ns->proc_name))
{
tree ref = DECL_ARGUMENTS (current_function_decl);
- args = tree_cons (NULL_TREE, ref, args);
+ VEC_safe_push (tree, gc, args, ref);
if (ns->proc_name->ts.type == BT_CHARACTER)
- args = tree_cons (NULL_TREE, TREE_CHAIN (ref),
- args);
+ VEC_safe_push (tree, gc, args, TREE_CHAIN (ref));
}
}
@@ -2040,31 +2039,29 @@ build_entry_thunks (gfc_namespace * ns)
{
/* Pass the argument. */
DECL_ARTIFICIAL (thunk_formal->sym->backend_decl) = 1;
- args = tree_cons (NULL_TREE, thunk_formal->sym->backend_decl,
- args);
+ VEC_safe_push (tree, gc, args, thunk_formal->sym->backend_decl);
if (formal->sym->ts.type == BT_CHARACTER)
{
tmp = thunk_formal->sym->ts.u.cl->backend_decl;
- string_args = tree_cons (NULL_TREE, tmp, string_args);
+ VEC_safe_push (tree, gc, string_args, tmp);
}
}
else
{
/* Pass NULL for a missing argument. */
- args = tree_cons (NULL_TREE, null_pointer_node, args);
+ VEC_safe_push (tree, gc, args, null_pointer_node);
if (formal->sym->ts.type == BT_CHARACTER)
{
tmp = build_int_cst (gfc_charlen_type_node, 0);
- string_args = tree_cons (NULL_TREE, tmp, string_args);
+ VEC_safe_push (tree, gc, string_args, tmp);
}
}
}
/* Call the master function. */
- args = nreverse (args);
- args = chainon (args, nreverse (string_args));
+ VEC_safe_splice (tree, gc, args, string_args);
tmp = ns->proc_name->backend_decl;
- tmp = build_function_call_expr (input_location, tmp, args);
+ tmp = build_call_expr_loc_vec (input_location, tmp, args);
if (ns->proc_name->attr.mixed_entry_master)
{
tree union_decl, field;