summaryrefslogtreecommitdiff
path: root/gcc/tree-iterator.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-iterator.c')
-rw-r--r--gcc/tree-iterator.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/gcc/tree-iterator.c b/gcc/tree-iterator.c
index ebc477b68d0..d13ea960888 100644
--- a/gcc/tree-iterator.c
+++ b/gcc/tree-iterator.c
@@ -40,14 +40,12 @@ alloc_stmt_list (void)
if (list)
{
stmt_list_cache = TREE_CHAIN (list);
- TREE_CHAIN (list) = NULL;
- TREE_SIDE_EFFECTS (list) = 0;
+ memset (list, 0, sizeof(struct tree_common));
+ TREE_SET_CODE (list, STATEMENT_LIST);
}
else
- {
- list = make_node (STATEMENT_LIST);
- TREE_TYPE (list) = void_type_node;
- }
+ list = make_node (STATEMENT_LIST);
+ TREE_TYPE (list) = void_type_node;
return list;
}
@@ -73,8 +71,6 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
if (t == i->container)
abort ();
- TREE_SIDE_EFFECTS (i->container) = 1;
-
if (TREE_CODE (t) == STATEMENT_LIST)
{
head = STATEMENT_LIST_HEAD (t);
@@ -101,6 +97,8 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
tail = head;
}
+ TREE_SIDE_EFFECTS (i->container) = 1;
+
cur = i->ptr;
/* Link it into the list. */
@@ -151,8 +149,6 @@ tsi_link_after (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
if (t == i->container)
abort ();
- TREE_SIDE_EFFECTS (i->container) = 1;
-
if (TREE_CODE (t) == STATEMENT_LIST)
{
head = STATEMENT_LIST_HEAD (t);
@@ -179,6 +175,8 @@ tsi_link_after (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
tail = head;
}
+ TREE_SIDE_EFFECTS (i->container) = 1;
+
cur = i->ptr;
/* Link it into the list. */