OSDN Git Service

* tree.cc (_Rb_tree_increment, _Rb_tree_decrement,
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Apr 2009 13:01:17 +0000 (13:01 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Apr 2009 13:01:17 +0000 (13:01 +0000)
_Rb_tree_rebalance_for_erase, _Rb_tree_black_count): Mark nothrow;
update uses of _Rb_tree_rotate_left, _Rb_tree_rotate_right.
(_Rb_tree_rotate_left, _Rb_tree_rotate_right): Make wrapper and break
out body to ...
(local_Rb_tree_rotate_left, local_Rb_tree_rotate_right): New static
functions.
* stl_tree.h (_Rb_tree_increment, _Rb_tree_decrement,
_Rb_tree_insert_and_rebalance, _Rb_tree_rebalance_for_erase,
_Rb_tree_black_count): Mark nothrow.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146184 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_tree.h
libstdc++-v3/src/tree.cc

index b794ad9..cf43d2b 100644 (file)
@@ -1,3 +1,16 @@
+2009-04-16  Jan Hubicka  <jh@suse.cz>
+
+       * tree.cc (_Rb_tree_increment, _Rb_tree_decrement,
+       _Rb_tree_rebalance_for_erase, _Rb_tree_black_count): Mark nothrow;
+       update uses of _Rb_tree_rotate_left, _Rb_tree_rotate_right.
+       (_Rb_tree_rotate_left, _Rb_tree_rotate_right): Make wrapper and break
+       out body to ...
+       (local_Rb_tree_rotate_left, local_Rb_tree_rotate_right): New static
+       functions.
+       * stl_tree.h (_Rb_tree_increment, _Rb_tree_decrement,
+       _Rb_tree_insert_and_rebalance, _Rb_tree_rebalance_for_erase,
+       _Rb_tree_black_count): Mark nothrow.
+
 2009-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * include/bits/forward_list.h: Remove default std::allocator<_Tp>
index 2e56736..a1274e7 100644 (file)
@@ -138,16 +138,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     };
 
   _Rb_tree_node_base*
-  _Rb_tree_increment(_Rb_tree_node_base* __x);
+  _Rb_tree_increment(_Rb_tree_node_base* __x) throw ();
 
   const _Rb_tree_node_base*
-  _Rb_tree_increment(const _Rb_tree_node_base* __x);
+  _Rb_tree_increment(const _Rb_tree_node_base* __x) throw ();
 
   _Rb_tree_node_base*
-  _Rb_tree_decrement(_Rb_tree_node_base* __x);
+  _Rb_tree_decrement(_Rb_tree_node_base* __x) throw ();
 
   const _Rb_tree_node_base*
-  _Rb_tree_decrement(const _Rb_tree_node_base* __x);
+  _Rb_tree_decrement(const _Rb_tree_node_base* __x) throw ();
 
   template<typename _Tp>
     struct _Rb_tree_iterator
@@ -310,11 +310,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   _Rb_tree_insert_and_rebalance(const bool __insert_left,
                                 _Rb_tree_node_base* __x,
                                 _Rb_tree_node_base* __p,
-                                _Rb_tree_node_base& __header);
+                                _Rb_tree_node_base& __header) throw ();
 
   _Rb_tree_node_base*
   _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
-                              _Rb_tree_node_base& __header);
+                              _Rb_tree_node_base& __header) throw ();
 
 
   template<typename _Key, typename _Val, typename _KeyOfValue,
@@ -1450,7 +1450,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
   unsigned int
   _Rb_tree_black_count(const _Rb_tree_node_base* __node,
-                       const _Rb_tree_node_base* __root);
+                       const _Rb_tree_node_base* __root) throw ();
 
   template<typename _Key, typename _Val, typename _KeyOfValue,
            typename _Compare, typename _Alloc>
index c8ba935..b5f229f 100644 (file)
@@ -55,7 +55,7 @@
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
   _Rb_tree_node_base*
