Commit bce33ab2 by Nathan Froyd Committed by Nathan Froyd

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
parent 769b55b2
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> 2011-05-20 Tom de Vries <tom@codesourcery.com>
PR target/45098 PR target/45098
......
...@@ -741,9 +741,11 @@ go_format_type (struct godump_container *container, tree type, ...@@ -741,9 +741,11 @@ go_format_type (struct godump_container *container, tree type,
case FUNCTION_TYPE: case FUNCTION_TYPE:
{ {
tree args; tree arg_type;
bool is_varargs; bool is_varargs;
tree result; tree result;
function_args_iterator iter;
bool seen_arg;
/* Go has no way to write a type which is a function but not a /* Go has no way to write a type which is a function but not a
pointer to a function. */ pointer to a function. */
...@@ -754,25 +756,21 @@ go_format_type (struct godump_container *container, tree type, ...@@ -754,25 +756,21 @@ go_format_type (struct godump_container *container, tree type,
} }
obstack_1grow (ob, '('); obstack_1grow (ob, '(');
is_varargs = true; is_varargs = stdarg_p (type);
for (args = TYPE_ARG_TYPES (type); seen_arg = false;
args != NULL_TREE; FOREACH_FUNCTION_ARGS (type, arg_type, iter)
args = TREE_CHAIN (args))
{ {
if (VOID_TYPE_P (TREE_VALUE (args))) if (VOID_TYPE_P (arg_type))
{
gcc_assert (TREE_CHAIN (args) == NULL);
is_varargs = false;
break; break;
} if (seen_arg)
if (args != TYPE_ARG_TYPES (type))
obstack_grow (ob, ", ", 2); 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; ret = false;
seen_arg = true;
} }
if (is_varargs) if (is_varargs)
{ {
if (TYPE_ARG_TYPES (type) != NULL_TREE) if (prototype_p (type))
obstack_grow (ob, ", ", 2); obstack_grow (ob, ", ", 2);
obstack_grow (ob, "...interface{}", 14); obstack_grow (ob, "...interface{}", 14);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment