mirror of git://gcc.gnu.org/git/gcc.git
tree.c (build_varargs_function_type_list): New.
2008-06-28 Kai Tietz <kai.tietz@onevision.com>
* tree.c (build_varargs_function_type_list): New.
(build_function_type_list_1): New.
(build_function_type_list): Use build_function_type_list_1.
* tree.h (build_varargs_function_type_list): New.
From-SVN: r137221
This commit is contained in:
parent
d74032d9e1
commit
ff1c393bd3
|
|
@ -1,3 +1,10 @@
|
||||||
|
2008-06-28 Kai Tietz <kai.tietz@onevision.com>
|
||||||
|
|
||||||
|
* tree.c (build_varargs_function_type_list): New.
|
||||||
|
(build_function_type_list_1): New.
|
||||||
|
(build_function_type_list): Use build_function_type_list_1.
|
||||||
|
* tree.h (build_varargs_function_type_list): New.
|
||||||
|
|
||||||
2008-06-28 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
|
2008-06-28 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
|
||||||
|
|
||||||
PR target/34856
|
PR target/34856
|
||||||
|
|
|
||||||
59
gcc/tree.c
59
gcc/tree.c
|
|
@ -5862,23 +5862,26 @@ build_function_type (tree value_type, tree arg_types)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build a function type. The RETURN_TYPE is the type returned by the
|
/* Build a function type. The RETURN_TYPE is the type returned by the
|
||||||
function. If additional arguments are provided, they are
|
function. If VAARGS is set, no void_type_node is appended to the
|
||||||
additional argument types. The list of argument types must always
|
the list. ARGP muse be alway be terminated be a NULL_TREE. */
|
||||||
be terminated by NULL_TREE. */
|
|
||||||
|
|
||||||
tree
|
static tree
|
||||||
build_function_type_list (tree return_type, ...)
|
build_function_type_list_1 (bool vaargs, tree return_type, va_list argp)
|
||||||
{
|
{
|
||||||
tree t, args, last;
|
tree t, args, last;
|
||||||
va_list p;
|
|
||||||
|
|
||||||
va_start (p, return_type);
|
t = va_arg (argp, tree);
|
||||||
|
for (args = NULL_TREE; t != NULL_TREE; t = va_arg (argp, tree))
|
||||||
t = va_arg (p, tree);
|
|
||||||
for (args = NULL_TREE; t != NULL_TREE; t = va_arg (p, tree))
|
|
||||||
args = tree_cons (NULL_TREE, t, args);
|
args = tree_cons (NULL_TREE, t, args);
|
||||||
|
|
||||||
if (args == NULL_TREE)
|
if (vaargs)
|
||||||
|
{
|
||||||
|
last = args;
|
||||||
|
if (args != NULL_TREE)
|
||||||
|
args = nreverse (args);
|
||||||
|
gcc_assert (args != NULL_TREE && last != void_list_node);
|
||||||
|
}
|
||||||
|
else if (args == NULL_TREE)
|
||||||
args = void_list_node;
|
args = void_list_node;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -5888,10 +5891,44 @@ build_function_type_list (tree return_type, ...)
|
||||||
}
|
}
|
||||||
args = build_function_type (return_type, args);
|
args = build_function_type (return_type, args);
|
||||||
|
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Build a function type. The RETURN_TYPE is the type returned by the
|
||||||
|
function. If additional arguments are provided, they are
|
||||||
|
additional argument types. The list of argument types must always
|
||||||
|
be terminated by NULL_TREE. */
|
||||||
|
|
||||||
|
tree
|
||||||
|
build_function_type_list (tree return_type, ...)
|
||||||
|
{
|
||||||
|
tree args;
|
||||||
|
va_list p;
|
||||||
|
|
||||||
|
va_start (p, return_type);
|
||||||
|
args = build_function_type_list_1 (false, return_type, p);
|
||||||
va_end (p);
|
va_end (p);
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Build a variable argument function type. The RETURN_TYPE is the
|
||||||
|
type returned by the function. If additional arguments are provided,
|
||||||
|
they are additional argument types. The list of argument types must
|
||||||
|
always be terminated by NULL_TREE. */
|
||||||
|
|
||||||
|
tree
|
||||||
|
build_varargs_function_type_list (tree return_type, ...)
|
||||||
|
{
|
||||||
|
tree args;
|
||||||
|
va_list p;
|
||||||
|
|
||||||
|
va_start (p, return_type);
|
||||||
|
args = build_function_type_list_1 (true, return_type, p);
|
||||||
|
va_end (p);
|
||||||
|
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
/* Build a METHOD_TYPE for a member of BASETYPE. The RETTYPE (a TYPE)
|
/* Build a METHOD_TYPE for a member of BASETYPE. The RETTYPE (a TYPE)
|
||||||
and ARGTYPES (a TREE_LIST) are the return type and arguments types
|
and ARGTYPES (a TREE_LIST) are the return type and arguments types
|
||||||
for the method. An implicit additional parameter (of type
|
for the method. An implicit additional parameter (of type
|
||||||
|
|
|
||||||
|
|
@ -4084,6 +4084,7 @@ extern tree build_index_2_type (tree, tree);
|
||||||
extern tree build_array_type (tree, tree);
|
extern tree build_array_type (tree, tree);
|
||||||
extern tree build_function_type (tree, tree);
|
extern tree build_function_type (tree, tree);
|
||||||
extern tree build_function_type_list (tree, ...);
|
extern tree build_function_type_list (tree, ...);
|
||||||
|
extern tree build_varargs_function_type_list (tree, ...);
|
||||||
extern tree build_method_type_directly (tree, tree, tree);
|
extern tree build_method_type_directly (tree, tree, tree);
|
||||||
extern tree build_method_type (tree, tree);
|
extern tree build_method_type (tree, tree);
|
||||||
extern tree build_offset_type (tree, tree);
|
extern tree build_offset_type (tree, tree);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue