diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2007-02-28 14:21:20 -0500 |
---|---|---|
committer | Sandra Loosemore <sandra@gcc.gnu.org> | 2007-02-28 14:21:20 -0500 |
commit | 94a0dd7b599e1d83b81f007258af2b16e7cbc4c5 (patch) | |
tree | 34dad42b40269284ec633fd80ce8a06342ba7ea3 /gcc/fold-const.c | |
parent | 76bf4853ce24034b8489b3b5ba56d1de50203ea5 (diff) | |
download | gcc-94a0dd7b599e1d83b81f007258af2b16e7cbc4c5.zip gcc-94a0dd7b599e1d83b81f007258af2b16e7cbc4c5.tar.gz gcc-94a0dd7b599e1d83b81f007258af2b16e7cbc4c5.tar.bz2 |
builtins.c (fold_builtin_call_list, [...]): Delete, and replace with...
2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
* gcc/builtins.c (fold_builtin_call_list, fold_builtin_call_valist):
Delete, and replace with...
(fold_builtin_call_array): This. Update callers to use it.
* gcc/fold-const.c (fold_build_call_list): Delete, and replace with...
(fold_build_call_array): This.
(fold_build_call_list_initializer): Delete, and replace with...
(fold_build_call_array_initializer): This.
* gcc/tree.h: Update declarations to reflect above changes.
* gcc/c-typeck.c (build_function_call): Store converted arguments
in a stack-allocated array instead of building a list.
(convert_arguments): Store arguments in the array passed in as an
argument, and return the actual number of arguments.
* gcc/c-format.c: (check_function_format): Pass arguments in an
array instead of a list.
* gcc/c-common.c (check_function_nonnull): Likewise.
(check_function_sentinel): Likewise.
(check_function_arguments): Likewise.
* gcc/c-common.h: Update declarations to reflect above changes.
* gcc/cp/typeck.c (build_function_call): Store converted arguments
in a stack-allocated array instead of building a list.
(convert_arguments): Store arguments in the array passed in as an
argument, and return the actual number of arguments.
* gcc/cp/call.c (build_call): Delete, and replace with...
(build_call_n, build_call_a): New.
(build_op_delete_call): Rewrite to avoid constructing argument lists.
(build_over_call): Store converted arguments in a stack-allocated
array instead of building a list.
(build_cxx_call): Pass arguments in an array instead of as a list.
(build_java_interface_fn_ref): Rewrite to avoid constructing
argument lists.
* gcc/cp/tree.h: Update declarations to reflect above changes.
* gcc/cp/method.c (use_thunk): Use a stack-allocated array to hold
the arguments instead of a list.
* gcc/cp/rtti.c (throw_bad_cast): Update call to cxx_call.
(throw_bad_typeid): Likewise.
(build_dynamic_cast_1): Likewise.
* gcc/cp/init.c (build_builtin_delete_call): Use build_call_n.
* gcc/cp/decl.c (expand_static_init): Likewise.
* gcc/cp/except.c (cp_protect_cleanup_actions): Likewise.
* gcc/cp/cp-gimplify.c (genericize_eh_spec_block): Likewise.
(gimplify_must_not_throw_expr): Likewise.
(cxx_omp_apply_fn): Use build_call_a.
From-SVN: r122411
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 80c3c41..f1f4c2c 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -12875,13 +12875,13 @@ fold_build3_stat (enum tree_code code, tree type, tree op0, tree op1, tree op2 return tem; } -/* Fold a CALL_EXPR expression of type TYPE with operands FN and ARGLIST - and a null static chain. +/* Fold a CALL_EXPR expression of type TYPE with operands FN and NARGS + arguments in ARGARRAY, and a null static chain. Return a folded expression if successful. Otherwise, return a CALL_EXPR - of type TYPE from the given operands as constructed by build_call_list. */ + of type TYPE from the given operands as constructed by build_call_array. */ tree -fold_build_call_list (tree type, tree fn, tree arglist) +fold_build_call_array (tree type, tree fn, int nargs, tree *argarray) { tree tem; #ifdef ENABLE_FOLD_CHECKING @@ -12891,6 +12891,7 @@ fold_build_call_list (tree type, tree fn, tree arglist) checksum_after_arglist[16]; struct md5_ctx ctx; htab_t ht; + int i; ht = htab_create (32, htab_hash_pointer, htab_eq_pointer, NULL); md5_init_ctx (&ctx); @@ -12899,12 +12900,13 @@ fold_build_call_list (tree type, tree fn, tree arglist) htab_empty (ht); md5_init_ctx (&ctx); - fold_checksum_tree (arglist, &ctx, ht); + for (i = 0; i < nargs; i++) + fold_checksum_tree (argarray[i], &ctx, ht); md5_finish_ctx (&ctx, checksum_before_arglist); htab_empty (ht); #endif - tem = fold_builtin_call_list (type, fn, arglist); + tem = fold_builtin_call_array (type, fn, nargs, argarray); #ifdef ENABLE_FOLD_CHECKING md5_init_ctx (&ctx); @@ -12916,12 +12918,13 @@ fold_build_call_list (tree type, tree fn, tree arglist) fold_check_failed (fn, tem); md5_init_ctx (&ctx); - fold_checksum_tree (arglist, &ctx, ht); + for (i = 0; i < nargs; i++) + fold_checksum_tree (argarray[i], &ctx, ht); md5_finish_ctx (&ctx, checksum_after_arglist); htab_delete (ht); if (memcmp (checksum_before_arglist, checksum_after_arglist, 16)) - fold_check_failed (arglist, tem); + fold_check_failed (NULL_TREE, tem); #endif return tem; } @@ -12987,12 +12990,13 @@ fold_build3_initializer (enum tree_code code, tree type, tree op0, tree op1, } tree -fold_build_call_list_initializer (tree type, tree fn, tree arglist) +fold_build_call_array_initializer (tree type, tree fn, + int nargs, tree *argarray) { tree result; START_FOLD_INIT; - result = fold_build_call_list (type, fn, arglist); + result = fold_build_call_array (type, fn, nargs, argarray); END_FOLD_INIT; return result; |