OSDN Git Service

Backport from mainline
[pf3gnuchains/gcc-fork.git] / gcc / tree-iterator.h
index 5b8113a..7cdd22a 100644 (file)
@@ -1,5 +1,5 @@
-/* Iterator routines for manipulating GENERIC and GIMPLE tree statements.
-   Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Iterator routines for manipulating GENERIC tree statement list.
+   Copyright (C) 2003, 2004, 2007, 2010 Free Software Foundation, Inc.
    Contributed by Andrew MacLeod  <amacleod@redhat.com>
 
 This file is part of GCC.
@@ -34,11 +34,6 @@ typedef struct {
   tree container;
 } tree_stmt_iterator;
 
-typedef struct {
-  struct tree_statement_list_node *ptr;
-  const_tree container;
-} const_tree_stmt_iterator;
-
 static inline tree_stmt_iterator
 tsi_start (tree t)
 {
@@ -50,17 +45,6 @@ tsi_start (tree t)
   return i;
 }
 
-static inline const_tree_stmt_iterator
-ctsi_start (const_tree t)
-{
-  const_tree_stmt_iterator i;
-
-  i.ptr = STATEMENT_LIST_HEAD (t);
-  i.container = t;
-
-  return i;
-}
-
 static inline tree_stmt_iterator
 tsi_last (tree t)
 {
@@ -72,17 +56,6 @@ tsi_last (tree t)
   return i;
 }
 
-static inline const_tree_stmt_iterator
-ctsi_last (tree t)
-{
-  const_tree_stmt_iterator i;
-
-  i.ptr = STATEMENT_LIST_TAIL (t);
-  i.container = t;
-
-  return i;
-}
-
 static inline bool
 tsi_end_p (tree_stmt_iterator i)
 {
@@ -90,23 +63,11 @@ tsi_end_p (tree_stmt_iterator i)
 }
 
 static inline bool
-ctsi_end_p (const_tree_stmt_iterator i)
-{
-  return i.ptr == NULL;
-}
-
-static inline bool
 tsi_one_before_end_p (tree_stmt_iterator i)
 {
   return i.ptr != NULL && i.ptr->next == NULL;
 }
 
-static inline bool
-ctsi_one_before_end_p (const_tree_stmt_iterator i)
-{
-  return i.ptr != NULL && i.ptr->next == NULL;
-}
-
 static inline void
 tsi_next (tree_stmt_iterator *i)
 {
@@ -114,23 +75,11 @@ tsi_next (tree_stmt_iterator *i)
 }
 
 static inline void
-ctsi_next (const_tree_stmt_iterator *i)
-{
-  i->ptr = i->ptr->next;
-}
-
-static inline void
 tsi_prev (tree_stmt_iterator *i)
 {
   i->ptr = i->ptr->prev;
 }
 
-static inline void
-ctsi_prev (const_tree_stmt_iterator *i)
-{
-  i->ptr = i->ptr->prev;
-}
-
 static inline tree *
 tsi_stmt_ptr (tree_stmt_iterator i)
 {
@@ -143,12 +92,6 @@ tsi_stmt (tree_stmt_iterator i)
   return i.ptr->stmt;
 }
 
-static inline const_tree
-ctsi_stmt (const_tree_stmt_iterator i)
-{
-  return i.ptr->stmt;
-}
-
 enum tsi_iterator_update
 {
   TSI_NEW_STMT,                /* Only valid when single statement is added, move
@@ -168,12 +111,11 @@ extern void tsi_link_before (tree_stmt_iterator *, tree,
 extern void tsi_link_after (tree_stmt_iterator *, tree,
                            enum tsi_iterator_update);
 
-void tsi_delink (tree_stmt_iterator *);
-
-tree tsi_split_statement_list_after (const tree_stmt_iterator *);
-tree tsi_split_statement_list_before (tree_stmt_iterator *);
+extern void tsi_delink (tree_stmt_iterator *);
 
-void append_to_statement_list (tree, tree *);
-void append_to_statement_list_force (tree, tree *);
+extern tree alloc_stmt_list (void);
+extern void free_stmt_list (tree);
+extern void append_to_statement_list (tree, tree *);
+extern void append_to_statement_list_force (tree, tree *);
 
 #endif /* GCC_TREE_ITERATOR_H  */