aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@casey.cygnus.com>2000-03-13 22:54:03 +0000
committerJason Merrill <jason@gcc.gnu.org>2000-03-13 17:54:03 -0500
commitc3b247b44564c667972e0ed6f7673530378813e5 (patch)
treefdc1be5ec41c1b886780e4d8de0c601ad6838917 /gcc/tree.c
parent45b966db65e4ab054d31f01f65b7a98023dbcb54 (diff)
downloadgcc-c3b247b44564c667972e0ed6f7673530378813e5.zip
gcc-c3b247b44564c667972e0ed6f7673530378813e5.tar.gz
gcc-c3b247b44564c667972e0ed6f7673530378813e5.tar.bz2
function.c (put_var_into_stack): Use type_for_mode to calculate part_type.
* function.c (put_var_into_stack): Use type_for_mode to calculate part_type. Use MEM_SET_IN_STRUCT_P. * expr.c (store_field): Handle CONCAT. (store_constructor): Use fields_length. * tree.c (fields_length): New fn. * tree.h: Declare it. From-SVN: r32514
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index a415946..d52179c 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2004,6 +2004,22 @@ list_length (t)
return len;
}
+/* Returns the number of FIELD_DECLs in TYPE. */
+
+int
+fields_length (type)
+ tree type;
+{
+ tree t = TYPE_FIELDS (type);
+ int count = 0;
+
+ for (; t; t = TREE_CHAIN (t))
+ if (TREE_CODE (t) == FIELD_DECL)
+ ++count;
+
+ return count;
+}
+
/* Concatenate two chains of nodes (chained through TREE_CHAIN)
by modifying the last node in chain 1 to point to chain 2.
This is the Lisp primitive `nconc'. */