aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorMichael Meissner <meissner@gcc.gnu.org>2007-09-13 02:17:51 +0000
committerMichael Meissner <meissner@gcc.gnu.org>2007-09-13 02:17:51 +0000
commit04e1d06b795dc7dfa11be5e0ee04467a28e105dd (patch)
tree2550bf2be428ffb45e9bcb30a6c3186b44ebdc0d /gcc/tree.c
parentceaa2d5019c290d814e0856531e9b45cbff6b90b (diff)
downloadgcc-04e1d06b795dc7dfa11be5e0ee04467a28e105dd.zip
gcc-04e1d06b795dc7dfa11be5e0ee04467a28e105dd.tar.gz
gcc-04e1d06b795dc7dfa11be5e0ee04467a28e105dd.tar.bz2
Add AMD SSE5 support; Add iterator over function arguments; Add stdarg_p, prototype_p, function_args_count functions
From-SVN: r128455
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index a3e5829..59c17c7 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -8700,4 +8700,56 @@ call_expr_arglist (tree exp)
return arglist;
}
+/* Return true if TYPE has a variable argument list. */
+
+bool
+stdarg_p (tree fntype)
+{
+ function_args_iterator args_iter;
+ tree n = NULL_TREE, t;
+
+ if (!fntype)
+ return false;
+
+ FOREACH_FUNCTION_ARGS(fntype, t, args_iter)
+ {
+ n = t;
+ }
+
+ return n != NULL_TREE && n != void_type_node;
+}
+
+/* Return true if TYPE has a prototype. */
+
+bool
+prototype_p (tree fntype)
+{
+ tree t;
+
+ gcc_assert (fntype != NULL_TREE);
+
+ t = TYPE_ARG_TYPES (fntype);
+ return (t != NULL_TREE);
+}
+
+/* Return the number of arguments that a function has. */
+
+int
+function_args_count (tree fntype)
+{
+ function_args_iterator args_iter;
+ tree t;
+ int num = 0;
+
+ if (fntype)
+ {
+ FOREACH_FUNCTION_ARGS(fntype, t, args_iter)
+ {
+ num++;
+ }
+ }
+
+ return num;
+}
+
#include "gt-tree.h"