aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2011-05-10 16:56:19 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2011-05-10 16:56:19 +0000
commit8242dd04b79486c5890e599caa9c492eac38c2f8 (patch)
tree21c9e334acd6ce8a0705b286bd6ae197901ec1a1 /gcc/lto
parent4a68b4ca4e0169389c97cd58a0b4eab9c3810c3f (diff)
downloadgcc-8242dd04b79486c5890e599caa9c492eac38c2f8.zip
gcc-8242dd04b79486c5890e599caa9c492eac38c2f8.tar.gz
gcc-8242dd04b79486c5890e599caa9c492eac38c2f8.tar.bz2
use build_function_type less in c-family and LTO
use build_function_type less in c-family and LTO gcc/c-family/ * c-common.c (def_fn_type): Don't call build_function_type, call build_function_type_array or build_varargs_function_type_array instead. (c_common_nodes_and_builtins): Likewise. gcc/lto/ * lto-lang.c (def_fn_type): Don't call build_function_type, call build_function_type_array or build_varargs_function_type_array instead. From-SVN: r173623
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto-lang.c14
2 files changed, 13 insertions, 7 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index ca1592d..3bc57c9 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-10 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-lang.c (def_fn_type): Don't call build_function_type, call
+ build_function_type_array or build_varargs_function_type_array
+ instead.
+
2011-05-07 Eric Botcazou <ebotcazou@adacore.com>
* lto-lang.c (global_bindings_p): Return bool.
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 5872928..5fe89b8 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -433,7 +433,8 @@ handle_format_arg_attribute (tree * ARG_UNUSED (node), tree ARG_UNUSED (name),
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;
@@ -444,18 +445,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;