diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2011-05-20 20:01:46 +0000 |
---|---|---|
committer | Nathan Froyd <froydnj@gcc.gnu.org> | 2011-05-20 20:01:46 +0000 |
commit | bce33ab2b4277852496aaebc9bbdbc223ee25164 (patch) | |
tree | 8d87fbeb87c8d61f38d06eb309b205d542e88b3e | |
parent | 769b55b24fa8db8cbe084203d2ed4354bbb6b060 (diff) | |
download | gcc-bce33ab2b4277852496aaebc9bbdbc223ee25164.zip gcc-bce33ab2b4277852496aaebc9bbdbc223ee25164.tar.gz gcc-bce33ab2b4277852496aaebc9bbdbc223ee25164.tar.bz2 |
remove TYPE_ARG_TYPES from godump.c
remove TYPE_ARG_TYPES from godump.c
* godump.c (go_format_type): Don't use TYPE_ARG_TYPES.
From-SVN: r173980
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/godump.c | 26 |
2 files changed, 16 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 124c86c5..f9c65da 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2011-05-20 Nathan Froyd <froydnj@codesourcery.com> + + * godump.c (go_format_type): Don't use TYPE_ARG_TYPES. + 2011-05-20 Tom de Vries <tom@codesourcery.com> PR target/45098 diff --git a/gcc/godump.c b/gcc/godump.c index 4f83777..1ef5e17 100644 --- a/gcc/godump.c +++ b/gcc/godump.c @@ -741,9 +741,11 @@ go_format_type (struct godump_container *container, tree type, case FUNCTION_TYPE: { - tree args; + tree arg_type; bool is_varargs; tree result; + function_args_iterator iter; + bool seen_arg; /* Go has no way to write a type which is a function but not a pointer to a function. */ @@ -754,25 +756,21 @@ go_format_type (struct godump_container *container, tree type, } obstack_1grow (ob, '('); - is_varargs = true; - for (args = TYPE_ARG_TYPES (type); - args != NULL_TREE; - args = TREE_CHAIN (args)) + is_varargs = stdarg_p (type); + seen_arg = false; + FOREACH_FUNCTION_ARGS (type, arg_type, iter) { - if (VOID_TYPE_P (TREE_VALUE (args))) - { - gcc_assert (TREE_CHAIN (args) == NULL); - is_varargs = false; - break; - } - if (args != TYPE_ARG_TYPES (type)) + if (VOID_TYPE_P (arg_type)) + break; + if (seen_arg) obstack_grow (ob, ", ", 2); - if (!go_format_type (container, TREE_VALUE (args), true, false)) + if (!go_format_type (container, arg_type, true, false)) ret = false; + seen_arg = true; } if (is_varargs) { - if (TYPE_ARG_TYPES (type) != NULL_TREE) + if (prototype_p (type)) obstack_grow (ob, ", ", 2); obstack_grow (ob, "...interface{}", 14); } |