This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto] Use num_parm_types and nth_parm_type in stdarg_p.


Hi,

Tested on x86_64-pc-linux-gnu.  Committed to the LTO branch as
obvious.

Kazu Hirata

2006-07-11  Kazu Hirata  <kazu@codesourcery.com>

	* tree.c (stdarg_p): Use num_parm_types and nth_parm_type.

Index: tree.c
===================================================================
--- tree.c	(revision 115307)
+++ tree.c	(working copy)
@@ -7598,9 +7598,10 @@ empty_body_p (tree stmt)
 bool
 stdarg_p (tree fntype)
 {
-  return (TYPE_ARG_TYPES (fntype) != 0
-	  && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
-	      != void_type_node));
+  tree parm_types = TYPE_ARG_TYPES (fntype);
+  int len = num_parm_types (parm_types);
+  return (len
+	  && nth_parm_type (parm_types, len - 1) != void_type_node);
 }
 
 /* Initialize the abstract argument list iterator object ITER with the argument


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]