+2001-05-21 Mark Mitchell <mark@codesourcery.com>
+
+ * tree.h (type_num_arguments): Declare it.
+ * tree.c (type_num_arguments): New function.
+
2001-05-21 Richard Henderson <rth@redhat.com>
* dwarf2out.c (current_funcdef_number): Move outside dwarf2
return t1 == t2;
}
+/* Returns the number of arguments to the FUNCTION_TYPE or METHOD_TYPE
+ given by TYPE. If the argument list accepts variable arguments,
+ then this function counts only the ordinary arguments. */
+
+int
+type_num_arguments (type)
+ tree type;
+{
+ int i = 0;
+ tree t;
+
+ for (t = TYPE_ARG_TYPES (type); t; t = TREE_CHAIN (t))
+ /* If the function does not take a variable number of arguments,
+ the last element in the list will have type `void'. */
+ if (VOID_TYPE_P (TREE_VALUE (t)))
+ break;
+ else
+ ++i;
+
+ return i;
+}
+
/* Nonzero if integer constants T1 and T2
represent the same constant value. */
unsigned char *, int));
extern tree get_callee_fndecl PARAMS ((tree));
extern void set_decl_assembler_name PARAMS ((tree));
+extern int type_num_arguments PARAMS ((tree));
\f
/* In stmt.c */