[lto] Use num_parm_types, nth_parm_type, and num_artificial_parms_for in grokdeclarator.
Kazu Hirata
kazu@codesourcery.com
Sat Jul 8 18:47:00 GMT 2006
Hi,
Tested on x86_64-pc-linux-gnu. Committed to the LTO branch as
obvious.
Kazu Hirata
2006-07-08 Kazu Hirata <kazu@codesourcery.com>
* decl.c (grokdeclarator): Use num_parm_types, nth_parm_type,
and num_artificial_parms_for in grokdeclarator.
Index: cp/decl.c
===================================================================
--- cp/decl.c (revision 115203)
+++ cp/decl.c (working copy)
@@ -8266,13 +8266,15 @@ grokdeclarator (const cp_declarator *dec
parameter if there is at least one parameter, and
any subsequent parameters have default arguments.
Ignore any compiler-added parms. */
- tree arg_types = FUNCTION_FIRST_USER_PARMTYPE (decl);
+ tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl));
tree parm_decls = FUNCTION_FIRST_USER_PARM (decl);
+ int skip = num_artificial_parms_for (decl);
+ int len = num_parm_types (arg_types);
- if (arg_types == void_list_node
- || (arg_types
- && TREE_CHAIN (arg_types)
- && TREE_CHAIN (arg_types) != void_list_node
+ if ((skip + 1 == len
+ && nth_parm_type (arg_types, skip) == void_type_node)
+ || (skip + 1 < len
+ && nth_parm_type (arg_types, skip + 1) != void_type_node
&& !DECL_INITIAL (TREE_CHAIN (parm_decls))))
DECL_NONCONVERTING_P (decl) = 1;
}
More information about the Gcc-patches
mailing list