From dee74d2ba3c045ae57d2be35f6e3a0be61e5434a Mon Sep 17 00:00:00 2001 From: bkoz Date: Sat, 15 Jan 2011 00:27:10 +0000 Subject: [PATCH] 2011-01-14 Benjamin Kosnik PR libstdc++/36104 * include/Makefile.am (bits_sup_headers, stamp-bits-sup): New. * include/Makefile.in: Regenerate. * libsupc++/Makefile.am (std_HEADERS, bits_HEADERS): New. (install-stdHEADERS, install-bitsHEADERS): New. * libsupc++/Makefile.in: Regenerate. * include/bits/c++config: Update for inline namespaces. * libsupc++/cxxabi-forced.h: To... * libsupc++/cxxabi_forced.h: ...this. * libsupc++/hash_bytes.h: Separate file. * libsupc++/typeinfo: Use it. * libsupc++/exception: Adjust for bits subdirectory. * libsupc++/eh_aux_runtime.cc: Same. * libsupc++/eh_ptr.cc: Same. * libsupc++/new_op.cc: Same. * libsupc++/exception_defines.h: Same. * libsupc++/nested_exception.h: Same. * libsupc++/eh_terminate.cc: Same. * libsupc++/vec.cc: Same. * libsupc++/vterminate.cc: Same. * libsupc++/exception_ptr.h: Same. * libsupc++/eh_personality.cc: Same. * libsupc++/eh_call.cc: Same. * libsupc++/new_opnt.cc: Same. * libsupc++/hash_bytes.cc: Same. * config/cpu/arm/cxxabi_tweaks.h: Same. * config/cpu/generic/cxxabi_tweaks.h: Same. * libsupc++/cxxabi.h: Same. Consolidate _GLIBCXX_NOTHROW defines. * include/std/bitset: Same. * include/ext/vstring.tcc: Same. * include/bits/hashtable.h: Same. * include/bits/functional_hash.h: Same. * include/bits/hashtable_policy.h: Same. * include/bits/basic_string.h: Same. * include/bits/istream.tcc: Same. * include/bits/ostream.tcc: Same. * include/bits/algorithmfwd.h: Same. * include/bits/basic_string.tcc: Same. * include/bits/ostream_insert.h: Same. * include/bits/fstream.tcc: Same. * include/bits/functexcept.h: Same. * doc/doxygen/user.cfg.in: Adjust names. * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line numbers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168831 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 49 +++++ libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h | 7 +- libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h | 7 +- libstdc++-v3/doc/doxygen/user.cfg.in | 2 +- libstdc++-v3/include/Makefile.am | 21 ++- libstdc++-v3/include/Makefile.in | 18 +- libstdc++-v3/include/bits/algorithmfwd.h | 2 +- libstdc++-v3/include/bits/basic_string.h | 2 +- libstdc++-v3/include/bits/basic_string.tcc | 4 +- libstdc++-v3/include/bits/c++config | 125 ++++++------- libstdc++-v3/include/bits/fstream.tcc | 4 +- libstdc++-v3/include/bits/functexcept.h | 4 +- libstdc++-v3/include/bits/functional_hash.h | 27 +-- libstdc++-v3/include/bits/hashtable.h | 207 +++++++++++---------- libstdc++-v3/include/bits/hashtable_policy.h | 115 ++++++------ libstdc++-v3/include/bits/istream.tcc | 4 +- libstdc++-v3/include/bits/ostream.tcc | 4 +- libstdc++-v3/include/bits/ostream_insert.h | 4 +- libstdc++-v3/include/ext/vstring.tcc | 4 +- libstdc++-v3/include/std/bitset | 5 +- libstdc++-v3/libsupc++/Makefile.am | 59 ++++-- libstdc++-v3/libsupc++/Makefile.in | 88 +++++---- libstdc++-v3/libsupc++/cxxabi.h | 207 ++++++++++----------- .../libsupc++/{cxxabi-forced.h => cxxabi_forced.h} | 9 +- libstdc++-v3/libsupc++/eh_aux_runtime.cc | 4 +- libstdc++-v3/libsupc++/eh_call.cc | 5 +- libstdc++-v3/libsupc++/eh_personality.cc | 5 +- libstdc++-v3/libsupc++/eh_ptr.cc | 2 +- libstdc++-v3/libsupc++/eh_terminate.cc | 5 +- libstdc++-v3/libsupc++/exception | 6 +- libstdc++-v3/libsupc++/exception_defines.h | 12 +- libstdc++-v3/libsupc++/exception_ptr.h | 6 +- libstdc++-v3/libsupc++/hash_bytes.cc | 13 +- libstdc++-v3/libsupc++/hash_bytes.h | 56 ++++++ libstdc++-v3/libsupc++/nested_exception.h | 4 +- libstdc++-v3/libsupc++/new_op.cc | 4 +- libstdc++-v3/libsupc++/new_opnt.cc | 4 +- libstdc++-v3/libsupc++/typeinfo | 11 +- libstdc++-v3/libsupc++/vec.cc | 5 +- libstdc++-v3/libsupc++/vterminate.cc | 4 +- .../testsuite/ext/profile/mutex_extensions_neg.cc | 4 +- 41 files changed, 646 insertions(+), 482 deletions(-) rename libstdc++-v3/libsupc++/{cxxabi-forced.h => cxxabi_forced.h} (84%) create mode 100644 libstdc++-v3/libsupc++/hash_bytes.h diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index cd122ad4d6a..57295dfd86f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,52 @@ +2011-01-14 Benjamin Kosnik + + PR libstdc++/36104 + * include/Makefile.am (bits_sup_headers, stamp-bits-sup): New. + * include/Makefile.in: Regenerate. + * libsupc++/Makefile.am (std_HEADERS, bits_HEADERS): New. + (install-stdHEADERS, install-bitsHEADERS): New. + * libsupc++/Makefile.in: Regenerate. + + * include/bits/c++config: Update for inline namespaces. + * libsupc++/cxxabi-forced.h: To... + * libsupc++/cxxabi_forced.h: ...this. + * libsupc++/hash_bytes.h: Separate file. + * libsupc++/typeinfo: Use it. + * libsupc++/exception: Adjust for bits subdirectory. + * libsupc++/eh_aux_runtime.cc: Same. + * libsupc++/eh_ptr.cc: Same. + * libsupc++/new_op.cc: Same. + * libsupc++/exception_defines.h: Same. + * libsupc++/nested_exception.h: Same. + * libsupc++/eh_terminate.cc: Same. + * libsupc++/vec.cc: Same. + * libsupc++/vterminate.cc: Same. + * libsupc++/exception_ptr.h: Same. + * libsupc++/eh_personality.cc: Same. + * libsupc++/eh_call.cc: Same. + * libsupc++/new_opnt.cc: Same. + * libsupc++/hash_bytes.cc: Same. + * config/cpu/arm/cxxabi_tweaks.h: Same. + * config/cpu/generic/cxxabi_tweaks.h: Same. + * libsupc++/cxxabi.h: Same. Consolidate _GLIBCXX_NOTHROW defines. + * include/std/bitset: Same. + * include/ext/vstring.tcc: Same. + * include/bits/hashtable.h: Same. + * include/bits/functional_hash.h: Same. + * include/bits/hashtable_policy.h: Same. + * include/bits/basic_string.h: Same. + * include/bits/istream.tcc: Same. + * include/bits/ostream.tcc: Same. + * include/bits/algorithmfwd.h: Same. + * include/bits/basic_string.tcc: Same. + * include/bits/ostream_insert.h: Same. + * include/bits/fstream.tcc: Same. + * include/bits/functexcept.h: Same. + + * doc/doxygen/user.cfg.in: Adjust names. + + * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line numbers. + 2011-01-14 Paolo Carlini * testsuite/25_algorithms/is_permutation/check_type.cc: Minor diff --git a/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h b/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h index 1bfc58810f4..2ac349dfc17 100644 --- a/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h +++ b/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h @@ -1,6 +1,6 @@ // Control various target specific ABI tweaks. ARM version. -// Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2004, 2006, 2008, 2009, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -22,8 +22,9 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -/** @file cxxabi_tweaks.h - * The header provides an CPU-variable interface to the C++ ABI. +/** @file bits/cxxabi_tweaks.h + * This is an internal header file, included by other library headers. + * Do not attempt to use it directly. @headername{cxxabi.h} */ #ifndef _CXXABI_TWEAKS_H diff --git a/libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h b/libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h index 8354691e140..f48f73e0003 100644 --- a/libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h +++ b/libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h @@ -1,6 +1,6 @@ // Control various target specific ABI tweaks. Generic version. -// Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2004, 2006, 2008, 2009, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -22,8 +22,9 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -/** @file cxxabi_tweaks.h - * The header provides an CPU-variable interface to the C++ ABI. +/** @file bits/cxxabi_tweaks.h + * This is an internal header file, included by other library headers. + * Do not attempt to use it directly. @headername{cxxabi.h} */ #ifndef _CXXABI_TWEAKS_H diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in index be7119ca821..442bba21b06 100644 --- a/libstdc++-v3/doc/doxygen/user.cfg.in +++ b/libstdc++-v3/doc/doxygen/user.cfg.in @@ -586,7 +586,7 @@ WARN_LOGFILE = INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ @srcdir@/libsupc++/cxxabi.h \ - @srcdir@/libsupc++/cxxabi-forced.h \ + @srcdir@/libsupc++/cxxabi_forced.h \ @srcdir@/libsupc++/exception \ @srcdir@/libsupc++/exception_defines.h \ @srcdir@/libsupc++/exception_ptr.h \ diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 6587179a4ef..5b6352e33b8 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -1,6 +1,7 @@ ## Makefile for the include subdirectory of the GNU C++ Standard library. ## -## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +## 2011 ## Free Software Foundation, Inc. ## ## This file is part of the libstdc++ version 3 distribution. @@ -172,6 +173,14 @@ bits_headers = \ ${bits_srcdir}/valarray_after.h \ ${bits_srcdir}/vector.tcc +bits_sup_srcdir = ${glibcxx_srcdir}/libsupc++ +bits_sup_headers = \ + ${bits_sup_srcdir}/cxxabi_forced.h \ + ${bits_sup_srcdir}/exception_defines.h \ + ${bits_sup_srcdir}/exception_ptr.h \ + ${bits_sup_srcdir}/hash_bytes.h \ + ${bits_sup_srcdir}/nested_exception.h + backward_srcdir = ${glibcxx_srcdir}/include/backward backward_builddir = ./backward backward_headers = \ @@ -888,7 +897,7 @@ endif # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. allstamped = \ - stamp-std stamp-bits stamp-c_base stamp-c_compatibility \ + stamp-std stamp-bits stamp-bits-sup stamp-c_base stamp-c_compatibility \ stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-decimal \ stamp-debug stamp-parallel stamp-profile stamp-profile-impl \ stamp-host @@ -917,6 +926,10 @@ stamp-bits: ${bits_headers} @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null @$(STAMP) stamp-bits +stamp-bits-sup: stamp-bits ${bits_sup_headers} + @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null + @$(STAMP) stamp-bits-sup + stamp-c_base: ${c_base_headers} @-mkdir -p ${c_base_builddir} @-cd ${c_base_builddir} && $(LN_S) $? . 2>/dev/null @@ -1071,14 +1084,14 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \ stamp-namespace-version \ stamp-visibility @date=`cat ${toplevel_srcdir}/gcc/DATESTAMP` ;\ - nsa_version=`cat stamp-namespace-version` ;\ + ns_version=`cat stamp-namespace-version` ;\ visibility=`cat stamp-visibility` ;\ ldbl_compat='s,g,g,' ;\ grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_LONG_DOUBLE_COMPAT[ ][ ]*1[ ]*$$" \ ${CONFIG_HEADER} > /dev/null 2>&1 \ && ldbl_compat='s,^#undef _GLIBCXX_LONG_DOUBLE_COMPAT$$,#define _GLIBCXX_LONG_DOUBLE_COMPAT 1,' ;\ sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \ - -e "s,define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION, define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION $$nsa_version," \ + -e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \ -e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \ -e "$$ldbl_compat" \ < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 3260ef9bc20..d78315885cc 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -423,6 +423,14 @@ bits_headers = \ ${bits_srcdir}/valarray_after.h \ ${bits_srcdir}/vector.tcc +bits_sup_srcdir = ${glibcxx_srcdir}/libsupc++ +bits_sup_headers = \ + ${bits_sup_srcdir}/cxxabi_forced.h \ + ${bits_sup_srcdir}/exception_defines.h \ + ${bits_sup_srcdir}/exception_ptr.h \ + ${bits_sup_srcdir}/hash_bytes.h \ + ${bits_sup_srcdir}/nested_exception.h + backward_srcdir = ${glibcxx_srcdir}/include/backward backward_builddir = ./backward backward_headers = \ @@ -1125,7 +1133,7 @@ PCHFLAGS = -x c++-header -nostdinc++ $(CXXFLAGS) # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. allstamped = \ - stamp-std stamp-bits stamp-c_base stamp-c_compatibility \ + stamp-std stamp-bits stamp-bits-sup stamp-c_base stamp-c_compatibility \ stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-decimal \ stamp-debug stamp-parallel stamp-profile stamp-profile-impl \ stamp-host @@ -1316,6 +1324,10 @@ stamp-bits: ${bits_headers} @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null @$(STAMP) stamp-bits +stamp-bits-sup: stamp-bits ${bits_sup_headers} + @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null + @$(STAMP) stamp-bits-sup + stamp-c_base: ${c_base_headers} @-mkdir -p ${c_base_builddir} @-cd ${c_base_builddir} && $(LN_S) $? . 2>/dev/null @@ -1464,14 +1476,14 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \ stamp-namespace-version \ stamp-visibility @date=`cat ${toplevel_srcdir}/gcc/DATESTAMP` ;\ - nsa_version=`cat stamp-namespace-version` ;\ + ns_version=`cat stamp-namespace-version` ;\ visibility=`cat stamp-visibility` ;\ ldbl_compat='s,g,g,' ;\ grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_LONG_DOUBLE_COMPAT[ ][ ]*1[ ]*$$" \ ${CONFIG_HEADER} > /dev/null 2>&1 \ && ldbl_compat='s,^#undef _GLIBCXX_LONG_DOUBLE_COMPAT$$,#define _GLIBCXX_LONG_DOUBLE_COMPAT 1,' ;\ sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \ - -e "s,define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION, define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION $$nsa_version," \ + -e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \ -e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \ -e "$$ldbl_compat" \ < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\ diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h index fd5dbb211e1..f6f4eacd1f6 100644 --- a/libstdc++-v3/include/bits/algorithmfwd.h +++ b/libstdc++-v3/include/bits/algorithmfwd.h @@ -804,7 +804,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_P) _GLIBCXX_END_NESTED_NAMESPACE -#ifdef _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL +#ifdef _GLIBCXX_PARALLEL # include #endif diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index bffa8afd4c6..03c89620ddf 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -1,7 +1,7 @@ // Components for manipulating sequences of characters -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009, 2010 +// 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index a64c7815485..2b22c6b0acf 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -1,7 +1,7 @@ // Components for manipulating sequences of characters -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009, 2010 +// 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -41,7 +41,7 @@ #pragma GCC system_header -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 400c244eb98..7465f364d49 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -1,7 +1,7 @@ // Predefined symbols and macros -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -32,7 +32,7 @@ #define _GLIBCXX_CXX_CONFIG_H 1 // The current version of the C++ library in compressed ISO date format. -#define __GLIBCXX__ +#define __GLIBCXX__ // Macros for various attributes. #ifndef _GLIBCXX_PURE @@ -49,7 +49,7 @@ #ifndef _GLIBCXX_NOTHROW # ifdef __cplusplus -# define _GLIBCXX_NOTHROW throw() +# define _GLIBCXX_NOTHROW throw() # else # define _GLIBCXX_NOTHROW __attribute__((__nothrow__)) # endif @@ -87,7 +87,7 @@ namespace std { typedef __SIZE_TYPE__ size_t; typedef __PTRDIFF_TYPE__ ptrdiff_t; - + #ifdef __GXX_EXPERIMENTAL_CXX0X__ typedef decltype(nullptr) nullptr_t; #endif @@ -103,23 +103,19 @@ namespace std #ifndef _GLIBCXX_CONSTEXPR # ifdef __GXX_EXPERIMENTAL_CXX0X__ # define _GLIBCXX_CONSTEXPR constexpr -# else -# define _GLIBCXX_CONSTEXPR -# endif -#endif - -#ifndef _GLIBCXX_USE_CONSTEXPR -# ifdef __GXX_EXPERIMENTAL_CXX0X__ # define _GLIBCXX_USE_CONSTEXPR constexpr # else +# define _GLIBCXX_CONSTEXPR # define _GLIBCXX_USE_CONSTEXPR const # endif #endif -// Macros for activating various namespace association modes. -// _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG -// _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL -// _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION +// Macros for activating various inline namespaces. +// +// _GLIBCXX_NAMESPACE_DEBUG +// _GLIBCXX_NAMESPACE_PARALLEL +// _GLIBCXX_NAMESPACE_PROFILE +// _GLIBCXX_NAMESPACE_VERSION // Guide to libstdc++ namespaces. /* @@ -127,6 +123,7 @@ namespace std { namespace __debug { } namespace __parallel { } + namespace __profile { } namespace __norm { } // __normative, __shadow, __replaced namespace __cxx1998 { } @@ -135,26 +132,26 @@ namespace std */ #ifdef _GLIBCXX_DEBUG -# define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1 +# define _GLIBCXX_INLINE_DEBUG 1 #endif #ifdef _GLIBCXX_PARALLEL -# define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1 +# define _GLIBCXX_INLINE_PARALLEL 1 #endif -// Namespace association for profile +// Namespace association for profile. #ifdef _GLIBCXX_PROFILE -# define _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE 1 +# define _GLIBCXX_INLINE_PROFILE 1 #endif -#define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION +#define _GLIBCXX_INLINE_VERSION -// Defined if any namespace association modes are active. -#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG \ - || _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL \ - || _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE \ - || _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION -# define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1 +// Defined if inline namespaces modes are active. +#if _GLIBCXX_INLINE_DEBUG \ + || _GLIBCXX_INLINE_PARALLEL \ + || _GLIBCXX_INLINE_PROFILE \ + || _GLIBCXX_INLINE_VERSION +# define _GLIBCXX_USE_INLINE_NAMESPACES 1 #endif // Macros for namespace scope. Either namespace std:: or the name @@ -169,7 +166,7 @@ namespace std // _GLIBCXX_END_NAMESPACE // _GLIBCXX_BEGIN_NESTED_NAMESPACE // _GLIBCXX_END_NESTED_NAMESPACE -#ifndef _GLIBCXX_USE_NAMESPACE_ASSOCIATION +#ifndef _GLIBCXX_USE_INLINE_NAMESPACES # define _GLIBCXX_STD_D _GLIBCXX_STD # define _GLIBCXX_STD_P _GLIBCXX_STD # define _GLIBCXX_STD_PR _GLIBCXX_STD @@ -180,7 +177,7 @@ namespace std # define _GLIBCXX_END_NAMESPACE } #else -# if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION // && not anything else +# if _GLIBCXX_INLINE_VERSION // && not anything else # define _GLIBCXX_STD_D _GLIBCXX_STD # define _GLIBCXX_STD_P _GLIBCXX_STD # define _GLIBCXX_STD _6 @@ -189,37 +186,37 @@ namespace std # endif // debug -# if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE +# if _GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PARALLEL && !_GLIBCXX_INLINE_PROFILE # define _GLIBCXX_STD_D __norm # define _GLIBCXX_STD_P _GLIBCXX_STD # define _GLIBCXX_STD __cxx1998 -# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { +# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { # define _GLIBCXX_END_NAMESPACE } # define _GLIBCXX_EXTERN_TEMPLATE -1 # endif // parallel -# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE +# if _GLIBCXX_INLINE_PARALLEL && !_GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PROFILE # define _GLIBCXX_STD_D _GLIBCXX_STD # define _GLIBCXX_STD_P __norm # define _GLIBCXX_STD __cxx1998 -# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { +# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { # define _GLIBCXX_END_NAMESPACE } # endif // debug + parallel -# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE +# if _GLIBCXX_INLINE_PARALLEL && _GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PROFILE # define _GLIBCXX_STD_D __norm # define _GLIBCXX_STD_P __norm # define _GLIBCXX_STD __cxx1998 -# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { +# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { # define _GLIBCXX_END_NAMESPACE } # define _GLIBCXX_EXTERN_TEMPLATE -1 # endif // profile -# if _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE -# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL || _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG +# if _GLIBCXX_INLINE_PROFILE +# if _GLIBCXX_INLINE_PARALLEL || _GLIBCXX_INLINE_DEBUG # error Cannot use -D_GLIBCXX_PROFILE with -D_GLIBCXX_DEBUG or \ -D_GLIBCXX_PARALLEL # endif @@ -227,12 +224,12 @@ namespace std # define _GLIBCXX_STD_P _GLIBCXX_STD # define _GLIBCXX_STD_PR __norm # define _GLIBCXX_STD __cxx1998 -# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { +# define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { # define _GLIBCXX_END_NAMESPACE } # endif # if __NO_INLINE__ && !__GXX_WEAK__ -# warning currently using namespace associated mode which may fail \ +# warning currently using inlined namespace mode which may fail \ without inlining due to lack of weak symbols # endif @@ -240,52 +237,52 @@ namespace std # define _GLIBCXX_END_NESTED_NAMESPACE } } #endif -// Namespace associations for debug mode. -#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE +// Inline namespaces for debug mode. +#if _GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PROFILE namespace std -{ - namespace __norm { } +{ + namespace __norm { } inline namespace __debug { } inline namespace __cxx1998 { } } #endif -// Namespace associations for parallel mode. -#if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL +// Inline namespaces for parallel mode. +#if _GLIBCXX_INLINE_PARALLEL namespace std -{ - namespace __norm { } +{ + namespace __norm { } inline namespace __parallel { } inline namespace __cxx1998 { } } #endif -// Namespace associations for profile mode -#if _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE +// Inline namespaces for profile mode +#if _GLIBCXX_INLINE_PROFILE namespace std -{ - namespace __norm { } +{ + namespace __norm { } inline namespace __profile { } inline namespace __cxx1998 { } } #endif -// Namespace associations for versioning mode. -#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION +// Inline namespaces for versioning mode. +#if _GLIBCXX_INLINE_VERSION namespace std { inline namespace _6 { } } -namespace __gnu_cxx -{ +namespace __gnu_cxx +{ inline namespace _6 { } } namespace std { - namespace tr1 - { + namespace tr1 + { inline namespace _6 { } } } @@ -295,8 +292,8 @@ namespace std // Define if compatibility should be provided for -mlong-double-64 #undef _GLIBCXX_LONG_DOUBLE_COMPAT -// Namespace associations for long double 128 mode. -#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ +// Inline namespaces for long double 128 mode. +#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ namespace std { inline namespace __gnu_cxx_ldbl128 { } @@ -341,11 +338,11 @@ namespace std #else // !__cplusplus # define _GLIBCXX_BEGIN_EXTERN_C -# define _GLIBCXX_END_EXTERN_C +# define _GLIBCXX_END_EXTERN_C # undef _GLIBCXX_BEGIN_NAMESPACE # undef _GLIBCXX_END_NAMESPACE -# define _GLIBCXX_BEGIN_NAMESPACE(X) -# define _GLIBCXX_END_NAMESPACE +# define _GLIBCXX_BEGIN_NAMESPACE(X) +# define _GLIBCXX_END_NAMESPACE #endif // First includes. @@ -397,7 +394,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // Avoid the use of assert, because we're trying to keep the // include out of the mix. inline void - __replacement_assert(const char* __file, int __line, + __replacement_assert(const char* __file, int __line, const char* __function, const char* __condition) { __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line, @@ -406,8 +403,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) } _GLIBCXX_END_NAMESPACE -#define __glibcxx_assert(_Condition) \ - do \ +#define __glibcxx_assert(_Condition) \ + do \ { \ if (! (_Condition)) \ std::__replacement_assert(__FILE__, __LINE__, \ diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index 6e00388a63a..bd0fa4be010 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -1,7 +1,7 @@ // File based streams -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -// 2007, 2008, 2009, 2010 +// 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -38,7 +38,7 @@ #pragma GCC system_header -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/functexcept.h b/libstdc++-v3/include/bits/functexcept.h index 832ed7b55de..714d1cfd6b8 100644 --- a/libstdc++-v3/include/bits/functexcept.h +++ b/libstdc++-v3/include/bits/functexcept.h @@ -1,6 +1,6 @@ // Function-Based Exception Support -*- C++ -*- -// Copyright (C) 2001, 2004, 2005, 2008, 2009, 2010 +// Copyright (C) 2001, 2004, 2005, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -38,7 +38,7 @@ #define _FUNCTEXCEPT_H 1 #include -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/functional_hash.h b/libstdc++-v3/include/bits/functional_hash.h index 6cf70b7da80..30754510fca 100644 --- a/libstdc++-v3/include/bits/functional_hash.h +++ b/libstdc++-v3/include/bits/functional_hash.h @@ -1,6 +1,6 @@ // functional_hash.h header -*- C++ -*- -// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -32,10 +32,10 @@ #pragma GCC system_header -#include +#include + +_GLIBCXX_BEGIN_NAMESPACE(std) -namespace std -{ /** @defgroup hashes Hashes * @ingroup functors * @@ -122,20 +122,6 @@ namespace std #undef _Cxx_hashtable_define_trivial_hash - // Hash function implementation for the nontrivial specialization. - // All of them are based on a primitive that hashes a pointer to - // a byte array. The actual hash algorithm is not guaranteed to - // stay the same from release to release -- it may be updated or - // tuned to improve hash quality or speed. - size_t - _Hash_bytes(const void* __ptr, size_t __len, size_t __seed); - - // A similar hash primitive, using the FNV hash algorithm. This - // algorithm is guaranteed to stay the same from release to release. - // (although it might not produce the same values on different machines.) - size_t - _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed); - struct _Hash_impl { static size_t @@ -158,7 +144,7 @@ namespace std { static size_t hash(const void* __ptr, size_t __clength, - size_t __seed = static_cast(2166136261UL)) + size_t __seed = static_cast(2166136261UL)) { return _Fnv_hash_bytes(__ptr, __clength, __seed); } template @@ -196,6 +182,7 @@ namespace std hash::operator()(long double __val) const; // @} group hashes -} + +_GLIBCXX_END_NAMESPACE #endif // _FUNCTIONAL_HASH_H diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index fd29c5950c9..721d1228a7f 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -1,6 +1,6 @@ // hashtable.h header -*- C++ -*- -// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -35,39 +35,39 @@ #include -namespace std -{ +_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) + // Class template _Hashtable, class definition. - + // Meaning of class template _Hashtable's template parameters - + // _Key and _Value: arbitrary CopyConstructible types. - + // _Allocator: an allocator type ([lib.allocator.requirements]) whose // value type is Value. As a conforming extension, we allow for // value type != Value. // _ExtractKey: function object that takes a object of type Value // and returns a value of type _Key. - + // _Equal: function object that takes two objects of type k and returns // a bool-like value that is true if the two objects are considered equal. - + // _H1: the hash function. A unary function object with argument type // Key and result type size_t. Return values should be distributed // over the entire range [0, numeric_limits:::max()]. - + // _H2: the range-hashing function (in the terminology of Tavori and // Dreizin). A binary function object whose argument types and result // type are all size_t. Given arguments r and N, the return value is // in the range [0, N). - + // _Hash: the ranged hash function (Tavori and Dreizin). A binary function // whose argument types are _Key and size_t and whose result type is // size_t. Given arguments k and N, the return value is in the range // [0, N). Default: hash(k, N) = h2(h1(k), N). If _Hash is anything other // than the default, _H1 and _H2 are ignored. - + // _RehashPolicy: Policy class with three members, all of which govern // the bucket count. _M_next_bkt(n) returns a bucket count no smaller // than n. _M_bkt_for_elements(n) returns a bucket count appropriate @@ -76,27 +76,27 @@ namespace std // current element count is n_elt, we need to increase the bucket // count. If so, returns make_pair(true, n), where n is the new // bucket count. If not, returns make_pair(false, ). - + // ??? Right now it is hard-wired that the number of buckets never // shrinks. Should we allow _RehashPolicy to change that? - + // __cache_hash_code: bool. true if we store the value of the hash // function along with the value. This is a time-space tradeoff. // Storing it may improve lookup speed by reducing the number of times // we need to call the Equal function. - + // __constant_iterators: bool. true if iterator and const_iterator are // both constant iterator types. This is true for unordered_set and // unordered_multiset, false for unordered_map and unordered_multimap. - + // __unique_keys: bool. true if the return value of _Hashtable::count(k) // is always at most one, false if it may be an arbitrary number. This // true for unordered_set and unordered_map, false for unordered_multiset // and unordered_multimap. - + template - local_iterator; + local_iterator; typedef __detail::_Node_const_iterator - const_local_iterator; + const_local_iterator; typedef __detail::_Hashtable_iterator - iterator; + iterator; typedef __detail::_Hashtable_const_iterator - const_iterator; + const_iterator; template - friend struct __detail::_Map_base; + friend struct __detail::_Map_base; private: typedef __detail::_Hash_node<_Value, __cache_hash_code> _Node; typedef typename _Allocator::template rebind<_Node>::other - _Node_allocator_type; + _Node_allocator_type; typedef typename _Allocator::template rebind<_Node*>::other - _Bucket_allocator_type; + _Bucket_allocator_type; typedef typename _Allocator::template rebind<_Value>::other - _Value_allocator_type; + _Value_allocator_type; _Node_allocator_type _M_node_allocator; _Node** _M_buckets; @@ -181,39 +181,39 @@ namespace std _RehashPolicy _M_rehash_policy; template - _Node* - _M_allocate_node(_Args&&... __args); - + _Node* + _M_allocate_node(_Args&&... __args); + void _M_deallocate_node(_Node* __n); - + void _M_deallocate_nodes(_Node**, size_type); _Node** _M_allocate_buckets(size_type __n); - + void _M_deallocate_buckets(_Node**, size_type __n); - public: + public: // Constructor, destructor, assignment, swap _Hashtable(size_type __bucket_hint, const _H1&, const _H2&, const _Hash&, const _Equal&, const _ExtractKey&, const allocator_type&); - + template - _Hashtable(_InputIterator __first, _InputIterator __last, + _Hashtable(_InputIterator __first, _InputIterator __last, size_type __bucket_hint, - const _H1&, const _H2&, const _Hash&, + const _H1&, const _H2&, const _Hash&, const _Equal&, const _ExtractKey&, const allocator_type&); - + _Hashtable(const _Hashtable&); _Hashtable(_Hashtable&&); - + _Hashtable& operator=(const _Hashtable& __ht) { @@ -264,7 +264,7 @@ namespace std size_type size() const { return _M_element_count; } - + bool empty() const { return size() == 0; } @@ -288,18 +288,18 @@ namespace std size_type bucket_count() const { return _M_bucket_count; } - + size_type max_bucket_count() const { return max_size(); } - + size_type bucket_size(size_type __n) const { return std::distance(begin(__n), end(__n)); } - + size_type bucket(const key_type& __k) const - { + { return this->_M_bucket_index(__k, this->_M_hash_code(__k), bucket_count()); } @@ -331,7 +331,7 @@ namespace std float load_factor() const - { + { return static_cast(size()) / static_cast(bucket_count()); } @@ -342,8 +342,8 @@ namespace std const _RehashPolicy& __rehash_policy() const { return _M_rehash_policy; } - - void + + void __rehash_policy(const _RehashPolicy&); // Lookup. @@ -369,28 +369,28 @@ namespace std typename _Hashtable::_Hash_code_type) const; template - iterator - _M_insert_bucket(_Arg&&, size_type, + iterator + _M_insert_bucket(_Arg&&, size_type, typename _Hashtable::_Hash_code_type); template - std::pair - _M_insert(_Arg&&, std::true_type); + std::pair + _M_insert(_Arg&&, std::true_type); template - iterator - _M_insert(_Arg&&, std::false_type); + iterator + _M_insert(_Arg&&, std::false_type); typedef typename std::conditional<__unique_keys, std::pair, iterator>::type - _Insert_Return_Type; + _Insert_Return_Type; typedef typename std::conditional<__unique_keys, std::_Select1st<_Insert_Return_Type>, std::_Identity<_Insert_Return_Type> - >::type - _Insert_Conv_Type; + >::type + _Insert_Conv_Type; public: // Insert and erase @@ -415,22 +415,22 @@ namespace std std::enable_if::value>::type> - _Insert_Return_Type - insert(_Pair&& __v) - { return _M_insert(std::forward<_Pair>(__v), + _Insert_Return_Type + insert(_Pair&& __v) + { return _M_insert(std::forward<_Pair>(__v), std::integral_constant()); } template::value>::type> - iterator - insert(const_iterator, _Pair&& __v) - { return _Insert_Conv_Type()(insert(std::forward<_Pair>(__v))); } + iterator + insert(const_iterator, _Pair&& __v) + { return _Insert_Conv_Type()(insert(std::forward<_Pair>(__v))); } template - void - insert(_InputIterator __first, _InputIterator __last); + void + insert(_InputIterator __first, _InputIterator __last); void insert(initializer_list __l) @@ -461,7 +461,7 @@ namespace std // Definitions of class template _Hashtable's out-of-line member functions. - template @@ -487,7 +487,7 @@ namespace std } } - template @@ -500,7 +500,7 @@ namespace std _M_node_allocator.deallocate(__n, 1); } - template @@ -522,7 +522,7 @@ namespace std } } - template @@ -543,7 +543,7 @@ namespace std return __p; } - template @@ -556,7 +556,7 @@ namespace std __alloc.deallocate(__p, __n + 1); } - template @@ -581,7 +581,7 @@ namespace std _M_begin_bucket_index = _M_bucket_count; } - template @@ -622,8 +622,8 @@ namespace std __throw_exception_again; } } - - template @@ -664,7 +664,7 @@ namespace std } } - template @@ -690,7 +690,7 @@ namespace std __ht._M_rehash_policy = _RehashPolicy(); } - template @@ -702,7 +702,7 @@ namespace std _M_deallocate_buckets(_M_buckets, _M_bucket_count); } - template @@ -729,7 +729,7 @@ namespace std std::swap(_M_element_count, __x._M_element_count); } - template @@ -744,7 +744,7 @@ namespace std _M_rehash(__n_bkt); } - template @@ -761,7 +761,7 @@ namespace std return __p ? iterator(__p, _M_buckets + __n) : this->end(); } - template @@ -778,7 +778,7 @@ namespace std return __p ? const_iterator(__p, _M_buckets + __n) : this->end(); } - template @@ -798,7 +798,7 @@ namespace std return __result; } - template @@ -818,7 +818,7 @@ namespace std std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count); _Node** __head = _M_buckets + __n; _Node* __p = _M_find_node(*__head, __k, __code); - + if (__p) { _Node* __p1 = __p->_M_next; @@ -836,7 +836,7 @@ namespace std return std::make_pair(this->end(), this->end()); } - template @@ -876,13 +876,13 @@ namespace std // Find the node whose key compares equal to k, beginning the search // at p (usually the head of a bucket). Return nil if no node is found. - template typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, - __chc, __cit, __uk>::_Node* + __chc, __cit, __uk>::_Node* _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: _M_find_node(_Node* __p, const key_type& __k, @@ -895,7 +895,7 @@ namespace std } // Insert v in bucket n (assumes no element with its key already present). - template @@ -943,7 +943,7 @@ namespace std } // Insert v if no element with its key is already present. - template @@ -967,7 +967,7 @@ namespace std } // Insert v unconditionally. - template @@ -984,7 +984,7 @@ namespace std _M_element_count, 1); if (__do_rehash.first) _M_rehash(__do_rehash.second); - + const key_type& __k = this->_M_extract(__v); typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); size_type __n = this->_M_bucket_index(__k, __code, _M_bucket_count); @@ -993,7 +993,7 @@ namespace std _Node* __prev = _M_find_node(_M_buckets[__n], __k, __code); _Node* __new_node = _M_allocate_node(std::forward<_Arg>(__v)); - if (__prev) + if (__prev) { __new_node->_M_next = __prev->_M_next; __prev->_M_next = __new_node; @@ -1005,18 +1005,18 @@ namespace std if (__n < _M_begin_bucket_index) _M_begin_bucket_index = __n; } - this->_M_store_code(__new_node, __code); + this->_M_store_code(__new_node, __code); - ++_M_element_count; - return iterator(__new_node, _M_buckets + __n); + ++_M_element_count; + return iterator(__new_node, _M_buckets + __n); } - template template - void + void _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: insert(_InputIterator __first, _InputIterator __last) @@ -1032,7 +1032,7 @@ namespace std this->insert(*__first); } - template @@ -1073,7 +1073,7 @@ namespace std return __result; } - template @@ -1087,7 +1087,7 @@ namespace std typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k); std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count); size_type __result = 0; - + _Node** __slot = _M_buckets + __n; while (*__slot && !this->_M_compare(__k, __code, *__slot)) __slot = &((*__slot)->_M_next); @@ -1101,8 +1101,8 @@ namespace std if (std::__addressof(this->_M_extract((*__slot)->_M_v)) != std::__addressof(__k)) { - _Node* __p = *__slot; - *__slot = __p->_M_next; + _Node* __p = *__slot; + *__slot = __p->_M_next; _M_deallocate_node(__p); --_M_element_count; ++__result; @@ -1143,7 +1143,7 @@ namespace std // ??? This could be optimized by taking advantage of the bucket // structure, but it's not clear that it's worth doing. It probably // wouldn't even be an optimization unless the load factor is large. - template @@ -1159,7 +1159,7 @@ namespace std return iterator(__last._M_cur_node, __last._M_cur_bucket); } - template @@ -1172,8 +1172,8 @@ namespace std _M_element_count = 0; _M_begin_bucket_index = _M_bucket_count; } - - template @@ -1187,7 +1187,7 @@ namespace std + 1))); } - template @@ -1228,6 +1228,7 @@ namespace std __throw_exception_again; } } -} + +_GLIBCXX_END_NESTED_NAMESPACE // namespace std #endif // _HASHTABLE_H diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h index 622784ab097..e439dfaac8f 100644 --- a/libstdc++-v3/include/bits/hashtable_policy.h +++ b/libstdc++-v3/include/bits/hashtable_policy.h @@ -1,6 +1,6 @@ // Internal policy header for unordered_set and unordered_map -*- C++ -*- -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -24,15 +24,15 @@ /** @file bits/hashtable_policy.h * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. + * Do not attempt to use it directly. * @headername{unordered_map,unordered_set} */ #ifndef _HASHTABLE_POLICY_H #define _HASHTABLE_POLICY_H 1 -namespace std -{ +_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) + namespace __detail { // Helper function: return distance(first, last) for forward @@ -59,7 +59,7 @@ namespace __detail // Auxiliary types used for all instantiations of _Hashtable: nodes // and iterators. - + // Nodes, used to wrap elements stored in the hash table. A policy // template parameter of class template _Hashtable controls whether // nodes also store a hash code. In some cases (e.g. strings) this @@ -75,7 +75,7 @@ namespace __detail _Hash_node* _M_next; template - _Hash_node(_Args&&... __args) + _Hash_node(_Args&&... __args) : _M_v(std::forward<_Args>(__args)...), _M_hash_code(), _M_next() { } }; @@ -87,7 +87,7 @@ namespace __detail _Hash_node* _M_next; template - _Hash_node(_Args&&... __args) + _Hash_node(_Args&&... __args) : _M_v(std::forward<_Args>(__args)...), _M_next() { } }; @@ -99,7 +99,7 @@ namespace __detail { _Node_iterator_base(_Hash_node<_Value, __cache>* __p) : _M_cur(__p) { } - + void _M_incr() { _M_cur = _M_cur->_M_next; } @@ -126,10 +126,10 @@ namespace __detail typedef _Value value_type; typedef typename std::conditional<__constant_iterators, const _Value*, _Value*>::type - pointer; + pointer; typedef typename std::conditional<__constant_iterators, const _Value&, _Value&>::type - reference; + reference; typedef std::ptrdiff_t difference_type; typedef std::forward_iterator_tag iterator_category; @@ -143,21 +143,21 @@ namespace __detail reference operator*() const { return this->_M_cur->_M_v; } - + pointer operator->() const { return std::__addressof(this->_M_cur->_M_v); } _Node_iterator& operator++() - { + { this->_M_incr(); - return *this; + return *this; } - + _Node_iterator operator++(int) - { + { _Node_iterator __tmp(*this); this->_M_incr(); return __tmp; @@ -188,21 +188,21 @@ namespace __detail reference operator*() const { return this->_M_cur->_M_v; } - + pointer operator->() const { return std::__addressof(this->_M_cur->_M_v); } _Node_const_iterator& operator++() - { + { this->_M_incr(); - return *this; + return *this; } - + _Node_const_iterator operator++(int) - { + { _Node_const_iterator __tmp(*this); this->_M_incr(); return __tmp; @@ -265,10 +265,10 @@ namespace __detail typedef _Value value_type; typedef typename std::conditional<__constant_iterators, const _Value*, _Value*>::type - pointer; + pointer; typedef typename std::conditional<__constant_iterators, const _Value&, _Value&>::type - reference; + reference; typedef std::ptrdiff_t difference_type; typedef std::forward_iterator_tag iterator_category; @@ -286,21 +286,21 @@ namespace __detail reference operator*() const { return this->_M_cur_node->_M_v; } - + pointer operator->() const { return std::__addressof(this->_M_cur_node->_M_v); } _Hashtable_iterator& operator++() - { + { this->_M_incr(); return *this; } - + _Hashtable_iterator operator++(int) - { + { _Hashtable_iterator __tmp(*this); this->_M_incr(); return __tmp; @@ -336,21 +336,21 @@ namespace __detail reference operator*() const { return this->_M_cur_node->_M_v; } - + pointer operator->() const { return std::__addressof(this->_M_cur_node->_M_v); } _Hashtable_const_iterator& operator++() - { + { this->_M_incr(); return *this; } - + _Hashtable_const_iterator operator++(int) - { + { _Hashtable_const_iterator __tmp(*this); this->_M_incr(); return __tmp; @@ -390,16 +390,16 @@ namespace __detail float max_load_factor() const - { return _M_max_load_factor; } + { return _M_max_load_factor; } // Return a bucket size no smaller than n. std::size_t _M_next_bkt(std::size_t __n) const; - + // Return a bucket count appropriate for n elements std::size_t _M_bkt_for_elements(std::size_t __n) const; - + // __n_bkt is current bucket count, __n_elt is current element count, // and __n_ins is number of elements to be inserted. Do we need to // increase bucket count? If so, return make_pair(true, n), where n @@ -418,7 +418,7 @@ namespace __detail extern const unsigned long __prime_list[]; // XXX This is a hack. There's no good reason for any of - // _Prime_rehash_policy's member functions to be inline. + // _Prime_rehash_policy's member functions to be inline. // Return a prime no smaller than n. inline std::size_t @@ -427,7 +427,7 @@ namespace __detail { const unsigned long* __p = std::lower_bound(__prime_list, __prime_list + _S_n_primes, __n); - _M_next_resize = + _M_next_resize = static_cast(__builtin_ceil(*__p * _M_max_load_factor)); return *__p; } @@ -448,7 +448,7 @@ namespace __detail // Finds the smallest prime p such that alpha p > __n_elt + __n_ins. // If p > __n_bkt, return make_pair(true, p); otherwise return - // make_pair(false, 0). In principle this isn't very different from + // make_pair(false, 0). In principle this isn't very different from // _M_bkt_for_elements. // The only tricky part is that we're caching the element count at @@ -474,7 +474,7 @@ namespace __detail (__builtin_ceil(*__p * _M_max_load_factor)); return std::make_pair(true, *__p); } - else + else { _M_next_resize = static_cast (__builtin_ceil(__n_bkt * _M_max_load_factor)); @@ -642,10 +642,10 @@ namespace __detail // we have a dummy type as placeholder. // (2) Whether or not we cache hash codes. Caching hash codes is // meaningless if we have a ranged hash function. - // We also put the key extraction and equality comparison function + // We also put the key extraction and equality comparison function // objects here, for convenience. - - // Primary template: unused except as a hook for specializations. + + // Primary template: unused except as a hook for specializations. template* __p, std::size_t __n) const { return _M_ranged_hash(_M_extract(__p->_M_v), __n); } - + bool _M_compare(const _Key& __k, _Hash_code_type, _Hash_node<_Value, false>* __n) const @@ -694,7 +694,7 @@ namespace __detail _M_copy_code(_Hash_node<_Value, false>*, const _Hash_node<_Value, false>*) const { } - + void _M_swap(_Hash_code_base& __x) { @@ -712,11 +712,11 @@ namespace __detail // No specialization for ranged hash function while caching hash codes. // That combination is meaningless, and trying to do it is an error. - - + + // Specialization: ranged hash function, cache hash codes. This // combination is meaningless, so we provide only a declaration - // and no definition. + // and no definition. template @@ -725,7 +725,7 @@ namespace __detail // Specialization: hash function and range-hashing function, no // caching of hash codes. H is provided but ignored. Provides - // typedef and accessor required by TR1. + // typedef and accessor required by TR1. template @@ -749,7 +749,7 @@ namespace __detail _Hash_code_type _M_hash_code(const _Key& __k) const { return _M_h1(__k); } - + std::size_t _M_bucket_index(const _Key&, _Hash_code_type __c, std::size_t __n) const @@ -790,7 +790,7 @@ namespace __detail _H2 _M_h2; }; - // Specialization: hash function and range-hashing function, + // Specialization: hash function and range-hashing function, // caching hash codes. H is provided but ignored. Provides // typedef and accessor required by TR1. template { typedef _H1 hasher; - + hasher hash_function() const { return _M_h1; } @@ -812,11 +812,11 @@ namespace __detail : _M_extract(__ex), _M_eq(__eq), _M_h1(__h1), _M_h2(__h2) { } typedef std::size_t _Hash_code_type; - + _Hash_code_type _M_hash_code(const _Key& __k) const { return _M_h1(__k); } - + std::size_t _M_bucket_index(const _Key&, _Hash_code_type __c, std::size_t __n) const @@ -849,7 +849,7 @@ namespace __detail std::swap(_M_h1, __x._M_h1); std::swap(_M_h2, __x._M_h2); } - + protected: _ExtractKey _M_extract; _Equal _M_eq; @@ -898,8 +898,8 @@ namespace __detail private: template - static bool - _S_is_permutation(_Uiterator, _Uiterator, _Uiterator); + static bool + _S_is_permutation(_Uiterator, _Uiterator, _Uiterator); }; // See std::is_permutation in N3068. @@ -978,6 +978,7 @@ namespace __detail return true; } } // namespace __detail -} + +_GLIBCXX_END_NESTED_NAMESPACE // namespace std #endif // _HASHTABLE_POLICY_H diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc index 394553e1be9..6fc6b31ad26 100644 --- a/libstdc++-v3/include/bits/istream.tcc +++ b/libstdc++-v3/include/bits/istream.tcc @@ -1,7 +1,7 @@ // istream classes -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009, 2010 +// 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -38,7 +38,7 @@ #pragma GCC system_header -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc index 7a6330b45f3..ec41595a7c9 100644 --- a/libstdc++-v3/include/bits/ostream.tcc +++ b/libstdc++-v3/include/bits/ostream.tcc @@ -1,7 +1,7 @@ // ostream classes -*- C++ -*- // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009, 2010 +// 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -38,7 +38,7 @@ #pragma GCC system_header -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/bits/ostream_insert.h b/libstdc++-v3/include/bits/ostream_insert.h index 9e07abee89f..3d7cf2d5042 100644 --- a/libstdc++-v3/include/bits/ostream_insert.h +++ b/libstdc++-v3/include/bits/ostream_insert.h @@ -1,6 +1,6 @@ // Helpers for ostream inserters -*- C++ -*- -// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -33,7 +33,7 @@ #pragma GCC system_header #include -#include +#include _GLIBCXX_BEGIN_NAMESPACE(std) diff --git a/libstdc++-v3/include/ext/vstring.tcc b/libstdc++-v3/include/ext/vstring.tcc index 60effafae7d..95d4cc36cc4 100644 --- a/libstdc++-v3/include/ext/vstring.tcc +++ b/libstdc++-v3/include/ext/vstring.tcc @@ -1,6 +1,6 @@ // Versatile string -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 +// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -33,7 +33,7 @@ #pragma GCC system_header -#include +#include _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset index 86f361c9867..29b06d52e72 100644 --- a/libstdc++-v3/include/std/bitset +++ b/libstdc++-v3/include/std/bitset @@ -1,6 +1,7 @@ // -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +// 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -49,7 +50,7 @@ #include // For invalid_argument, out_of_range, // overflow_error #include -#include +#include #define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * sizeof(unsigned long)) #define _GLIBCXX_BITSET_WORDS(__n) \ diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am index 688e139cf59..f66832882bd 100644 --- a/libstdc++-v3/libsupc++/Makefile.am +++ b/libstdc++-v3/libsupc++/Makefile.am @@ -1,7 +1,7 @@ ## Makefile for the GNU C++ Support library. ## ## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -## 2009, 2010 +## 2009, 2010, 2011 ## Free Software Foundation, Inc. ## ## Process this file with automake to produce Makefile.in. @@ -31,10 +31,14 @@ toolexeclib_LTLIBRARIES = libsupc++.la # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a noinst_LTLIBRARIES = libsupc++convenience.la +std_HEADERS = \ + cxxabi.h exception initializer_list new typeinfo -headers = \ - exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h \ - initializer_list exception_ptr.h nested_exception.h +bits_HEADERS = \ + cxxabi_forced.h hash_bytes.h \ + exception_defines.h exception_ptr.h nested_exception.h + +headers = $(std_HEADERS) $(bits_HEADERS) if GLIBCXX_HOSTED c_sources = \ @@ -88,12 +92,9 @@ sources = \ vmi_class_type_info.cc \ vterminate.cc -libsupc___la_SOURCES = $(sources) $(c_sources) +libsupc___la_SOURCES = $(sources) $(c_sources) libsupc__convenience_la_SOURCES = $(sources) $(c_sources) -glibcxxinstalldir = $(gxx_include_dir) -glibcxxinstall_HEADERS = $(headers) - # AM_CXXFLAGS needs to be in each subdirectory so that it can be # modified in a per-library or per-sub-library way. Need to manually # set this option because CONFIG_CXXFLAGS has to be after @@ -132,7 +133,7 @@ cp-demangle.o: cp-demangle.c $(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $< -# libstdc++ libtool notes +# Libtool notes # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is # last. (That way, things like -O2 passed down from the toplevel can @@ -169,21 +170,43 @@ CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ --mode=link $(CXX) \ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + +# Install notes # We have to have rules modified from the default to counteract SUN make -# prepending each of $(glibcxxinstall_HEADERS) with VPATH below. -install-glibcxxinstallHEADERS: $(glibcxxinstall_HEADERS) +# prepending each of $(*_HEADERS) with VPATH below. +stddir = $(gxx_include_dir) +bitsdir = $(gxx_include_dir)/bits + +install-stdHEADERS: $(std_HEADERS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(glibcxxinstalldir) - @list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \ + $(mkinstalldirs) $(DESTDIR)$(stddir) + @list='$(std_HEADERS)'; for p in $$list; do \ q=`echo $$p | sed -e 's,.*/,,'`; \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ - echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q"; \ - $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(stddir)/$$q"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(stddir)/$$q; \ + done + +install-bitsHEADERS: $(bits_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bitsdir) + @list='$(bits_HEADERS)'; for p in $$list; do \ + q=`echo $$p | sed -e 's,.*/,,'`; \ + if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(bitsdir)/$$q"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(bitsdir)/$$q; \ + done + +uninstall-stdHEADERS: + @$(NORMAL_UNINSTALL) + list='$(std_HEADERS)'; for p in $$list; do \ + q=`echo $$p | sed -e 's,.*/,,'`; \ + rm -f $(DESTDIR)$(stddir)/$$q; \ done -uninstall-glibcxxinstallHEADERS: +uninstall-bitsHEADERS: @$(NORMAL_UNINSTALL) - list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \ + list='$(bits_HEADERS)'; for p in $$list; do \ q=`echo $$p | sed -e 's,.*/,,'`; \ - rm -f $(DESTDIR)$(glibcxxinstalldir)/$$q; \ + rm -f $(DESTDIR)$(bitsdir)/$$q; \ done diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index 5ecbcf19701..9951feddca1 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -37,7 +37,7 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = $(top_srcdir)/fragment.am $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(glibcxxinstall_HEADERS) + $(srcdir)/Makefile.am $(bits_HEADERS) $(std_HEADERS) subdir = libsupc++ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ @@ -86,8 +86,8 @@ am__nobase_list = $(am__nobase_strip_setup); \ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \ - "$(DESTDIR)$(glibcxxinstalldir)" +am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(bitsdir)" \ + "$(DESTDIR)$(stddir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) libsupc___la_LIBADD = am__objects_1 = array_type_info.lo atexit_arm.lo bad_alloc.lo \ @@ -122,7 +122,7 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) SOURCES = $(libsupc___la_SOURCES) $(libsupc__convenience_la_SOURCES) -HEADERS = $(glibcxxinstall_HEADERS) +HEADERS = $(bits_HEADERS) $(std_HEADERS) ETAGS = etags CTAGS = ctags ABI_TWEAKS_SRCDIR = @ABI_TWEAKS_SRCDIR@ @@ -339,10 +339,14 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) toolexeclib_LTLIBRARIES = libsupc++.la # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a noinst_LTLIBRARIES = libsupc++convenience.la -headers = \ - exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h \ - initializer_list exception_ptr.h nested_exception.h +std_HEADERS = \ + cxxabi.h exception initializer_list new typeinfo +bits_HEADERS = \ + cxxabi_forced.h hash_bytes.h \ + exception_defines.h exception_ptr.h nested_exception.h + +headers = $(std_HEADERS) $(bits_HEADERS) @GLIBCXX_HOSTED_TRUE@c_sources = \ @GLIBCXX_HOSTED_TRUE@ cp-demangle.c @@ -393,10 +397,8 @@ sources = \ vmi_class_type_info.cc \ vterminate.cc -libsupc___la_SOURCES = $(sources) $(c_sources) +libsupc___la_SOURCES = $(sources) $(c_sources) libsupc__convenience_la_SOURCES = $(sources) $(c_sources) -glibcxxinstalldir = $(gxx_include_dir) -glibcxxinstall_HEADERS = $(headers) # AM_CXXFLAGS needs to be in each subdirectory so that it can be # modified in a per-library or per-sub-library way. Need to manually @@ -429,7 +431,7 @@ LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared $(LIBTOOLFLAGS) --mode=comp $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -# libstdc++ libtool notes +# Libtool notes # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is # last. (That way, things like -O2 passed down from the toplevel can @@ -466,6 +468,12 @@ CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ --mode=link $(CXX) \ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + +# Install notes +# We have to have rules modified from the default to counteract SUN make +# prepending each of $(*_HEADERS) with VPATH below. +stddir = $(gxx_include_dir) +bitsdir = $(gxx_include_dir)/bits all: all-am .SUFFIXES: @@ -630,7 +638,7 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(glibcxxinstalldir)"; do \ + for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(bitsdir)" "$(DESTDIR)$(stddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -680,7 +688,7 @@ info: info-am info-am: -install-data-am: install-glibcxxinstallHEADERS +install-data-am: install-bitsHEADERS install-stdHEADERS install-dvi: install-dvi-am @@ -725,7 +733,7 @@ ps: ps-am ps-am: -uninstall-am: uninstall-glibcxxinstallHEADERS \ +uninstall-am: uninstall-bitsHEADERS uninstall-stdHEADERS \ uninstall-toolexeclibLTLIBRARIES .MAKE: install-am install-strip @@ -734,16 +742,17 @@ uninstall-am: uninstall-glibcxxinstallHEADERS \ clean-libtool clean-noinstLTLIBRARIES \ clean-toolexeclibLTLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags dvi dvi-am \ - html html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-glibcxxinstallHEADERS install-html \ + html html-am info info-am install install-am \ + install-bitsHEADERS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ - install-strip install-toolexeclibLTLIBRARIES installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-glibcxxinstallHEADERS \ + install-stdHEADERS install-strip \ + install-toolexeclibLTLIBRARIES installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-bitsHEADERS uninstall-stdHEADERS \ uninstall-toolexeclibLTLIBRARIES @@ -755,23 +764,38 @@ cp-demangle.lo: cp-demangle.c cp-demangle.o: cp-demangle.c $(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $< -# We have to have rules modified from the default to counteract SUN make -# prepending each of $(glibcxxinstall_HEADERS) with VPATH below. -install-glibcxxinstallHEADERS: $(glibcxxinstall_HEADERS) +install-stdHEADERS: $(std_HEADERS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(glibcxxinstalldir) - @list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \ + $(mkinstalldirs) $(DESTDIR)$(stddir) + @list='$(std_HEADERS)'; for p in $$list; do \ q=`echo $$p | sed -e 's,.*/,,'`; \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ - echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q"; \ - $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(stddir)/$$q"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(stddir)/$$q; \ + done + +install-bitsHEADERS: $(bits_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bitsdir) + @list='$(bits_HEADERS)'; for p in $$list; do \ + q=`echo $$p | sed -e 's,.*/,,'`; \ + if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(bitsdir)/$$q"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(bitsdir)/$$q; \ + done + +uninstall-stdHEADERS: + @$(NORMAL_UNINSTALL) + list='$(std_HEADERS)'; for p in $$list; do \ + q=`echo $$p | sed -e 's,.*/,,'`; \ + rm -f $(DESTDIR)$(stddir)/$$q; \ done -uninstall-glibcxxinstallHEADERS: +uninstall-bitsHEADERS: @$(NORMAL_UNINSTALL) - list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \ + list='$(bits_HEADERS)'; for p in $$list; do \ q=`echo $$p | sed -e 's,.*/,,'`; \ - rm -f $(DESTDIR)$(glibcxxinstalldir)/$$q; \ + rm -f $(DESTDIR)$(bitsdir)/$$q; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/libstdc++-v3/libsupc++/cxxabi.h b/libstdc++-v3/libsupc++/cxxabi.h index be898d7811a..c93085a072b 100644 --- a/libstdc++-v3/libsupc++/cxxabi.h +++ b/libstdc++-v3/libsupc++/cxxabi.h @@ -1,6 +1,6 @@ -// new abi support -*- C++ -*- - -// Copyright (C) 2000, 2002, 2003, 2004, 2006, 2007, 2009, 2010 +// ABI Support -*- C++ -*- + +// Copyright (C) 2000, 2002, 2003, 2004, 2006, 2007, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of GCC. @@ -9,12 +9,12 @@ // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3, or (at your option) // any later version. -// +// // GCC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. @@ -25,12 +25,12 @@ // . // Written by Nathan Sidwell, Codesourcery LLC, - + /* This file declares the new abi entry points into the runtime. It is not normally necessary for user programs to include this header, or use the entry points directly. However, this header is available should that be needed. - + Some of the entry points are intended for both C and C++, thus this header is includable from both C and C++. Though the C++ specific parts are not available in C, naturally enough. */ @@ -47,40 +47,35 @@ #pragma GCC visibility push(default) #include +#include #include -#include - -#ifdef __cplusplus -#define _GLIBCXX_NOTHROW throw() -#else -#define _GLIBCXX_NOTHROW __attribute__((__nothrow__)) -#endif +#include #ifdef __cplusplus namespace __cxxabiv1 -{ - extern "C" +{ + extern "C" { #endif typedef __cxa_cdtor_return_type (*__cxa_cdtor_type)(void *); // Allocate array. - void* - __cxa_vec_new(size_t __element_count, size_t __element_size, + void* + __cxa_vec_new(size_t __element_count, size_t __element_size, size_t __padding_size, __cxa_cdtor_type __constructor, __cxa_cdtor_type __destructor); void* __cxa_vec_new2(size_t __element_count, size_t __element_size, size_t __padding_size, __cxa_cdtor_type __constructor, - __cxa_cdtor_type __destructor, void *(*__alloc) (size_t), + __cxa_cdtor_type __destructor, void *(*__alloc) (size_t), void (*__dealloc) (void*)); void* __cxa_vec_new3(size_t __element_count, size_t __element_size, size_t __padding_size, __cxa_cdtor_type __constructor, - __cxa_cdtor_type __destructor, void *(*__alloc) (size_t), + __cxa_cdtor_type __destructor, void *(*__alloc) (size_t), void (*__dealloc) (void*, size_t)); // Construct array. @@ -91,41 +86,41 @@ namespace __cxxabiv1 __cxa_vec_ctor_return_type __cxa_vec_cctor(void* __dest_array, void* __src_array, - size_t __element_count, size_t __element_size, - __cxa_cdtor_return_type (*__constructor) (void*, void*), + size_t __element_count, size_t __element_size, + __cxa_cdtor_return_type (*__constructor) (void*, void*), __cxa_cdtor_type __destructor); - + // Destruct array. - void + void __cxa_vec_dtor(void* __array_address, size_t __element_count, size_t __element_size, __cxa_cdtor_type __destructor); - - void + + void __cxa_vec_cleanup(void* __array_address, size_t __element_count, size_t __s, __cxa_cdtor_type __destructor) _GLIBCXX_NOTHROW; - + // Destruct and release array. - void + void __cxa_vec_delete(void* __array_address, size_t __element_size, size_t __padding_size, __cxa_cdtor_type __destructor); - void + void __cxa_vec_delete2(void* __array_address, size_t __element_size, size_t __padding_size, __cxa_cdtor_type __destructor, void (*__dealloc) (void*)); - - void + + void __cxa_vec_delete3(void* __array_address, size_t __element_size, size_t __padding_size, __cxa_cdtor_type __destructor, void (*__dealloc) (void*, size_t)); - int + int __cxa_guard_acquire(__guard*); - void + void __cxa_guard_release(__guard*) _GLIBCXX_NOTHROW; - void + void __cxa_guard_abort(__guard*) _GLIBCXX_NOTHROW; // Pure virtual functions. @@ -148,7 +143,7 @@ namespace __cxxabiv1 /** - * @brief Demangling routine. + * @brief Demangling routine. * ABI-mandated entry point in the C++ runtime library for demangling. * * @param __mangled_name A NUL-terminated character string @@ -177,7 +172,7 @@ namespace __cxxabiv1 * The demangling is performed using the C++ ABI mangling rules, * with GNU extensions. For example, this function is used in * __gnu_cxx::__verbose_terminate_handler. - * + * * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch39.html * for other examples of use. * @@ -205,10 +200,10 @@ namespace __cxxabiv1 class __fundamental_type_info : public std::type_info { public: - explicit + explicit __fundamental_type_info(const char* __n) : std::type_info(__n) { } - virtual + virtual ~__fundamental_type_info(); }; @@ -216,10 +211,10 @@ namespace __cxxabiv1 class __array_type_info : public std::type_info { public: - explicit + explicit __array_type_info(const char* __n) : std::type_info(__n) { } - virtual + virtual ~__array_type_info(); }; @@ -227,15 +222,15 @@ namespace __cxxabiv1 class __function_type_info : public std::type_info { public: - explicit + explicit __function_type_info(const char* __n) : std::type_info(__n) { } - virtual + virtual ~__function_type_info(); protected: // Implementation defined member function. - virtual bool + virtual bool __is_function_p() const; }; @@ -243,10 +238,10 @@ namespace __cxxabiv1 class __enum_type_info : public std::type_info { public: - explicit + explicit __enum_type_info(const char* __n) : std::type_info(__n) { } - virtual + virtual ~__enum_type_info(); }; @@ -257,17 +252,17 @@ namespace __cxxabiv1 unsigned int __flags; // Qualification of the target object. const std::type_info* __pointee; // Type of pointed to object. - explicit - __pbase_type_info(const char* __n, int __quals, + explicit + __pbase_type_info(const char* __n, int __quals, const std::type_info* __type) : std::type_info(__n), __flags(__quals), __pointee(__type) { } - - virtual + + virtual ~__pbase_type_info(); // Implementation defined type. - enum __masks + enum __masks { __const_mask = 0x1, __volatile_mask = 0x2, @@ -283,11 +278,11 @@ namespace __cxxabiv1 operator=(const __pbase_type_info&); // Implementation defined member functions. - virtual bool - __do_catch(const std::type_info* __thr_type, void** __thr_obj, + virtual bool + __do_catch(const std::type_info* __thr_type, void** __thr_obj, unsigned int __outer) const; - inline virtual bool + inline virtual bool __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, unsigned __outer) const; }; @@ -296,22 +291,22 @@ namespace __cxxabiv1 class __pointer_type_info : public __pbase_type_info { public: - explicit - __pointer_type_info(const char* __n, int __quals, + explicit + __pointer_type_info(const char* __n, int __quals, const std::type_info* __type) : __pbase_type_info (__n, __quals, __type) { } - virtual + virtual ~__pointer_type_info(); protected: // Implementation defined member functions. - virtual bool + virtual bool __is_pointer_p() const; - virtual bool - __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, + virtual bool + __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, unsigned __outer) const; }; @@ -323,13 +318,13 @@ namespace __cxxabiv1 public: __class_type_info* __context; // Class of the member. - explicit + explicit __pointer_to_member_type_info(const char* __n, int __quals, - const std::type_info* __type, + const std::type_info* __type, __class_type_info* __klass) : __pbase_type_info(__n, __quals, __type), __context(__klass) { } - virtual + virtual ~__pointer_to_member_type_info(); protected: @@ -339,7 +334,7 @@ namespace __cxxabiv1 operator=(const __pointer_to_member_type_info&); // Implementation defined member function. - virtual bool + virtual bool __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, unsigned __outer) const; }; @@ -351,26 +346,26 @@ namespace __cxxabiv1 const __class_type_info* __base_type; // Base class type. long __offset_flags; // Offset and info. - enum __offset_flags_masks + enum __offset_flags_masks { __virtual_mask = 0x1, __public_mask = 0x2, __hwm_bit = 2, __offset_shift = 8 // Bits to shift offset. }; - + // Implementation defined member functions. - bool + bool __is_virtual_p() const { return __offset_flags & __virtual_mask; } - bool + bool __is_public_p() const { return __offset_flags & __public_mask; } - ptrdiff_t + ptrdiff_t __offset() const - { + { // This shift, being of a signed type, is implementation // defined. GCC implements such shifts as arithmetic, which is // what we want. @@ -382,10 +377,10 @@ namespace __cxxabiv1 class __class_type_info : public std::type_info { public: - explicit + explicit __class_type_info (const char *__n) : type_info(__n) { } - virtual + virtual ~__class_type_info (); // Implementation defined types. @@ -396,24 +391,24 @@ namespace __cxxabiv1 enum __sub_kind { // We have no idea. - __unknown = 0, + __unknown = 0, // Not contained within us (in some circumstances this might // mean not contained publicly) - __not_contained, + __not_contained, // Contained ambiguously. - __contained_ambig, - + __contained_ambig, + // Via a virtual path. - __contained_virtual_mask = __base_class_type_info::__virtual_mask, + __contained_virtual_mask = __base_class_type_info::__virtual_mask, // Via a public path. - __contained_public_mask = __base_class_type_info::__public_mask, + __contained_public_mask = __base_class_type_info::__public_mask, // Contained within us. __contained_mask = 1 << __base_class_type_info::__hwm_bit, - + __contained_private = __contained_mask, __contained_public = __contained_mask | __contained_public_mask }; @@ -423,17 +418,17 @@ namespace __cxxabiv1 protected: // Implementation defined member functions. - virtual bool + virtual bool __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const; - virtual bool - __do_catch(const type_info* __thr_type, void** __thr_obj, + virtual bool + __do_catch(const type_info* __thr_type, void** __thr_obj, unsigned __outer) const; public: - // Helper for upcast. See if DST is us, or one of our bases. - // Return false if not found, true if found. - virtual bool + // Helper for upcast. See if DST is us, or one of our bases. + // Return false if not found, true if found. + virtual bool __do_upcast(const __class_type_info* __dst, const void* __obj, __upcast_result& __restrict __result) const; @@ -443,9 +438,9 @@ namespace __cxxabiv1 // objects might be contained within this type. If SRC_PTR is one // of our SRC_TYPE bases, indicate the virtuality. Returns // not_contained for non containment or private containment. - inline __sub_kind + inline __sub_kind __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, - const __class_type_info* __src_type, + const __class_type_info* __src_type, const void* __src_ptr) const; // Helper for dynamic cast. ACCESS_PATH gives the access from the @@ -455,17 +450,17 @@ namespace __cxxabiv1 // started from and SRC_PTR points to that base within the most // derived object. Fill in RESULT with what we find. Return true // if we have located an ambiguous match. - virtual bool + virtual bool __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path, - const __class_type_info* __dst_type, const void* __obj_ptr, - const __class_type_info* __src_type, const void* __src_ptr, + const __class_type_info* __dst_type, const void* __obj_ptr, + const __class_type_info* __src_type, const void* __src_ptr, __dyncast_result& __result) const; - + // Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE // bases are inherited by the type started from -- which is not // necessarily the current type. The current type will be a base // of the destination type. OBJ_PTR points to the current base. - virtual __sub_kind + virtual __sub_kind __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, const __class_type_info* __src_type, const void* __src_ptr) const; @@ -477,11 +472,11 @@ namespace __cxxabiv1 public: const __class_type_info* __base_type; - explicit + explicit __si_class_type_info(const char *__n, const __class_type_info *__base) : __class_type_info(__n), __base_type(__base) { } - virtual + virtual ~__si_class_type_info(); protected: @@ -491,24 +486,24 @@ namespace __cxxabiv1 operator=(const __si_class_type_info&); // Implementation defined member functions. - virtual bool + virtual bool __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path, const __class_type_info* __dst_type, const void* __obj_ptr, const __class_type_info* __src_type, const void* __src_ptr, __dyncast_result& __result) const; - virtual __sub_kind + virtual __sub_kind __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, const __class_type_info* __src_type, const void* __sub_ptr) const; - virtual bool + virtual bool __do_upcast(const __class_type_info*__dst, const void*__obj, __upcast_result& __restrict __result) const; }; // Type information for a class with multiple and/or virtual bases. - class __vmi_class_type_info : public __class_type_info + class __vmi_class_type_info : public __class_type_info { public: unsigned int __flags; // Details about the class hierarchy. @@ -519,15 +514,15 @@ namespace __cxxabiv1 // internally generated by the compiler. __base_class_type_info __base_info[1]; // Array of bases. - explicit + explicit __vmi_class_type_info(const char* __n, int ___flags) : __class_type_info(__n), __flags(___flags), __base_count(0) { } - virtual + virtual ~__vmi_class_type_info(); // Implementation defined types. - enum __flags_masks + enum __flags_masks { __non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base. __diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance. @@ -536,18 +531,18 @@ namespace __cxxabiv1 protected: // Implementation defined member functions. - virtual bool + virtual bool __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path, const __class_type_info* __dst_type, const void* __obj_ptr, const __class_type_info* __src_type, const void* __src_ptr, __dyncast_result& __result) const; - virtual __sub_kind - __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, + virtual __sub_kind + __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, const __class_type_info* __src_type, const void* __src_ptr) const; - - virtual bool + + virtual bool __do_upcast(const __class_type_info* __dst, const void* __obj, __upcast_result& __restrict __result) const; }; @@ -628,4 +623,4 @@ namespace __gnu_cxx #pragma GCC visibility pop -#endif // __CXXABI_H +#endif // __CXXABI_H diff --git a/libstdc++-v3/libsupc++/cxxabi-forced.h b/libstdc++-v3/libsupc++/cxxabi_forced.h similarity index 84% rename from libstdc++-v3/libsupc++/cxxabi-forced.h rename to libstdc++-v3/libsupc++/cxxabi_forced.h index 27ff34952e6..c45ce799d47 100644 --- a/libstdc++-v3/libsupc++/cxxabi-forced.h +++ b/libstdc++-v3/libsupc++/cxxabi_forced.h @@ -1,6 +1,6 @@ -// cxxabi.h subset for inclusion by other library headers -*- C++ -*- +// cxxabi.h subset for cancellation -*- C++ -*- -// Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc. // // This file is part of GCC. // @@ -23,8 +23,9 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -/** @file cxxabi-forced.h - * The header provides an interface to the C++ ABI. +/** @file bits/cxxabi_forced.h + * This is an internal header file, included by other library headers. + * Do not attempt to use it directly. @headername{cxxabi.h} */ #ifndef _CXXABI_FORCED_H diff --git a/libstdc++-v3/libsupc++/eh_aux_runtime.cc b/libstdc++-v3/libsupc++/eh_aux_runtime.cc index 579c2398601..c6abe354647 100644 --- a/libstdc++-v3/libsupc++/eh_aux_runtime.cc +++ b/libstdc++-v3/libsupc++/eh_aux_runtime.cc @@ -1,5 +1,5 @@ // -*- C++ -*- Common throw conditions. -// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2009 +// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2009, 2011 // Free Software Foundation // // This file is part of GCC. @@ -27,7 +27,7 @@ #include "exception" #include #include "unwind-cxx.h" -#include "exception_defines.h" +#include extern "C" void __cxxabiv1::__cxa_bad_cast () diff --git a/libstdc++-v3/libsupc++/eh_call.cc b/libstdc++-v3/libsupc++/eh_call.cc index 0054e52016d..f519f35f02a 100644 --- a/libstdc++-v3/libsupc++/eh_call.cc +++ b/libstdc++-v3/libsupc++/eh_call.cc @@ -1,5 +1,6 @@ // -*- C++ -*- Helpers for calling unextected and terminate -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +// 2011 // Free Software Foundation, Inc. // // This file is part of GCC. @@ -25,7 +26,7 @@ #include #include -#include +#include #include "unwind-cxx.h" using namespace __cxxabiv1; diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index 2b194f2e486..19c2044736b 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -1,5 +1,6 @@ // -*- C++ -*- The GNU C++ exception personality routine. -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +// 2011 // Free Software Foundation, Inc. // // This file is part of GCC. @@ -25,7 +26,7 @@ #include #include -#include +#include #include #include "unwind-cxx.h" diff --git a/libstdc++-v3/libsupc++/eh_ptr.cc b/libstdc++-v3/libsupc++/eh_ptr.cc index cf79062c353..94c28427d6d 100644 --- a/libstdc++-v3/libsupc++/eh_ptr.cc +++ b/libstdc++-v3/libsupc++/eh_ptr.cc @@ -29,7 +29,7 @@ #define _GLIBCXX_EH_PTR_COMPAT #include -#include +#include #include "unwind-cxx.h" using namespace __cxxabiv1; diff --git a/libstdc++-v3/libsupc++/eh_terminate.cc b/libstdc++-v3/libsupc++/eh_terminate.cc index f87f7b51d61..87359d09fdd 100644 --- a/libstdc++-v3/libsupc++/eh_terminate.cc +++ b/libstdc++-v3/libsupc++/eh_terminate.cc @@ -1,5 +1,6 @@ // -*- C++ -*- std::terminate, std::unexpected and friends. -// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009 +// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009, +// 2011 // Free Software Foundation // // This file is part of GCC. @@ -27,7 +28,7 @@ #include "exception" #include #include "unwind-cxx.h" -#include "exception_defines.h" +#include using namespace __cxxabiv1; diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception index 857b2022b2a..7f779f93c74 100644 --- a/libstdc++-v3/libsupc++/exception +++ b/libstdc++-v3/libsupc++/exception @@ -1,7 +1,7 @@ // Exception Handling support header for -*- C++ -*- // Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -// 2004, 2005, 2006, 2007, 2008, 2009, 2010 +// 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 // Free Software Foundation // // This file is part of GCC. @@ -148,8 +148,8 @@ _GLIBCXX_END_NAMESPACE #if (defined(__GXX_EXPERIMENTAL_CXX0X__) \ && defined(_GLIBCXX_ATOMIC_BUILTINS_4)) -#include -#include +#include +#include #endif #endif diff --git a/libstdc++-v3/libsupc++/exception_defines.h b/libstdc++-v3/libsupc++/exception_defines.h index 951d96f32f3..269937cff9d 100644 --- a/libstdc++-v3/libsupc++/exception_defines.h +++ b/libstdc++-v3/libsupc++/exception_defines.h @@ -1,6 +1,7 @@ // -fno-exceptions Support -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2006, 2007, 2008, 2009 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2006, 2007, 2008, 2009, +// 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -23,12 +24,9 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -// -// ISO C++ 14882: 19.1 Exception classes -// - -/** @file exception_defines.h - * This is a Standard C++ Library header. +/** @file bits/exception_defines.h + * This is an internal header file, included by other library headers. + * Do not attempt to use it directly. @headername{exception} */ #ifndef _EXCEPTION_DEFINES_H diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h index 312d61d443d..ef826f6bad0 100644 --- a/libstdc++-v3/libsupc++/exception_ptr.h +++ b/libstdc++-v3/libsupc++/exception_ptr.h @@ -1,6 +1,6 @@ // Exception Handling support header (exception_ptr class) for -*- C++ -*- -// Copyright (C) 2008, 2009, 2010 Free Software Foundation +// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation // // This file is part of GCC. // @@ -23,7 +23,7 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -/** @file exception_ptr.h +/** @file bits/exception_ptr.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{exception} */ @@ -34,7 +34,7 @@ #pragma GCC visibility push(default) #include -#include +#include #if !defined(_GLIBCXX_ATOMIC_BUILTINS_4) # error This platform does not support exception propagation. diff --git a/libstdc++-v3/libsupc++/hash_bytes.cc b/libstdc++-v3/libsupc++/hash_bytes.cc index a247a11492e..951f7bb1155 100644 --- a/libstdc++-v3/libsupc++/hash_bytes.cc +++ b/libstdc++-v3/libsupc++/hash_bytes.cc @@ -1,6 +1,6 @@ // Definition of _Hash_bytes. -*- C++ -*- -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -32,7 +32,7 @@ // function apears to be better in both speed and hash quality, and // FNV is provided primarily for backward compatibility. -#include +#include namespace { @@ -63,8 +63,8 @@ namespace #endif } -namespace std -{ +_GLIBCXX_BEGIN_NAMESPACE(std) + #if __SIZEOF_SIZE_T__ == 4 // Implementation of Murmur hash for 32-bit size_t. @@ -97,7 +97,7 @@ namespace std hash ^= static_cast(buf[1]) << 8; case 1: hash ^= static_cast(buf[0]); - hash *= m; + hash *= m; }; // Do a few final mixes of the hash. @@ -182,4 +182,5 @@ namespace std { return _Hash_bytes(ptr, len, seed); } #endif /* __SIZEOF_SIZE_T__ */ -} + +_GLIBCXX_END_NAMESPACE diff --git a/libstdc++-v3/libsupc++/hash_bytes.h b/libstdc++-v3/libsupc++/hash_bytes.h new file mode 100644 index 00000000000..95db644ee25 --- /dev/null +++ b/libstdc++-v3/libsupc++/hash_bytes.h @@ -0,0 +1,56 @@ +// Declarations for hash functions. -*- C++ -*- + +// Copyright (C) 2010, 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file bits/hash_bytes.h + * This is an internal header file, included by other library headers. + * Do not attempt to use it directly. @headername{functional} + */ + +#ifndef _HASH_BYTES_H +#define _HASH_BYTES_H 1 + +#pragma GCC system_header + +#include + +_GLIBCXX_BEGIN_NAMESPACE(std) + + // Hash function implementation for the nontrivial specialization. + // All of them are based on a primitive that hashes a pointer to a + // byte array. The actual hash algorithm is not guaranteed to stay + // the same from release to release -- it may be updated or tuned to + // improve hash quality or speed. + size_t + _Hash_bytes(const void* __ptr, size_t __len, size_t __seed); + + // A similar hash primitive, using the FNV hash algorithm. This + // algorithm is guaranteed to stay the same from release to release. + // (although it might not produce the same values on different + // machines.) + size_t + _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed); + +_GLIBCXX_END_NAMESPACE + +#endif diff --git a/libstdc++-v3/libsupc++/nested_exception.h b/libstdc++-v3/libsupc++/nested_exception.h index 1836b6e8335..799bd1979d7 100644 --- a/libstdc++-v3/libsupc++/nested_exception.h +++ b/libstdc++-v3/libsupc++/nested_exception.h @@ -1,6 +1,6 @@ // Nested Exception support header (nested_exception class) for -*- C++ -*- -// Copyright (C) 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -22,7 +22,7 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -/** @file nested_exception.h +/** @file bits/nested_exception.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{exception} */ diff --git a/libstdc++-v3/libsupc++/new_op.cc b/libstdc++-v3/libsupc++/new_op.cc index 4857c22f223..c61e941bcff 100644 --- a/libstdc++-v3/libsupc++/new_op.cc +++ b/libstdc++-v3/libsupc++/new_op.cc @@ -1,6 +1,6 @@ // Support routines for the -*- C++ -*- dynamic memory management. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2009 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2009, 2011 // Free Software Foundation // // This file is part of GCC. @@ -26,7 +26,7 @@ #include #include -#include +#include #include "new" using std::new_handler; diff --git a/libstdc++-v3/libsupc++/new_opnt.cc b/libstdc++-v3/libsupc++/new_opnt.cc index 075934d7b10..1bcdead5846 100644 --- a/libstdc++-v3/libsupc++/new_opnt.cc +++ b/libstdc++-v3/libsupc++/new_opnt.cc @@ -1,5 +1,5 @@ // Support routines for the -*- C++ -*- dynamic memory management. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2009 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2009, 2011 // Free Software Foundation // // This file is part of GCC. @@ -24,7 +24,7 @@ // . #include -#include +#include #include "new" using std::new_handler; diff --git a/libstdc++-v3/libsupc++/typeinfo b/libstdc++-v3/libsupc++/typeinfo index 8030eb40e2f..69311d69e9a 100644 --- a/libstdc++-v3/libsupc++/typeinfo +++ b/libstdc++-v3/libsupc++/typeinfo @@ -1,6 +1,6 @@ // RTTI support for -*- C++ -*- // Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -// 2003, 2004, 2005, 2006, 2007, 2009, 2010 +// 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 // Free Software Foundation // // This file is part of GCC. @@ -34,6 +34,10 @@ #pragma GCC system_header #include +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +#include +#endif + #pragma GCC visibility push(default) @@ -78,11 +82,6 @@ namespace __cxxabiv1 namespace std { -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - size_t - _Hash_bytes(const void* __ptr, size_t __len, size_t __seed); -#endif - /** * @brief Part of RTTI. * diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc index 286401cdf10..700c5ef431d 100644 --- a/libstdc++-v3/libsupc++/vec.cc +++ b/libstdc++-v3/libsupc++/vec.cc @@ -1,6 +1,7 @@ // New abi Support -*- C++ -*- -// Copyright (C) 2000, 2001, 2003, 2004, 2009 Free Software Foundation, Inc. +// Copyright (C) 2000, 2001, 2003, 2004, 2009, 2011 +// Free Software Foundation, Inc. // // This file is part of GCC. // @@ -28,7 +29,7 @@ #include #include #include -#include +#include #include "unwind-cxx.h" namespace __cxxabiv1 diff --git a/libstdc++-v3/libsupc++/vterminate.cc b/libstdc++-v3/libsupc++/vterminate.cc index 099ef180773..008d57846ef 100644 --- a/libstdc++-v3/libsupc++/vterminate.cc +++ b/libstdc++-v3/libsupc++/vterminate.cc @@ -1,6 +1,6 @@ // Verbose terminate_handler -*- C++ -*- -// Copyright (C) 2001, 2002, 2004, 2005, 2009 Free Software Foundation +// Copyright (C) 2001, 2002, 2004, 2005, 2009, 2011 Free Software Foundation // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -27,7 +27,7 @@ #if _GLIBCXX_HOSTED #include #include -#include +#include #include # include diff --git a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc index 7f8072427ca..b53dc40e5b4 100644 --- a/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc +++ b/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc @@ -3,7 +3,7 @@ // -*- C++ -*- -// Copyright (C) 2006, 2007, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -22,4 +22,4 @@ #include -// { dg-error "Cannot use -D_GLIBCXX_PROFILE with " "" { target *-*-* } 223 } +// { dg-error "Cannot use -D_GLIBCXX_PROFILE with " "" { target *-*-* } 220 } -- 2.11.0