[lto] Stop using TREE_CHAIN on TYPE_ARG_TYPES in build_operator_new_call.
Kazu Hirata
kazu@codesourcery.com
Mon Jun 26 00:41:00 GMT 2006
Hi,
Attached is a patch to use num_parm_types and nth_parm_type in
build_operator_new_call.
Tested on x86_64-pc-linux-gnu. Committed to the LTO branch as
obvious.
Kazu Hirata
2006-06-25 Kazu Hirata <kazu@codesourcery.com>
* call.c (build_operator_new_call): Use num_parm_types and
nth_parm_type.
Index: cp/call.c
===================================================================
--- cp/call.c (revision 114740)
+++ cp/call.c (working copy)
@@ -2904,12 +2904,11 @@ build_operator_new_call (tree fnname, tr
tree arg_types;
arg_types = TYPE_ARG_TYPES (TREE_TYPE (cand->fn));
- /* Skip the size_t parameter. */
- arg_types = TREE_CHAIN (arg_types);
- /* Check the remaining parameters (if any). */
- if (arg_types
- && TREE_CHAIN (arg_types) == void_list_node
- && same_type_p (TREE_VALUE (arg_types),
+ /* Check the parameters (if any) after the size_t
+ parameter. */
+ if (num_parm_types (arg_types) == 3
+ && nth_parm_type (arg_types, 2) == void_type_node
+ && same_type_p (nth_parm_type (arg_types, 1),
ptr_type_node))
use_cookie = false;
}
More information about the Gcc-patches
mailing list