diff options
Diffstat (limited to 'gcc/tree-iterator.c')
-rw-r--r-- | gcc/tree-iterator.c | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/gcc/tree-iterator.c b/gcc/tree-iterator.c index d13ea96..1b78160 100644 --- a/gcc/tree-iterator.c +++ b/gcc/tree-iterator.c @@ -52,10 +52,8 @@ alloc_stmt_list (void) void free_stmt_list (tree t) { -#ifdef ENABLE_CHECKING - if (STATEMENT_LIST_HEAD (t) || STATEMENT_LIST_TAIL (t)) - abort (); -#endif + gcc_assert (!STATEMENT_LIST_HEAD (t)); + gcc_assert (!STATEMENT_LIST_TAIL (t)); TREE_CHAIN (t) = stmt_list_cache; stmt_list_cache = t; } @@ -68,8 +66,7 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode) struct tree_statement_list_node *head, *tail, *cur; /* Die on looping. */ - if (t == i->container) - abort (); + gcc_assert (t != i->container); if (TREE_CODE (t) == STATEMENT_LIST) { @@ -83,8 +80,7 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode) /* Empty statement lists need no work. */ if (!head || !tail) { - if (head != tail) - abort (); + gcc_assert (head == tail); return; } } @@ -114,8 +110,7 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode) } else { - if (STATEMENT_LIST_TAIL (i->container)) - abort (); + gcc_assert (!STATEMENT_LIST_TAIL (i->container)); STATEMENT_LIST_HEAD (i->container) = head; STATEMENT_LIST_TAIL (i->container) = tail; } @@ -132,8 +127,7 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode) i->ptr = tail; break; case TSI_SAME_STMT: - if (!cur) - abort (); + gcc_assert (cur); break; } } @@ -146,8 +140,7 @@ tsi_link_after (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode) struct tree_statement_list_node *head, *tail, *cur; /* Die on looping. */ - if (t == i->container) - abort (); + gcc_assert (t != i->container); if (TREE_CODE (t) == STATEMENT_LIST) { @@ -161,8 +154,7 @@ tsi_link_after (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode) /* Empty statement lists need no work. */ if (!head || !tail) { - if (head != tail) - abort (); + gcc_assert (head == tail); return; } } @@ -192,8 +184,7 @@ tsi_link_after (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode) } else { - if (STATEMENT_LIST_TAIL (i->container)) - abort (); + gcc_assert (!STATEMENT_LIST_TAIL (i->container)); STATEMENT_LIST_HEAD (i->container) = head; STATEMENT_LIST_TAIL (i->container) = tail; } @@ -210,8 +201,7 @@ tsi_link_after (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode) i->ptr = tail; break; case TSI_SAME_STMT: - if (!cur) - abort (); + gcc_assert (cur); break; } } @@ -254,8 +244,7 @@ tsi_split_statement_list_after (const tree_stmt_iterator *i) cur = i->ptr; /* How can we possibly split after the end, or before the beginning? */ - if (cur == NULL) - abort (); + gcc_assert (cur); next = cur->next; old_sl = i->container; @@ -282,8 +271,7 @@ tsi_split_statement_list_before (tree_stmt_iterator *i) cur = i->ptr; /* How can we possibly split after the end, or before the beginning? */ - if (cur == NULL) - abort (); + gcc_assert (cur); prev = cur->prev; old_sl = i->container; |