diff options
author | Geoff Keating <geoffk@cygnus.com> | 2000-03-30 00:03:14 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2000-03-30 00:03:14 +0000 |
commit | 9f720c3eba745cb4c97bd827c82f9c28bcbd0027 (patch) | |
tree | 20d913563a657194431e95f314f5d4189f855d3a /gcc/c-common.c | |
parent | abe79fd4da641ef2f393be1bcac0ae855035e9b1 (diff) | |
download | gcc-9f720c3eba745cb4c97bd827c82f9c28bcbd0027.zip gcc-9f720c3eba745cb4c97bd827c82f9c28bcbd0027.tar.gz gcc-9f720c3eba745cb4c97bd827c82f9c28bcbd0027.tar.bz2 |
c-common.c (c_common_nodes_and_builtins): The first parameter to __builtin_va_start and __builtin_va_copy is now either a...
* c-common.c (c_common_nodes_and_builtins): The first parameter to
__builtin_va_start and __builtin_va_copy is now either a 'va_list'
or a reference to a va_list.
* builtins.c (stabilize_va_list): Simplify now we don't have to
work around C array address decay.
* c-typeck.c (convert_for_assignment): Handle assignment to
a reference parameter by taking the address of the RHS.
* ginclude/stdarg.h (va_start): Don't take address of first parameter.
(va_copy): Likewise.
(__va_copy): Likewise.
* ginclude/varargs.h (va_start): Likewise.
(__va_copy): Likewise.
From-SVN: r32821
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 0589c03..97aba25 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3478,7 +3478,7 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) tree traditional_cptr_type_node; tree traditional_len_type_node; tree traditional_len_endlink; - tree va_list_ptr_type_node; + tree va_list_ref_type_node; tree va_list_arg_type_node; pushdecl (build_decl (TYPE_DECL, get_identifier ("__builtin_va_list"), @@ -3490,13 +3490,17 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) pushdecl (build_decl (TYPE_DECL, get_identifier ("__builtin_size_t"), sizetype)); - va_list_ptr_type_node = build_pointer_type (va_list_type_node); - if (TREE_CODE (va_list_type_node) == ARRAY_TYPE) - va_list_arg_type_node = build_pointer_type (TREE_TYPE (va_list_type_node)); + { + va_list_arg_type_node = va_list_ref_type_node = + build_pointer_type (TREE_TYPE (va_list_type_node)); + } else - va_list_arg_type_node = va_list_type_node; - + { + va_list_arg_type_node = va_list_type_node; + va_list_ref_type_node = build_reference_type (va_list_type_node); + } + endlink = void_list_node; int_endlink = tree_cons (NULL_TREE, integer_type_node, endlink); double_endlink = tree_cons (NULL_TREE, double_type_node, endlink); @@ -3725,28 +3729,28 @@ c_common_nodes_and_builtins (cplus_mode, no_builtins, no_nonansi_builtins) builtin_function ("__builtin_varargs_start", build_function_type (void_type_node, tree_cons (NULL_TREE, - va_list_ptr_type_node, + va_list_ref_type_node, endlink)), BUILT_IN_VARARGS_START, BUILT_IN_NORMAL, NULL_PTR); builtin_function ("__builtin_stdarg_start", build_function_type (void_type_node, tree_cons (NULL_TREE, - va_list_ptr_type_node, + va_list_ref_type_node, NULL_TREE)), BUILT_IN_STDARG_START, BUILT_IN_NORMAL, NULL_PTR); builtin_function ("__builtin_va_end", build_function_type (void_type_node, tree_cons (NULL_TREE, - va_list_arg_type_node, + va_list_ref_type_node, endlink)), BUILT_IN_VA_END, BUILT_IN_NORMAL, NULL_PTR); builtin_function ("__builtin_va_copy", build_function_type (void_type_node, tree_cons (NULL_TREE, - va_list_ptr_type_node, + va_list_ref_type_node, tree_cons (NULL_TREE, va_list_arg_type_node, endlink))), |