-  _Rb_tree_increment(_Rb_tree_node_base* __x)
+  _Rb_tree_increment(_Rb_tree_node_base* __x) throw ()
   {
     if (__x->_M_right != 0) 
       {
@@ -78,13 +78,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   }
 
   const _Rb_tree_node_base*
-  _Rb_tree_increment(const _Rb_tree_node_base* __x)
+  _Rb_tree_increment(const _Rb_tree_node_base* __x) throw ()
   {
     return _Rb_tree_increment(const_cast<_Rb_tree_node_base*>(__x));
   }
 
   _Rb_tree_node_base*
-  _Rb_tree_decrement(_Rb_tree_node_base* __x)
+  _Rb_tree_decrement(_Rb_tree_node_base* __x) throw ()
   {
     if (__x->_M_color == _S_red 
         && __x->_M_parent->_M_parent == __x)
@@ -110,14 +110,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   }
 
   const _Rb_tree_node_base*
-  _Rb_tree_decrement(const _Rb_tree_node_base* __x)
+  _Rb_tree_decrement(const _Rb_tree_node_base* __x) throw ()
   {
     return _Rb_tree_decrement(const_cast<_Rb_tree_node_base*>(__x));
   }
 
-  void 
-  _Rb_tree_rotate_left(_Rb_tree_node_base* const __x, 
-                      _Rb_tree_node_base*& __root)
+  static void 
+  local_Rb_tree_rotate_left(_Rb_tree_node_base* const __x, 
+                            _Rb_tree_node_base*& __root)
   {
     _Rb_tree_node_base* const __y = __x->_M_right;
 
@@ -136,9 +136,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     __x->_M_parent = __y;
   }
 
+  /* Static keyword was missing on _Rb_tree_rotate_left.
+     Export the symbol for backward compatibility until
+     next ABI change.  */
   void 
-  _Rb_tree_rotate_right(_Rb_tree_node_base* const __x, 
-                       _Rb_tree_node_base*& __root)
+  _Rb_tree_rotate_left(_Rb_tree_node_base* const __x, 
+                      _Rb_tree_node_base*& __root)
+  {
+    local_Rb_tree_rotate_left (__x, __root);
+  }
+
+  static void 
+  local_Rb_tree_rotate_right(_Rb_tree_node_base* const __x, 
+                            _Rb_tree_node_base*& __root)
   {
     _Rb_tree_node_base* const __y = __x->_M_left;
 
@@ -157,11 +167,21 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     __x->_M_parent = __y;
   }
 
+  /* Static keyword was missing on _Rb_tree_rotate_right
+     Export the symbol for backward compatibility until
+     next ABI change.  */
+  void 
+  _Rb_tree_rotate_right(_Rb_tree_node_base* const __x, 
+                       _Rb_tree_node_base*& __root)
+  {
+    local_Rb_tree_rotate_right (__x, __root);
+  }
+
   void 
   _Rb_tree_insert_and_rebalance(const bool          __insert_left,
                                 _Rb_tree_node_base* __x,
                                 _Rb_tree_node_base* __p,
-                                _Rb_tree_node_base& __header)
+                                _Rb_tree_node_base& __header) throw ()
   {
     _Rb_tree_node_base *& __root = __header._M_parent;
 
@@ -215,11 +235,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                if (__x == __x->_M_parent->_M_right) 
                  {
                    __x = __x->_M_parent;
-                   _Rb_tree_rotate_left(__x, __root);
+                   local_Rb_tree_rotate_left(__x, __root);
                  }
                __x->_M_parent->_M_color = _S_black;
                __xpp->_M_color = _S_red;
-               _Rb_tree_rotate_right(__xpp, __root);
+               local_Rb_tree_rotate_right(__xpp, __root);
              }
          }
        else 
@@ -237,11 +257,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                if (__x == __x->_M_parent->_M_left) 
                  {
                    __x = __x->_M_parent;
-                   _Rb_tree_rotate_right(__x, __root);
+                   local_Rb_tree_rotate_right(__x, __root);
                  }
                __x->_M_parent->_M_color = _S_black;
                __xpp->_M_color = _S_red;
-               _Rb_tree_rotate_left(__xpp, __root);
+               local_Rb_tree_rotate_left(__xpp, __root);
              }
          }
       }
@@ -250,7 +270,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
   _Rb_tree_node_base*
   _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z, 
-                              _Rb_tree_node_base& __header)
+                              _Rb_tree_node_base& __header) throw ()
   {
     _Rb_tree_node_base *& __root = __header._M_parent;
     _Rb_tree_node_base *& __leftmost = __header._M_left;
@@ -337,7 +357,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                {
                  __w->_M_color = _S_black;
                  __x_parent->_M_color = _S_red;
-                 _Rb_tree_rotate_left(__x_parent, __root);
+                 local_Rb_tree_rotate_left(__x_parent, __root);
                  __w = __x_parent->_M_right;
                }
              if ((__w->_M_left == 0 || 
@@ -356,14 +376,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                    {
                      __w->_M_left->_M_color = _S_black;
                      __w->_M_color = _S_red;
-                     _Rb_tree_rotate_right(__w, __root);
+                     local_Rb_tree_rotate_right(__w, __root);
                      __w = __x_parent->_M_right;
                    }
                  __w->_M_color = __x_parent->_M_color;
                  __x_parent->_M_color = _S_black;
                  if (__w->_M_right) 
                    __w->_M_right->_M_color = _S_black;
-                 _Rb_tree_rotate_left(__x_parent, __root);
+                 local_Rb_tree_rotate_left(__x_parent, __root);
                  break;
                }
            } 
@@ -375,7 +395,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                {
                  __w->_M_color = _S_black;
                  __x_parent->_M_color = _S_red;
-                 _Rb_tree_rotate_right(__x_parent, __root);
+                 local_Rb_tree_rotate_right(__x_parent, __root);
                  __w = __x_parent->_M_left;
                }
              if ((__w->_M_right == 0 || 
@@ -393,14 +413,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
                    {
                      __w->_M_right->_M_color = _S_black;
                      __w->_M_color = _S_red;
-                     _Rb_tree_rotate_left(__w, __root);
+                     local_Rb_tree_rotate_left(__w, __root);
                      __w = __x_parent->_M_left;
                    }
                  __w->_M_color = __x_parent->_M_color;
                  __x_parent->_M_color = _S_black;
                  if (__w->_M_left) 
                    __w->_M_left->_M_color = _S_black;
-                 _Rb_tree_rotate_right(__x_parent, __root);
+                 local_Rb_tree_rotate_right(__x_parent, __root);
                  break;
                }
            }
@@ -411,7 +431,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
   unsigned int
   _Rb_tree_black_count(const _Rb_tree_node_base* __node,
-                       const _Rb_tree_node_base* __root)
+                       const _Rb_tree_node_base* __root) throw ()
   {
     if (__node == 0)
       return 0;