libstdc++-v3-gcc-4.8.5

git-svn-id: svn://kolibrios.org@6325 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2016-03-12 09:38:51 +00:00
parent 3b53803119
commit d73a7e667d
68 changed files with 2581 additions and 3307 deletions

View File

@ -1,3 +1,384 @@
2015-06-23 Release Manager
* GCC 4.8.5 released.
2015-06-17 Matthias Klose <doko@ubuntu.com>
Backported from mainline
2015-06-01 Jonathan Wakely <jwakely@redhat.com>
* testsuite/lib/libstdc++.exp (libstdc++_init): Unset LANGUAGE
environment variable.
2015-06-04 Renlin Li <renlin.li@arm.com>
Backported from mainline
2015-06-02 Renlin Li <renlin.li@arm.com>
* testsuite/27_io/fpos/14775.cc: Add _GLIBCXX_HAVE_LIMIT_FSIZE check.
2015-03-25 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline
2015-03-02 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/65279
* include/std/scoped_allocator (__inner_type_impl,
scoped_allocator_adaptor): Add defaulted copy assignment and move
assignment operators.
* testsuite/20_util/scoped_allocator/65279.cc: New.
2015-03-25 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/65543
* include/std/istream (operator>>(basic_istream<>&&, _Tp&): Revert
thinko in r150387.
* include/std/ostream (operator<<(basic_ostream<>&&, const _Tp&):
Likewise.
* testsuite/27_io/rvalue_streams-2.cc: New.
2015-01-09 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60966
* include/std/future (packaged_task::operator()): Increment the
reference count on the shared state until the function returns.
2014-12-19 Release Manager
* GCC 4.8.4 released.
2014-12-06 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/63840
* include/std/functional (function::function(const function&)): Set
_M_manager after operations that might throw.
* include/tr1/functional (function::function(const function&),
function::function(_Functor, _Useless)): Likewise.
* testsuite/20_util/function/63840.cc: New.
* testsuite/tr1/3_function_objects/function/63840.cc: New.
PR libstdc++/61947
* include/std/tuple (_Head_base): Use allocator_arg_t parameters to
disambiguate unary constructors.
(_Tuple_impl): Pass allocator_arg_t arguments.
* testsuite/20_util/tuple/61947.cc: New.
* testsuite/20_util/uses_allocator/cons_neg.cc: Adjust dg-error line.
PR libstdc++/59603
* include/bits/stl_algo.h (random_shuffle): Prevent self-swapping.
* testsuite/25_algorithms/random_shuffle/59603.cc: New.
2014-11-27 Thomas Preud'homme <thomas.preudhomme@arm.com>
Backport from mainline
2014-09-10 Tony Wang <tony.wang@arm.com>
PR target/56846
* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION):
Return with CONTINUE_UNWINDING when the state pattern
contains: _US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND
2014-11-05 David Edelsohn <dje.gcc@gmail.com>
Backported from mainline.
2014-10-30 David Edelsohn <dje.gcc@gmail.com>
* configure.host (aix4.3+, 5+): Do not use -G in link command.
2014-10-15 Jason Merrill <jason@redhat.com>
* libsupc++/dyncast.cc (__dynamic_cast): Handle mid-destruction
dynamic_cast more gracefully.
2014-10-14 Kai Tietz <ktietz@redhat.com>
PR libstdc++/57440
* config/os/mingw32/os_defines.h (_GTHREAD_USE_MUTEX_INIT_FUNC):
Define to avoid leak.
* config/os/mingw32-w64/os_defines.h: Likewise.
2014-10-03 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/63449
* doc/xml/manual/containers.xml: Remove outdated section. Update
std::list notes.
* doc/html/*: Regenerate.
2014-10-01 Jonathan Wakely <jwakely@redhat.com>
* doc/xml/manual/status_cxx2011.xml: Corrections.
* doc/html/manual/status.html: Regenerate.
2014-08-28 Samuel Bronson <naesten@gmail.com>
Backport r212453 from trunk
2014-07-11 Samuel Bronson <naesten@gmail.com>
Matthias Klose <doko@ubuntu.com>
PR libstdc++/58962
* python/libstdcxx/v6/printers.py: Port to Python 2+3
(imap): New compat function.
(izip): Likewise.
(Iterator): New mixin to allow writing iterators in Python 3 style
regardless of which version we're running on.
[Python3] (long) New compat alias for "int".
* testsuite/lib/gdb-test.exp: Port to Python 2+3 (print syntax)
Backport r210625 from trunk
2014-05-19 Jonathan Wakely <jwakely@redhat.com>
* python/libstdcxx/v6/printers.py: Use Python3 raise syntax.
2014-08-26 John David Anglin <danglin@gcc.gnu.org>
* config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
2014-08-26 Jonathan Wakely <jwakely@redhat.com>
* doc/xml/manual/status_cxx2011.xml: Correct status table.
* doc/html/manual/*: Regenerate.
2014-08-04 Jonathan Wakely <jwakely@redhat.com>
Backported from mainline
2014-07-29 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/61946
* include/ext/rope (rope::rope(char_producer<_CharT>*, size_t, bool,
const allocator_type&)): Pass non-const allocator to
_S_new_RopeFunction.
* testsuite/ext/rope/61946.cc: New.
2014-08-04 Zifei Tong <zifeitong@gmail.com>
* libsupc++/atexit_thread.cc (HAVE___CXA_THREAD_ATEXIT_IMPL): Add
_GLIBCXX_ prefix to macro.
2014-06-03 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline
2014-04-15 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60734
* include/bits/stl_tree.h (_Rb_tree::_M_end): Fix invalid cast.
Backport from mainline
2014-05-16 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60966
* include/std/future (__future_base::_State_baseV2::_M_set_result):
Signal condition variable after call_once returns.
(__future_base::_State_baseV2::_M_do_set): Do not signal here.
(promise::set_value, promise::set_exception): Increment the reference
count on the shared state until the function returns.
* testsuite/30_threads/promise/60966.cc: New.
2014-05-29 Jonathan Wakely <jwakely@redhat.com>
* include/tr2/bool_set: Use UTF-8 for accented characters.
* scripts/run_doxygen: Handle Doxygen 1.8.x change.
2014-05-22 Release Manager
* GCC 4.8.3 released.
2014-05-08 Joshua Gay <jgay@gnu.org>
PR libstdc++/61117
* doc/xml/faq.xml (faq.license.what_restrictions): Replace "open
source" with "free software".
* doc/html/faq.html: Likewise.
2014-05-08 Jonathan Wakely <jwakely@redhat.com>
* include/std/iostream: Fix URL in comment.
* src/c++98/ios_init.cc: Fix path in comment.
2014-05-06 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline
2014-04-15 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60594
* include/std/functional (function::_Callable): Exclude own type
from the callable checks.
* testsuite/20_util/function/60594.cc: New.
2014-04-27 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60497
* include/std/tuple (get): Qualify calls to prevent ADL.
* testsuite/20_util/tuple/60497.cc: New.
2012-04-05 Dominique d'Humieres <dominiq@lps.ens.fr>
Jack Howarth <howarth@bromo.med.uc.edu>
PR target/54407
* 30_threads/condition_variable/54185.cc: Skip for darwin < 11.
2014-04-04 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Backport from mainline
2013-11-15 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* configure: Regenerate.
2014-04-04 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Backport from mainline r204808:
2013-11-14 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* scripts/extract_symvers.in: Ignore <localentry: > fields
in readelf --symbols output.
2014-03-26 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/59548
* include/debug/safe_unordered_base.h (_Safe_unordered_container_base):
Define copy and move constructors that handle iterators correctly.
* testsuite/23_containers/unordered_map/59548.cc: New.
2014-03-25 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60658
* include/bits/atomic_base.h (__atomic_base<_PTp*>::is_lock_free()):
Use sizeof pointer type not the element type.
* testsuite/29_atomics/atomic/60658.cc: New.
2014-03-18 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60564
* include/std/future (__future_base::_Task_state<>): Change
constructors to template functions using perfect forwarding.
(__create_task_state): Use decayed type as stored task.
(packaged_task::packaged_task(_Fn&&)): Forward instead of moving.
* testsuite/30_threads/packaged_task/60564.cc: New.
2014-03-12 Roland McGrath <mcgrathr@google.com>
Mark Seaborn <mseaborn@google.com>
PR libstdc++/59392
* libsupc++/eh_call.cc (__cxa_call_unexpected): Call __do_catch with
the address of a null pointer, not with a null pointer to pointer.
Copy comment for this case from eh_personality.cc:__cxa_call_unexpected.
* testsuite/18_support/bad_exception/59392.cc: New file.
2014-03-11 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline.
2014-01-09 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/59680
* src/c++11/thread.cc (__sleep_for): Fix call to ::sleep.
2014-03-11 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline.
2014-01-27 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/59215
* include/bits/shared_ptr_base.h
(_Sp_counted_base<_S_atomic>::_M_add_ref_lock()): Use relaxed atomic
load.
2014-03-11 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline.
2014-01-09 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/59738
* include/bits/stl_vector.h (vector<>::_M_move_assign): Restore
support for non-Movable types.
2014-01-08 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_vector.h (std::vector<>::_M_move_assign): Pass
*this allocator instance when building temporary vector instance
so that *this allocator does not get moved.
* testsuite/23_containers/vector/allocator/move.cc (test01): Add
check on a vector iterator.
* testsuite/23_containers/vector/allocator/move_assign.cc
(test02): Likewise.
(test03): New, test with a non-propagating allocator.
2013-11-15 Jonathan Wakely <jwakely.gcc@gmail.com>
* testsuite/23_containers/vector/allocator/move.cc: New
2014-01-27 Jason Merrill <jason@redhat.com>
Core DR 475
PR c++/41174
PR c++/59224
* libsupc++/eh_throw.cc (__cxa_throw): Set uncaughtExceptions.
* libsupc++/eh_alloc.cc (__cxa_allocate_dependent_exception)
(__cxa_allocate_exception): Don't set it here.
2013-12-15 H.J. Lu <hongjiu.lu@intel.com>
* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Update.
2013-11-22 Jonathan Wakely <jwakely.gcc@gmail.com>
* acinclude.m4 (libtool_VERSION): Bump.
* configure: Regenerate.
* doc/xml/manual/abi.xml: Update version information.
2013-11-05 Jonathan Wakely <jwakely.gcc@gmail.com>
* doc/xml/manual/status_cxx2011.xml: Document aligned_union as
missing.
* doc/xml/manual/spine.xml: Update copyright years.
* doc/html/*: Regenerate.
2013-11-01 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/58952
* include/c_global/cstdio: Undef getchar.
2013-10-31 Jonathan Wakely <jwakely.gcc@gmail.com>
* testsuite/20_util/shared_ptr/cons/58839.cc: Do not use
default_delete<void>.
2013-10-30 Chris Studholme <cvs@cs.utoronto.ca>
PR libstdc++/58912
* include/bits/shared_ptr_base.h (_Sp_counted_ptr_inplace): Remove
unnecessary initialization of storage buffer.
2013-10-29 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/58839
* include/bits/shared_ptr_base.h
(__shared_ptr<T>::__shared_ptr(unique_ptr<U,D>&&)): Do not dereference
pointer.
* testsuite/20_util/shared_ptr/cons/58839.cc: New.
2013-10-20 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/58800
* include/bits/stl_algo.h (__unguarded_partition_pivot): Change
__last - 2 to __last - 1.
* testsuite/25_algorithms/nth_element/58800.cc: New
2013-10-16 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/58191
* include/debug/macros.h (__glibcxx_check_partitioned_lower): Add
__gnu_debug::__base calls on iterators passed to internal debug
check.
(__glibcxx_check_partitioned_lower_pred): Likewise.
(__glibcxx_check_partitioned_upper): Likewise.
(__glibcxx_check_partitioned_upper_pred): Likewise.
* include/debug/functions.h (__check_partitioned_lower):
Remove code to detect safe iterators.
(__check_partitioned_upper): Likewise.
2013-10-16 Release Manager 2013-10-16 Release Manager
* GCC 4.8.2 released. * GCC 4.8.2 released.

View File

@ -7,6 +7,7 @@ CPP= kos32-g++
STRIP = kos32-strip STRIP = kos32-strip
CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fno-ident -fomit-frame-pointer -ffunction-sections -fdata-sections CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fno-ident -fomit-frame-pointer -ffunction-sections -fdata-sections
CFLAGS+= -fno-rtti -fno-exceptions
ARFLAGS= crs ARFLAGS= crs

View File

@ -444,7 +444,7 @@
/* #undef HAVE_TGMATH_H */ /* #undef HAVE_TGMATH_H */
/* Define to 1 if the target supports thread-local storage. */ /* Define to 1 if the target supports thread-local storage. */
/* #undef HAVE_TLS */ #define HAVE_TLS 1
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1

File diff suppressed because it is too large Load Diff

View File

@ -764,11 +764,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool bool
is_lock_free() const noexcept is_lock_free() const noexcept
{ return __atomic_is_lock_free(_M_type_size(1), nullptr); } { return __atomic_is_lock_free(sizeof(__pointer_type), nullptr); }
bool bool
is_lock_free() const volatile noexcept is_lock_free() const volatile noexcept
{ return __atomic_is_lock_free(_M_type_size(1), nullptr); } { return __atomic_is_lock_free(sizeof(__pointer_type), nullptr); }
void void
store(__pointer_type __p, store(__pointer_type __p,

View File

@ -233,7 +233,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_add_ref_lock() _M_add_ref_lock()
{ {
// Perform lock-free add-if-not-zero operation. // Perform lock-free add-if-not-zero operation.
_Atomic_word __count = _M_use_count; _Atomic_word __count = _M_get_use_count();
do do
{ {
if (__count == 0) if (__count == 0)
@ -391,7 +391,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
public: public:
template<typename... _Args> template<typename... _Args>
_Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args) _Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args)
: _M_impl(__a), _M_storage() : _M_impl(__a)
{ {
_M_impl._M_ptr = static_cast<_Tp*>(static_cast<void*>(&_M_storage)); _M_impl._M_ptr = static_cast<_Tp*>(static_cast<void*>(&_M_storage));
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
@ -819,7 +819,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: _M_ptr(__r.get()), _M_refcount() : _M_ptr(__r.get()), _M_refcount()
{ {
__glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
auto __tmp = std::__addressof(*__r.get()); auto __tmp = __r.get();
_M_refcount = __shared_count<_Lp>(std::move(__r)); _M_refcount = __shared_count<_Lp>(std::move(__r));
__enable_shared_from_this_helper(_M_refcount, __tmp, __tmp); __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
} }

View File

@ -2279,7 +2279,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_RandomAccessIterator __last) _RandomAccessIterator __last)
{ {
_RandomAccessIterator __mid = __first + (__last - __first) / 2; _RandomAccessIterator __mid = __first + (__last - __first) / 2;
std::__move_median_to_first(__first, __first + 1, __mid, (__last - 2)); std::__move_median_to_first(__first, __first + 1, __mid, __last - 1);
return std::__unguarded_partition(__first + 1, __last, *__first); return std::__unguarded_partition(__first + 1, __last, *__first);
} }
@ -2291,7 +2291,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_RandomAccessIterator __last, _Compare __comp) _RandomAccessIterator __last, _Compare __comp)
{ {
_RandomAccessIterator __mid = __first + (__last - __first) / 2; _RandomAccessIterator __mid = __first + (__last - __first) / 2;
std::__move_median_to_first(__first, __first + 1, __mid, (__last - 2), std::__move_median_to_first(__first, __first + 1, __mid, __last - 1,
__comp); __comp);
return std::__unguarded_partition(__first + 1, __last, *__first, __comp); return std::__unguarded_partition(__first + 1, __last, *__first, __comp);
} }
@ -5193,7 +5193,12 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
if (__first != __last) if (__first != __last)
for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1))); {
_RandomAccessIterator __j = __first
+ std::rand() % ((__i - __first) + 1);
if (__i != __j)
std::iter_swap(__i, __j);
}
} }
/** /**
@ -5227,7 +5232,11 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
if (__first == __last) if (__first == __last)
return; return;
for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
std::iter_swap(__i, __first + __rand((__i - __first) + 1)); {
_RandomAccessIterator __j = __first + __rand((__i - __first) + 1);
if (__i != __j)
std::iter_swap(__i, __j);
}
} }

View File

@ -510,11 +510,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Link_type _Link_type
_M_end() _M_end()
{ return static_cast<_Link_type>(&this->_M_impl._M_header); } { return reinterpret_cast<_Link_type>(&this->_M_impl._M_header); }
_Const_Link_type _Const_Link_type
_M_end() const _M_end() const
{ return static_cast<_Const_Link_type>(&this->_M_impl._M_header); } { return reinterpret_cast<_Const_Link_type>(&this->_M_impl._M_header); }
static const_reference static const_reference
_S_value(_Const_Link_type __x) _S_value(_Const_Link_type __x)

View File

@ -1361,7 +1361,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
void void
_M_move_assign(vector&& __x, std::true_type) noexcept _M_move_assign(vector&& __x, std::true_type) noexcept
{ {
const vector __tmp(std::move(*this)); vector __tmp(get_allocator());
this->_M_impl._M_swap_data(__tmp._M_impl);
this->_M_impl._M_swap_data(__x._M_impl); this->_M_impl._M_swap_data(__x._M_impl);
if (_Alloc_traits::_S_propagate_on_move_assign()) if (_Alloc_traits::_S_propagate_on_move_assign())
std::__alloc_on_move(_M_get_Tp_allocator(), std::__alloc_on_move(_M_get_Tp_allocator(),

View File

@ -69,6 +69,7 @@ extern "C" char* gets (char* __s) __attribute__((deprecated));
#undef ftell #undef ftell
#undef fwrite #undef fwrite
#undef getc #undef getc
#undef getchar
#undef gets #undef gets
#undef perror #undef perror
#undef printf #undef printf

View File

@ -0,0 +1,700 @@
// ABI Support -*- C++ -*-
// Copyright (C) 2000-2013 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
// GCC 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.
//
// 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.
// 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
// <http://www.gnu.org/licenses/>.
// Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
/* 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. */
/** @file cxxabi.h
* The header provides an interface to the C++ ABI.
*/
#ifndef _CXXABI_H
#define _CXXABI_H 1
#pragma GCC system_header
#pragma GCC visibility push(default)
#include <stddef.h>
#include <bits/c++config.h>
#include <bits/cxxabi_tweaks.h>
#include <bits/cxxabi_forced.h>
#ifndef _GLIBCXX_CDTOR_CALLABI
#define _GLIBCXX_CDTOR_CALLABI
#endif
#ifdef __cplusplus
namespace __cxxabiv1
{
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,
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),
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),
void (*__dealloc) (void*, size_t));
// Construct array.
__cxa_vec_ctor_return_type
__cxa_vec_ctor(void* __array_address, size_t __element_count,
size_t __element_size, __cxa_cdtor_type __constructor,
__cxa_cdtor_type __destructor);
__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*),
__cxa_cdtor_type __destructor);
// Destruct array.
void
__cxa_vec_dtor(void* __array_address, size_t __element_count,
size_t __element_size, __cxa_cdtor_type __destructor);
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
__cxa_vec_delete(void* __array_address, size_t __element_size,
size_t __padding_size, __cxa_cdtor_type __destructor);
void
__cxa_vec_delete2(void* __array_address, size_t __element_size,
size_t __padding_size, __cxa_cdtor_type __destructor,
void (*__dealloc) (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
__cxa_guard_acquire(__guard*);
void
__cxa_guard_release(__guard*) _GLIBCXX_NOTHROW;
void
__cxa_guard_abort(__guard*) _GLIBCXX_NOTHROW;
// DSO destruction.
int
__cxa_atexit(void (*)(void*), void*, void*) _GLIBCXX_NOTHROW;
int
__cxa_finalize(void*);
// TLS destruction.
int
__cxa_thread_atexit(void (*)(void*), void*, void *) _GLIBCXX_NOTHROW;
// Pure virtual functions.
void
__cxa_pure_virtual(void) __attribute__ ((__noreturn__));
void
__cxa_deleted_virtual(void) __attribute__ ((__noreturn__));
// Exception handling auxillary.
void
__cxa_bad_cast() __attribute__((__noreturn__));
void
__cxa_bad_typeid() __attribute__((__noreturn__));
/**
* @brief Demangling routine.
* ABI-mandated entry point in the C++ runtime library for demangling.
*
* @param __mangled_name A NUL-terminated character string
* containing the name to be demangled.
*
* @param __output_buffer A region of memory, allocated with
* malloc, of @a *__length bytes, into which the demangled name is
* stored. If @a __output_buffer is not long enough, it is
* expanded using realloc. @a __output_buffer may instead be NULL;
* in that case, the demangled name is placed in a region of memory
* allocated with malloc.
*
* @param __length If @a __length is non-NULL, the length of the
* buffer containing the demangled name is placed in @a *__length.
*
* @param __status @a *__status is set to one of the following values:
* 0: The demangling operation succeeded.
* -1: A memory allocation failure occurred.
* -2: @a mangled_name is not a valid name under the C++ ABI mangling rules.
* -3: One of the arguments is invalid.
*
* @return A pointer to the start of the NUL-terminated demangled
* name, or NULL if the demangling fails. The caller is
* responsible for deallocating this memory using @c free.
*
* 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.
*
* @note The same demangling functionality is available via
* libiberty (@c <libiberty/demangle.h> and @c libiberty.a) in GCC
* 3.1 and later, but that requires explicit installation (@c
* --enable-install-libiberty) and uses a different API, although
* the ABI is unchanged.
*/
char*
__cxa_demangle(const char* __mangled_name, char* __output_buffer,
size_t* __length, int* __status);
#ifdef __cplusplus
}
} // namespace __cxxabiv1
#endif
#ifdef __cplusplus
#include <typeinfo>
namespace __cxxabiv1
{
// Type information for int, float etc.
class __fundamental_type_info : public std::type_info
{
public:
explicit
__fundamental_type_info(const char* __n) : std::type_info(__n) { }
virtual
~__fundamental_type_info();
};
// Type information for array objects.
class __array_type_info : public std::type_info
{
public:
explicit
__array_type_info(const char* __n) : std::type_info(__n) { }
virtual
~__array_type_info();
};
// Type information for functions (both member and non-member).
class __function_type_info : public std::type_info
{
public:
explicit
__function_type_info(const char* __n) : std::type_info(__n) { }
virtual
~__function_type_info();
protected:
// Implementation defined member function.
virtual bool
__is_function_p() const;
};
// Type information for enumerations.
class __enum_type_info : public std::type_info
{
public:
explicit
__enum_type_info(const char* __n) : std::type_info(__n) { }
virtual
~__enum_type_info();
};
// Common type information for simple pointers and pointers to member.
class __pbase_type_info : public std::type_info
{
public:
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,
const std::type_info* __type)
: std::type_info(__n), __flags(__quals), __pointee(__type)
{ }
virtual
~__pbase_type_info();
// Implementation defined type.
enum __masks
{
__const_mask = 0x1,
__volatile_mask = 0x2,
__restrict_mask = 0x4,
__incomplete_mask = 0x8,
__incomplete_class_mask = 0x10
};
protected:
__pbase_type_info(const __pbase_type_info&);
__pbase_type_info&
operator=(const __pbase_type_info&);
// Implementation defined member functions.
virtual bool
__do_catch(const std::type_info* __thr_type, void** __thr_obj,
unsigned int __outer) const;
inline virtual bool
__pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
unsigned __outer) const;
};
// Type information for simple pointers.
class __pointer_type_info : public __pbase_type_info
{
public:
explicit
__pointer_type_info(const char* __n, int __quals,
const std::type_info* __type)
: __pbase_type_info (__n, __quals, __type) { }
virtual
~__pointer_type_info();
protected:
// Implementation defined member functions.
virtual bool
__is_pointer_p() const;
virtual bool
__pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
unsigned __outer) const;
};
class __class_type_info;
// Type information for a pointer to member variable.
class __pointer_to_member_type_info : public __pbase_type_info
{
public:
__class_type_info* __context; // Class of the member.
explicit
__pointer_to_member_type_info(const char* __n, int __quals,
const std::type_info* __type,
__class_type_info* __klass)
: __pbase_type_info(__n, __quals, __type), __context(__klass) { }
virtual
~__pointer_to_member_type_info();
protected:
__pointer_to_member_type_info(const __pointer_to_member_type_info&);
__pointer_to_member_type_info&
operator=(const __pointer_to_member_type_info&);
// Implementation defined member function.
virtual bool
__pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
unsigned __outer) const;
};
// Helper class for __vmi_class_type.
class __base_class_type_info
{
public:
const __class_type_info* __base_type; // Base class type.
#ifdef _GLIBCXX_LLP64
long long __offset_flags; // Offset and info.
#else
long __offset_flags; // Offset and info.
#endif
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
__is_virtual_p() const
{ return __offset_flags & __virtual_mask; }
bool
__is_public_p() const
{ return __offset_flags & __public_mask; }
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.
return static_cast<ptrdiff_t>(__offset_flags) >> __offset_shift;
}
};
// Type information for a class.
class __class_type_info : public std::type_info
{
public:
explicit
__class_type_info (const char *__n) : type_info(__n) { }
virtual
~__class_type_info ();
// Implementation defined types.
// The type sub_kind tells us about how a base object is contained
// within a derived object. We often do this lazily, hence the
// UNKNOWN value. At other times we may use NOT_CONTAINED to mean
// not publicly contained.
enum __sub_kind
{
// We have no idea.
__unknown = 0,
// Not contained within us (in some circumstances this might
// mean not contained publicly)
__not_contained,
// Contained ambiguously.
__contained_ambig,
// Via a virtual path.
__contained_virtual_mask = __base_class_type_info::__virtual_mask,
// Via a public path.
__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
};
struct __upcast_result;
struct __dyncast_result;
protected:
// Implementation defined member functions.
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,
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
__do_upcast(const __class_type_info* __dst, const void* __obj,
__upcast_result& __restrict __result) const;
// Indicate whether SRC_PTR of type SRC_TYPE is contained publicly
// within OBJ_PTR. OBJ_PTR points to a base object of our type,
// which is the destination type. SRC2DST indicates how SRC
// 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
__find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
const __class_type_info* __src_type,
const void* __src_ptr) const;
// Helper for dynamic cast. ACCESS_PATH gives the access from the
// most derived object to this base. DST_TYPE indicates the
// desired type we want. OBJ_PTR points to a base of our type
// within the complete object. SRC_TYPE indicates the static type
// 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
__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;
// 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
__do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
const __class_type_info* __src_type,
const void* __src_ptr) const;
};
// Type information for a class with a single non-virtual base.
class __si_class_type_info : public __class_type_info
{
public:
const __class_type_info* __base_type;
explicit
__si_class_type_info(const char *__n, const __class_type_info *__base)
: __class_type_info(__n), __base_type(__base) { }
virtual
~__si_class_type_info();
protected:
__si_class_type_info(const __si_class_type_info&);
__si_class_type_info&
operator=(const __si_class_type_info&);
// Implementation defined member functions.
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,
const __class_type_info* __src_type,
const void* __sub_ptr) const;
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
{
public:
unsigned int __flags; // Details about the class hierarchy.
unsigned int __base_count; // Number of direct bases.
// The array of bases uses the trailing array struct hack so this
// class is not constructable with a normal constructor. It is
// internally generated by the compiler.
__base_class_type_info __base_info[1]; // Array of bases.
explicit
__vmi_class_type_info(const char* __n, int ___flags)
: __class_type_info(__n), __flags(___flags), __base_count(0) { }
virtual
~__vmi_class_type_info();
// Implementation defined types.
enum __flags_masks
{
__non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base.
__diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance.
__flags_unknown_mask = 0x10
};
protected:
// Implementation defined member functions.
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,
const __class_type_info* __src_type,
const void* __src_ptr) const;
virtual bool
__do_upcast(const __class_type_info* __dst, const void* __obj,
__upcast_result& __restrict __result) const;
};
// Exception handling forward declarations.
struct __cxa_exception;
struct __cxa_refcounted_exception;
struct __cxa_dependent_exception;
struct __cxa_eh_globals;
extern "C"
{
// Dynamic cast runtime.
// src2dst has the following possible values
// >-1: src_type is a unique public non-virtual base of dst_type
// dst_ptr + src2dst == src_ptr
// -1: unspecified relationship
// -2: src_type is not a public base of dst_type
// -3: src_type is a multiple public non-virtual base of dst_type
void*
__dynamic_cast(const void* __src_ptr, // Starting object.
const __class_type_info* __src_type, // Static type of object.
const __class_type_info* __dst_type, // Desired target type.
ptrdiff_t __src2dst); // How src and dst are related.
// Exception handling runtime.
// The __cxa_eh_globals for the current thread can be obtained by using
// either of the following functions. The "fast" version assumes at least
// one prior call of __cxa_get_globals has been made from the current
// thread, so no initialization is necessary.
__cxa_eh_globals*
__cxa_get_globals() _GLIBCXX_NOTHROW __attribute__ ((__const__));
__cxa_eh_globals*
__cxa_get_globals_fast() _GLIBCXX_NOTHROW __attribute__ ((__const__));
// Allocate memory for the primary exception plus the thrown object.
void*
__cxa_allocate_exception(size_t) _GLIBCXX_NOTHROW;
// Free the space allocated for the primary exception.
void
__cxa_free_exception(void*) _GLIBCXX_NOTHROW;
// Throw the exception.
void
__cxa_throw(void*, std::type_info*, void (_GLIBCXX_CDTOR_CALLABI *) (void *))
__attribute__((__noreturn__));
// Used to implement exception handlers.
void*
__cxa_get_exception_ptr(void*) _GLIBCXX_NOTHROW __attribute__ ((__pure__));
void*
__cxa_begin_catch(void*) _GLIBCXX_NOTHROW;
void
__cxa_end_catch();
void
__cxa_rethrow() __attribute__((__noreturn__));
// Returns the type_info for the currently handled exception [15.3/8], or
// null if there is none.
std::type_info*
__cxa_current_exception_type() _GLIBCXX_NOTHROW __attribute__ ((__pure__));
// GNU Extensions.
// Allocate memory for a dependent exception.
__cxa_dependent_exception*
__cxa_allocate_dependent_exception() _GLIBCXX_NOTHROW;
// Free the space allocated for the dependent exception.
void
__cxa_free_dependent_exception(__cxa_dependent_exception*) _GLIBCXX_NOTHROW;
} // extern "C"
// A magic placeholder class that can be caught by reference
// to recognize foreign exceptions.
class __foreign_exception
{
virtual ~__foreign_exception() throw();
virtual void __pure_dummy() = 0; // prevent catch by value
};
} // namespace __cxxabiv1
/** @namespace abi
* @brief The cross-vendor C++ Application Binary Interface. A
* namespace alias to __cxxabiv1, but user programs should use the
* alias 'abi'.
*
* A brief overview of an ABI is given in the libstdc++ FAQ, question
* 5.8 (you may have a copy of the FAQ locally, or you can view the online
* version at http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#5_8 ).
*
* GCC subscribes to a cross-vendor ABI for C++, sometimes
* called the IA64 ABI because it happens to be the native ABI for that
* platform. It is summarized at http://www.codesourcery.com/cxx-abi/
* along with the current specification.
*
* For users of GCC greater than or equal to 3.x, entry points are
* available in <cxxabi.h>, which notes, <em>'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.'</em>
*/
namespace abi = __cxxabiv1;
namespace __gnu_cxx
{
/**
* @brief Exception thrown by __cxa_guard_acquire.
* @ingroup exceptions
*
* 6.7[stmt.dcl]/4: If control re-enters the declaration (recursively)
* while the object is being initialized, the behavior is undefined.
*
* Since we already have a library function to handle locking, we might
* as well check for this situation and throw an exception.
* We use the second byte of the guard variable to remember that we're
* in the middle of an initialization.
*/
class recursive_init_error: public std::exception
{
public:
recursive_init_error() throw() { }
virtual ~recursive_init_error() throw ();
};
}
#endif // __cplusplus
#pragma GCC visibility pop
#endif // __CXXABI_H

View File

@ -345,11 +345,13 @@ namespace __gnu_debug
return __check_sorted_set_aux(__first, __last, __pred, _SameType()); return __check_sorted_set_aux(__first, __last, __pred, _SameType());
} }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 270. Binary search requirements overly strict
// Determine if a sequence is partitioned w.r.t. this element.
template<typename _ForwardIterator, typename _Tp> template<typename _ForwardIterator, typename _Tp>
inline bool inline bool
__check_partitioned_lower_aux(_ForwardIterator __first, __check_partitioned_lower(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value, _ForwardIterator __last, const _Tp& __value)
std::forward_iterator_tag)
{ {
while (__first != __last && *__first < __value) while (__first != __last && *__first < __value)
++__first; ++__first;
@ -362,37 +364,10 @@ namespace __gnu_debug
return __first == __last; return __first == __last;
} }
// For performance reason, as the iterator range has been validated, check on
// random access safe iterators is done using the base iterator.
template<typename _Iterator, typename _Sequence, typename _Tp>
inline bool
__check_partitioned_lower_aux(
const _Safe_iterator<_Iterator, _Sequence>& __first,
const _Safe_iterator<_Iterator, _Sequence>& __last,
const _Tp& __value,
std::random_access_iterator_tag __tag)
{
return __check_partitioned_lower_aux(__first.base(), __last.base(),
__value, __tag);
}
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 270. Binary search requirements overly strict
// Determine if a sequence is partitioned w.r.t. this element.
template<typename _ForwardIterator, typename _Tp> template<typename _ForwardIterator, typename _Tp>
inline bool inline bool
__check_partitioned_lower(_ForwardIterator __first, __check_partitioned_upper(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value) _ForwardIterator __last, const _Tp& __value)
{
return __check_partitioned_lower_aux(__first, __last, __value,
std::__iterator_category(__first));
}
template<typename _ForwardIterator, typename _Tp>
inline bool
__check_partitioned_upper_aux(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value,
std::forward_iterator_tag)
{ {
while (__first != __last && !(__value < *__first)) while (__first != __last && !(__value < *__first))
++__first; ++__first;
@ -405,35 +380,12 @@ namespace __gnu_debug
return __first == __last; return __first == __last;
} }
// For performance reason, as the iterator range has been validated, check on // Determine if a sequence is partitioned w.r.t. this element.
// random access safe iterators is done using the base iterator.
template<typename _Iterator, typename _Sequence, typename _Tp>
inline bool
__check_partitioned_upper_aux(
const _Safe_iterator<_Iterator, _Sequence>& __first,
const _Safe_iterator<_Iterator, _Sequence>& __last,
const _Tp& __value,
std::random_access_iterator_tag __tag)
{
return __check_partitioned_upper_aux(__first.base(), __last.base(),
__value, __tag);
}
template<typename _ForwardIterator, typename _Tp>
inline bool
__check_partitioned_upper(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value)
{
return __check_partitioned_upper_aux(__first, __last, __value,
std::__iterator_category(__first));
}
template<typename _ForwardIterator, typename _Tp, typename _Pred> template<typename _ForwardIterator, typename _Tp, typename _Pred>
inline bool inline bool
__check_partitioned_lower_aux(_ForwardIterator __first, __check_partitioned_lower(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value, _ForwardIterator __last, const _Tp& __value,
_Pred __pred, _Pred __pred)
std::forward_iterator_tag)
{ {
while (__first != __last && bool(__pred(*__first, __value))) while (__first != __last && bool(__pred(*__first, __value)))
++__first; ++__first;
@ -446,38 +398,11 @@ namespace __gnu_debug
return __first == __last; return __first == __last;
} }
// For performance reason, as the iterator range has been validated, check on
// random access safe iterators is done using the base iterator.
template<typename _Iterator, typename _Sequence,
typename _Tp, typename _Pred>
inline bool
__check_partitioned_lower_aux(
const _Safe_iterator<_Iterator, _Sequence>& __first,
const _Safe_iterator<_Iterator, _Sequence>& __last,
const _Tp& __value, _Pred __pred,
std::random_access_iterator_tag __tag)
{
return __check_partitioned_lower_aux(__first.base(), __last.base(),
__value, __pred, __tag);
}
// Determine if a sequence is partitioned w.r.t. this element.
template<typename _ForwardIterator, typename _Tp, typename _Pred> template<typename _ForwardIterator, typename _Tp, typename _Pred>
inline bool inline bool
__check_partitioned_lower(_ForwardIterator __first, __check_partitioned_upper(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value, _ForwardIterator __last, const _Tp& __value,
_Pred __pred) _Pred __pred)
{
return __check_partitioned_lower_aux(__first, __last, __value, __pred,
std::__iterator_category(__first));
}
template<typename _ForwardIterator, typename _Tp, typename _Pred>
inline bool
__check_partitioned_upper_aux(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value,
_Pred __pred,
std::forward_iterator_tag)
{ {
while (__first != __last && !bool(__pred(__value, *__first))) while (__first != __last && !bool(__pred(__value, *__first)))
++__first; ++__first;
@ -490,31 +415,6 @@ namespace __gnu_debug
return __first == __last; return __first == __last;
} }
// For performance reason, as the iterator range has been validated, check on
// random access safe iterators is done using the base iterator.
template<typename _Iterator, typename _Sequence,
typename _Tp, typename _Pred>
inline bool
__check_partitioned_upper_aux(
const _Safe_iterator<_Iterator, _Sequence>& __first,
const _Safe_iterator<_Iterator, _Sequence>& __last,
const _Tp& __value, _Pred __pred,
std::random_access_iterator_tag __tag)
{
return __check_partitioned_upper_aux(__first.base(), __last.base(),
__value, __pred, __tag);
}
template<typename _ForwardIterator, typename _Tp, typename _Pred>
inline bool
__check_partitioned_upper(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value,
_Pred __pred)
{
return __check_partitioned_upper_aux(__first, __last, __value, __pred,
std::__iterator_category(__first));
}
// Helper struct to detect random access safe iterators. // Helper struct to detect random access safe iterators.
template<typename _Iterator> template<typename _Iterator>
struct __is_safe_random_iterator struct __is_safe_random_iterator

View File

@ -261,8 +261,9 @@ _GLIBCXX_DEBUG_VERIFY( \
w.r.t. the value _Value. */ w.r.t. the value _Value. */
#define __glibcxx_check_partitioned_lower(_First,_Last,_Value) \ #define __glibcxx_check_partitioned_lower(_First,_Last,_Value) \
__glibcxx_check_valid_range(_First,_Last); \ __glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower(_First, _Last, \ _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower( \
_Value), \ __gnu_debug::__base(_First), \
__gnu_debug::__base(_Last), _Value), \
_M_message(__gnu_debug::__msg_unpartitioned) \ _M_message(__gnu_debug::__msg_unpartitioned) \
._M_iterator(_First, #_First) \ ._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \ ._M_iterator(_Last, #_Last) \
@ -270,8 +271,9 @@ _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower(_First, _Last, \
#define __glibcxx_check_partitioned_upper(_First,_Last,_Value) \ #define __glibcxx_check_partitioned_upper(_First,_Last,_Value) \
__glibcxx_check_valid_range(_First,_Last); \ __glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(_First, _Last, \ _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper( \
_Value), \ __gnu_debug::__base(_First), \
__gnu_debug::__base(_Last), _Value), \
_M_message(__gnu_debug::__msg_unpartitioned) \ _M_message(__gnu_debug::__msg_unpartitioned) \
._M_iterator(_First, #_First) \ ._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \ ._M_iterator(_Last, #_Last) \
@ -281,8 +283,9 @@ _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(_First, _Last, \
w.r.t. the value _Value and predicate _Pred. */ w.r.t. the value _Value and predicate _Pred. */
#define __glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred) \ #define __glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred) \
__glibcxx_check_valid_range(_First,_Last); \ __glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower(_First, _Last, \ _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower( \
_Value, _Pred), \ __gnu_debug::__base(_First), \
__gnu_debug::__base(_Last), _Value, _Pred), \
_M_message(__gnu_debug::__msg_unpartitioned_pred) \ _M_message(__gnu_debug::__msg_unpartitioned_pred) \
._M_iterator(_First, #_First) \ ._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \ ._M_iterator(_Last, #_Last) \
@ -293,8 +296,9 @@ _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower(_First, _Last, \
w.r.t. the value _Value and predicate _Pred. */ w.r.t. the value _Value and predicate _Pred. */
#define __glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred) \ #define __glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred) \
__glibcxx_check_valid_range(_First,_Last); \ __glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(_First, _Last, \ _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper( \
_Value, _Pred), \ __gnu_debug::__base(_First), \
__gnu_debug::__base(_Last), _Value, _Pred), \
_M_message(__gnu_debug::__msg_unpartitioned_pred) \ _M_message(__gnu_debug::__msg_unpartitioned_pred) \
._M_iterator(_First, #_First) \ ._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \ ._M_iterator(_Last, #_Last) \

View File

@ -133,9 +133,19 @@ namespace __gnu_debug
protected: protected:
// Initialize with a version number of 1 and no iterators // Initialize with a version number of 1 and no iterators
_Safe_unordered_container_base() _Safe_unordered_container_base()
: _M_local_iterators(0), _M_const_local_iterators(0) : _M_local_iterators(nullptr), _M_const_local_iterators(nullptr)
{ } { }
// Initialize with a version number of 1 and no iterators
_Safe_unordered_container_base(const _Safe_unordered_container_base&)
noexcept
: _Safe_unordered_container_base() { }
_Safe_unordered_container_base(_Safe_unordered_container_base&& __x)
noexcept
: _Safe_unordered_container_base()
{ this->_M_swap(__x); }
/** Notify all iterators that reference this container that the /** Notify all iterators that reference this container that the
container is being destroyed. */ container is being destroyed. */
~_Safe_unordered_container_base() ~_Safe_unordered_container_base()

View File

@ -0,0 +1,156 @@
// Exception Handling support header for -*- C++ -*-
// Copyright (C) 1995-2013 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
// GCC 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.
//
// 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.
// 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
// <http://www.gnu.org/licenses/>.
/** @file exception
* This is a Standard C++ Library header.
*/
#ifndef __EXCEPTION__
#define __EXCEPTION__
#pragma GCC system_header
#pragma GCC visibility push(default)
#include <bits/c++config.h>
#include <bits/atomic_lockfree_defines.h>
extern "C++" {
namespace std
{
/**
* @defgroup exceptions Exceptions
* @ingroup diagnostics
*
* Classes and functions for reporting errors via exception classes.
* @{
*/
/**
* @brief Base class for all library exceptions.
*
* This is the base class for all exceptions thrown by the standard
* library, and by certain language expressions. You are free to derive
* your own %exception classes, or use a different hierarchy, or to
* throw non-class data (e.g., fundamental types).
*/
class exception
{
public:
exception() _GLIBCXX_USE_NOEXCEPT { }
virtual ~exception() _GLIBCXX_USE_NOEXCEPT;
/** Returns a C-style character string describing the general cause
* of the current error. */
virtual const char* what() const _GLIBCXX_USE_NOEXCEPT;
};
/** If an %exception is thrown which is not listed in a function's
* %exception specification, one of these may be thrown. */
class bad_exception : public exception
{
public:
bad_exception() _GLIBCXX_USE_NOEXCEPT { }
// This declaration is not useless:
// http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
virtual ~bad_exception() _GLIBCXX_USE_NOEXCEPT;
// See comment in eh_exception.cc.
virtual const char* what() const _GLIBCXX_USE_NOEXCEPT;
};
/// If you write a replacement %terminate handler, it must be of this type.
typedef void (*terminate_handler) ();
/// If you write a replacement %unexpected handler, it must be of this type.
typedef void (*unexpected_handler) ();
/// Takes a new handler function as an argument, returns the old function.
terminate_handler set_terminate(terminate_handler) _GLIBCXX_USE_NOEXCEPT;
/** The runtime will call this function if %exception handling must be
* abandoned for any reason. It can also be called by the user. */
void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__));
/// Takes a new handler function as an argument, returns the old function.
unexpected_handler set_unexpected(unexpected_handler) _GLIBCXX_USE_NOEXCEPT;
/** The runtime will call this function if an %exception is thrown which
* violates the function's %exception specification. */
void unexpected() __attribute__ ((__noreturn__));
/** [18.6.4]/1: 'Returns true after completing evaluation of a
* throw-expression until either completing initialization of the
* exception-declaration in the matching handler or entering @c unexpected()
* due to the throw; or after entering @c terminate() for any reason
* other than an explicit call to @c terminate(). [Note: This includes
* stack unwinding [15.2]. end note]'
*
* 2: 'When @c uncaught_exception() is true, throwing an
* %exception can result in a call of @c terminate()
* (15.5.1).'
*/
bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
// @} group exceptions
} // namespace std
namespace __gnu_cxx
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
/**
* @brief A replacement for the standard terminate_handler which
* prints more information about the terminating exception (if any)
* on stderr.
*
* @ingroup exceptions
*
* Call
* @code
* std::set_terminate(__gnu_cxx::__verbose_terminate_handler)
* @endcode
* to use. For more info, see
* http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt02ch06s02.html
*
* In 3.4 and later, this is on by default.
*/
void __verbose_terminate_handler();
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
} // extern "C++"
#pragma GCC visibility pop
#if (__cplusplus >= 201103L) && (ATOMIC_INT_LOCK_FREE > 1)
#include <bits/exception_ptr.h>
#include <bits/nested_exception.h>
#endif
#endif

View File

@ -1876,8 +1876,9 @@ protected:
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _Base(__a) : _Base(__a)
{ {
this->_M_tree_ptr = (0 == __len) ? this->_M_tree_ptr = (0 == __len)
0 : _S_new_RopeFunction(__fn, __len, __delete_fn, __a); ? 0
: _S_new_RopeFunction(__fn, __len, __delete_fn, _M_get_allocator());
} }
rope(const rope& __x, const allocator_type& __a = allocator_type()) rope(const rope& __x, const allocator_type& __a = allocator_type())

View File

@ -2181,8 +2181,15 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
using _Invoke = decltype(__callable_functor(std::declval<_Functor&>()) using _Invoke = decltype(__callable_functor(std::declval<_Functor&>())
(std::declval<_ArgTypes>()...) ); (std::declval<_ArgTypes>()...) );
// Used so the return type convertibility checks aren't done when
// performing overload resolution for copy construction/assignment.
template<typename _Tp>
using _NotSelf = __not_<is_same<_Tp, function>>;
template<typename _Functor> template<typename _Functor>
using _Callable = __check_func_return_type<_Invoke<_Functor>, _Res>; using _Callable
= __and_<_NotSelf<_Functor>,
__check_func_return_type<_Invoke<_Functor>, _Res>>;
template<typename _Cond, typename _Tp> template<typename _Cond, typename _Tp>
using _Requires = typename enable_if<_Cond::value, _Tp>::type; using _Requires = typename enable_if<_Cond::value, _Tp>::type;
@ -2323,7 +2330,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
* reference_wrapper<F>, this function will not throw. * reference_wrapper<F>, this function will not throw.
*/ */
template<typename _Functor> template<typename _Functor>
_Requires<_Callable<_Functor>, function&> _Requires<_Callable<typename decay<_Functor>::type>, function&>
operator=(_Functor&& __f) operator=(_Functor&& __f)
{ {
function(std::forward<_Functor>(__f)).swap(*this); function(std::forward<_Functor>(__f)).swap(*this);
@ -2432,9 +2439,9 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
{ {
if (static_cast<bool>(__x)) if (static_cast<bool>(__x))
{ {
__x._M_manager(_M_functor, __x._M_functor, __clone_functor);
_M_invoker = __x._M_invoker; _M_invoker = __x._M_invoker;
_M_manager = __x._M_manager; _M_manager = __x._M_manager;
__x._M_manager(_M_functor, __x._M_functor, __clone_functor);
} }
} }

View File

@ -351,12 +351,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void void
_M_set_result(function<_Ptr_type()> __res, bool __ignore_failure = false) _M_set_result(function<_Ptr_type()> __res, bool __ignore_failure = false)
{ {
bool __set = __ignore_failure; bool __set = false;
// all calls to this function are serialized, // all calls to this function are serialized,
// side-effects of invoking __res only happen once // side-effects of invoking __res only happen once
call_once(_M_once, &_State_base::_M_do_set, this, ref(__res), call_once(_M_once, &_State_base::_M_do_set, this, ref(__res),
ref(__set)); ref(__set));
if (!__set) if (__set)
_M_cond.notify_all();
else if (!__ignore_failure)
__throw_future_error(int(future_errc::promise_already_satisfied)); __throw_future_error(int(future_errc::promise_already_satisfied));
} }
@ -471,7 +473,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lock_guard<mutex> __lock(_M_mutex); lock_guard<mutex> __lock(_M_mutex);
_M_result.swap(__res); _M_result.swap(__res);
} }
_M_cond.notify_all();
__set = true; __set = true;
} }
@ -983,22 +984,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void void
set_value(const _Res& __r) set_value(const _Res& __r)
{ {
auto __future = _M_future;
auto __setter = _State::__setter(this, __r); auto __setter = _State::__setter(this, __r);
_M_future->_M_set_result(std::move(__setter)); __future->_M_set_result(std::move(__setter));
} }
void void
set_value(_Res&& __r) set_value(_Res&& __r)
{ {
auto __future = _M_future;
auto __setter = _State::__setter(this, std::move(__r)); auto __setter = _State::__setter(this, std::move(__r));
_M_future->_M_set_result(std::move(__setter)); __future->_M_set_result(std::move(__setter));
} }
void void
set_exception(exception_ptr __p) set_exception(exception_ptr __p)
{ {
auto __future = _M_future;
auto __setter = _State::__setter(__p, this); auto __setter = _State::__setter(__p, this);
_M_future->_M_set_result(std::move(__setter)); __future->_M_set_result(std::move(__setter));
} }
}; };
@ -1081,15 +1085,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void void
set_value(_Res& __r) set_value(_Res& __r)
{ {
auto __future = _M_future;
auto __setter = _State::__setter(this, __r); auto __setter = _State::__setter(this, __r);
_M_future->_M_set_result(std::move(__setter)); __future->_M_set_result(std::move(__setter));
} }
void void
set_exception(exception_ptr __p) set_exception(exception_ptr __p)
{ {
auto __future = _M_future;
auto __setter = _State::__setter(__p, this); auto __setter = _State::__setter(__p, this);
_M_future->_M_set_result(std::move(__setter)); __future->_M_set_result(std::move(__setter));
} }
}; };
@ -1166,8 +1172,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void void
set_exception(exception_ptr __p) set_exception(exception_ptr __p)
{ {
auto __future = _M_future;
auto __setter = _State::__setter(__p, this); auto __setter = _State::__setter(__p, this);
_M_future->_M_set_result(std::move(__setter)); __future->_M_set_result(std::move(__setter));
} }
}; };
@ -1193,8 +1200,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline void inline void
promise<void>::set_value() promise<void>::set_value()
{ {
auto __future = _M_future;
auto __setter = _State::__setter(this); auto __setter = _State::__setter(this);
_M_future->_M_set_result(std::move(__setter)); __future->_M_set_result(std::move(__setter));
} }
@ -1261,9 +1269,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __future_base::_Task_state<_Fn, _Alloc, _Res(_Args...)> final struct __future_base::_Task_state<_Fn, _Alloc, _Res(_Args...)> final
: __future_base::_Task_state_base<_Res(_Args...)> : __future_base::_Task_state_base<_Res(_Args...)>
{ {
_Task_state(_Fn&& __fn, const _Alloc& __a) template<typename _Fn2>
: _Task_state_base<_Res(_Args...)>(__a), _M_impl(std::move(__fn), __a) _Task_state(_Fn2&& __fn, const _Alloc& __a)
{ } : _Task_state_base<_Res(_Args...)>(__a),
_M_impl(std::forward<_Fn2>(__fn), __a)
{ }
private: private:
virtual void virtual void
@ -1292,19 +1302,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct _Impl : _Alloc struct _Impl : _Alloc
{ {
_Impl(_Fn&& __fn, const _Alloc& __a) template<typename _Fn2>
: _Alloc(__a), _M_fn(std::move(__fn)) { } _Impl(_Fn2&& __fn, const _Alloc& __a)
: _Alloc(__a), _M_fn(std::forward<_Fn2>(__fn)) { }
_Fn _M_fn; _Fn _M_fn;
} _M_impl; } _M_impl;
}; };
template<typename _Signature, typename _Fn, typename _Alloc> template<typename _Signature, typename _Fn, typename _Alloc>
static shared_ptr<__future_base::_Task_state_base<_Signature>> static shared_ptr<__future_base::_Task_state_base<_Signature>>
__create_task_state(_Fn&& __fn, const _Alloc& __a) __create_task_state(_Fn&& __fn, const _Alloc& __a)
{ {
typedef __future_base::_Task_state<_Fn, _Alloc, _Signature> _State; typedef typename decay<_Fn>::type _Fn2;
return std::allocate_shared<_State>(__a, std::move(__fn), __a); typedef __future_base::_Task_state<_Fn2, _Alloc, _Signature> _State;
} return std::allocate_shared<_State>(__a, std::forward<_Fn>(__fn), __a);
}
template<typename _Fn, typename _Alloc, typename _Res, typename... _Args> template<typename _Fn, typename _Alloc, typename _Res, typename... _Args>
shared_ptr<__future_base::_Task_state_base<_Res(_Args...)>> shared_ptr<__future_base::_Task_state_base<_Res(_Args...)>>
@ -1344,7 +1356,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__constrain_pkgdtask<packaged_task, _Fn>::__type> __constrain_pkgdtask<packaged_task, _Fn>::__type>
explicit explicit
packaged_task(_Fn&& __fn) packaged_task(_Fn&& __fn)
: packaged_task(allocator_arg, std::allocator<int>(), std::move(__fn)) : packaged_task(allocator_arg, std::allocator<int>(),
std::forward<_Fn>(__fn))
{ } { }
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
@ -1404,7 +1417,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator()(_ArgTypes... __args) operator()(_ArgTypes... __args)
{ {
__future_base::_State_base::_S_check(_M_state); __future_base::_State_base::_S_check(_M_state);
_M_state->_M_run(std::forward<_ArgTypes>(__args)...); auto __state = _M_state;
__state->_M_run(std::forward<_ArgTypes>(__args)...);
} }
void void

View File

@ -1,4 +1,4 @@
/* generated for xgcc.exe (GCC) 4.8.2 */ /* generated for xgcc.exe (GCC) 4.8.5 */
#ifndef GCC_GENERATED_STDINT_H #ifndef GCC_GENERATED_STDINT_H
#define GCC_GENERATED_STDINT_H 1 #define GCC_GENERATED_STDINT_H 1

View File

@ -0,0 +1,107 @@
// std::initializer_list support -*- C++ -*-
// Copyright (C) 2008-2013 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
// GCC 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.
//
// 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.
// 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
// <http://www.gnu.org/licenses/>.
/** @file initializer_list
* This is a Standard C++ Library header.
*/
#ifndef _INITIALIZER_LIST
#define _INITIALIZER_LIST
#pragma GCC system_header
#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else // C++0x
#pragma GCC visibility push(default)
#include <bits/c++config.h>
namespace std
{
/// initializer_list
template<class _E>
class initializer_list
{
public:
typedef _E value_type;
typedef const _E& reference;
typedef const _E& const_reference;
typedef size_t size_type;
typedef const _E* iterator;
typedef const _E* const_iterator;
private:
iterator _M_array;
size_type _M_len;
// The compiler can call a private constructor.
constexpr initializer_list(const_iterator __a, size_type __l)
: _M_array(__a), _M_len(__l) { }
public:
constexpr initializer_list() noexcept
: _M_array(0), _M_len(0) { }
// Number of elements.
constexpr size_type
size() const noexcept { return _M_len; }
// First element.
constexpr const_iterator
begin() const noexcept { return _M_array; }
// One past the last element.
constexpr const_iterator
end() const noexcept { return begin() + size(); }
};
/**
* @brief Return an iterator pointing to the first element of
* the initilizer_list.
* @param __ils Initializer list.
*/
template<class _Tp>
constexpr const _Tp*
begin(initializer_list<_Tp> __ils) noexcept
{ return __ils.begin(); }
/**
* @brief Return an iterator pointing to one past the last element
* of the initilizer_list.
* @param __ils Initializer list.
*/
template<class _Tp>
constexpr const _Tp*
end(initializer_list<_Tp> __ils) noexcept
{ return __ils.end(); }
}
#pragma GCC visibility pop
#endif // C++11
#endif // _INITIALIZER_LIST

View File

@ -48,13 +48,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* *
* The &lt;iostream&gt; header declares the eight <em>standard stream * The &lt;iostream&gt; header declares the eight <em>standard stream
* objects</em>. For other declarations, see * objects</em>. For other declarations, see
* http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch24.html * http://gcc.gnu.org/onlinedocs/libstdc++/manual/io.html
* and the @link iosfwd I/O forward declarations @endlink * and the @link iosfwd I/O forward declarations @endlink
* *
* They are required by default to cooperate with the global C * They are required by default to cooperate with the global C
* library's @c FILE streams, and to be available during program * library's @c FILE streams, and to be available during program
* startup and termination. For more information, see the HOWTO * startup and termination. For more information, see the section of the
* linked to above. * manual linked to above.
*/ */
//@{ //@{
extern istream cin; /// Linked to standard input extern istream cin; /// Linked to standard input

View File

@ -870,7 +870,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _CharT, typename _Traits, typename _Tp> template<typename _CharT, typename _Traits, typename _Tp>
inline basic_istream<_CharT, _Traits>& inline basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
{ return (__is >> __x); } {
__is >> __x;
return __is;
}
#endif // C++11 #endif // C++11
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION

View File

@ -31,7 +31,7 @@
#define _GLIBCXX_CXX_CONFIG_H 1 #define _GLIBCXX_CXX_CONFIG_H 1
// The current version of the C++ library in compressed ISO date format. // The current version of the C++ library in compressed ISO date format.
#define __GLIBCXX__ 20131016 #define __GLIBCXX__ 20150623
// Macros for various attributes. // Macros for various attributes.
// _GLIBCXX_PURE // _GLIBCXX_PURE
@ -599,7 +599,7 @@ namespace std
#define _GLIBCXX_HAVE_FABSL 1 #define _GLIBCXX_HAVE_FABSL 1
/* Define to 1 if you have the <fenv.h> header file. */ /* Define to 1 if you have the <fenv.h> header file. */
#define _GLIBCXX_HAVE_FENV_H 1 /* #undef _GLIBCXX_HAVE_FENV_H */
/* Define to 1 if you have the `finite' function. */ /* Define to 1 if you have the `finite' function. */
#define _GLIBCXX_HAVE_FINITE 1 #define _GLIBCXX_HAVE_FINITE 1
@ -653,7 +653,7 @@ namespace std
#define _GLIBCXX_HAVE_HYPOTL 1 #define _GLIBCXX_HAVE_HYPOTL 1
/* Define if you have the iconv() function. */ /* Define if you have the iconv() function. */
/* #undef _GLIBCXX_HAVE_ICONV */ #define _GLIBCXX_HAVE_ICONV 1
/* Define to 1 if you have the <ieeefp.h> header file. */ /* Define to 1 if you have the <ieeefp.h> header file. */
/* #undef _GLIBCXX_HAVE_IEEEFP_H */ /* #undef _GLIBCXX_HAVE_IEEEFP_H */
@ -737,10 +737,10 @@ namespace std
#define _GLIBCXX_HAVE_LOGL 1 #define _GLIBCXX_HAVE_LOGL 1
/* Define to 1 if you have the <machine/endian.h> header file. */ /* Define to 1 if you have the <machine/endian.h> header file. */
#define _GLIBCXX_HAVE_MACHINE_ENDIAN_H 1 /* #undef _GLIBCXX_HAVE_MACHINE_ENDIAN_H */
/* Define to 1 if you have the <machine/param.h> header file. */ /* Define to 1 if you have the <machine/param.h> header file. */
#define _GLIBCXX_HAVE_MACHINE_PARAM_H 1 /* #undef _GLIBCXX_HAVE_MACHINE_PARAM_H */
/* Define if mbstate_t exists in wchar.h. */ /* Define if mbstate_t exists in wchar.h. */
#define _GLIBCXX_HAVE_MBSTATE_T 1 #define _GLIBCXX_HAVE_MBSTATE_T 1
@ -824,7 +824,7 @@ namespace std
/* #undef _GLIBCXX_HAVE_STRERROR_L */ /* #undef _GLIBCXX_HAVE_STRERROR_L */
/* Define if strerror_r is available in <string.h>. */ /* Define if strerror_r is available in <string.h>. */
/* #undef _GLIBCXX_HAVE_STRERROR_R */ #define _GLIBCXX_HAVE_STRERROR_R 1
/* Define to 1 if you have the <strings.h> header file. */ /* Define to 1 if you have the <strings.h> header file. */
#define _GLIBCXX_HAVE_STRINGS_H 1 #define _GLIBCXX_HAVE_STRINGS_H 1
@ -836,7 +836,7 @@ namespace std
#define _GLIBCXX_HAVE_STRTOF 1 #define _GLIBCXX_HAVE_STRTOF 1
/* Define to 1 if you have the `strtold' function. */ /* Define to 1 if you have the `strtold' function. */
//#define _GLIBCXX_HAVE_STRTOLD 1 #define _GLIBCXX_HAVE_STRTOLD 1
/* Define if strxfrm_l is available in <string.h>. */ /* Define if strxfrm_l is available in <string.h>. */
/* #undef _GLIBCXX_HAVE_STRXFRM_L */ /* #undef _GLIBCXX_HAVE_STRXFRM_L */
@ -909,7 +909,7 @@ namespace std
/* #undef _GLIBCXX_HAVE_TGMATH_H */ /* #undef _GLIBCXX_HAVE_TGMATH_H */
/* Define to 1 if the target supports thread-local storage. */ /* Define to 1 if the target supports thread-local storage. */
/* #undef _GLIBCXX_HAVE_TLS */ #define _GLIBCXX_HAVE_TLS 1
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#define _GLIBCXX_HAVE_UNISTD_H 1 #define _GLIBCXX_HAVE_UNISTD_H 1
@ -1131,7 +1131,7 @@ namespace std
/* #undef _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */ /* #undef _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
/* Define as const if the declaration of iconv() needs const. */ /* Define as const if the declaration of iconv() needs const. */
/* #undef _GLIBCXX_ICONV_CONST */ #define _GLIBCXX_ICONV_CONST
/* Define to the sub-directory in which libtool stores uninstalled libraries. /* Define to the sub-directory in which libtool stores uninstalled libraries.
*/ */
@ -1292,7 +1292,7 @@ namespace std
#define _GLIBCXX_USE_FLOAT128 1 #define _GLIBCXX_USE_FLOAT128 1
/* Defined if gettimeofday is available. */ /* Defined if gettimeofday is available. */
#define _GLIBCXX_USE_GETTIMEOFDAY 1 /* #undef _GLIBCXX_USE_GETTIMEOFDAY */
/* Define if get_nprocs is available in <sys/sysinfo.h>. */ /* Define if get_nprocs is available in <sys/sysinfo.h>. */
/* #undef _GLIBCXX_USE_GET_NPROCS */ /* #undef _GLIBCXX_USE_GET_NPROCS */
@ -1332,7 +1332,7 @@ namespace std
/* #undef _GLIBCXX_USE_SYSCTL_HW_NCPU */ /* #undef _GLIBCXX_USE_SYSCTL_HW_NCPU */
/* Define if code specialized for wchar_t should be used. */ /* Define if code specialized for wchar_t should be used. */
//#define _GLIBCXX_USE_WCHAR_T 1 #define _GLIBCXX_USE_WCHAR_T 1
/* Define to 1 if a verbose library is built, or 0 otherwise. */ /* Define to 1 if a verbose library is built, or 0 otherwise. */
#define _GLIBCXX_VERBOSE 1 #define _GLIBCXX_VERBOSE 1

View File

@ -1,25 +0,0 @@
// Locale internal implementation header -*- C++ -*-
// Copyright (C) 2002-2013 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
// <http://www.gnu.org/licenses/>.
// The generic locale code doesn't need to do anything here (yet)

View File

@ -1,213 +0,0 @@
// Compatibility symbols for previous versions -*- C++ -*-
// Copyright (C) 2005-2013 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
// <http://www.gnu.org/licenses/>.
/** @file bits/compatibility.h
* This is an internal header file, included by other library sources.
* You should not attempt to use it directly.
*/
// Switch for symbol version macro.
#ifndef _GLIBCXX_APPLY_SYMVER
#error must define _GLIBCXX_APPLY_SYMVER before including __FILE__
#endif
/* gcc-3.4.4
_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv
_ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv
*/
namespace
{
_GLIBCXX_APPLY_SYMVER(_ZNSt21istreambuf_iteratorXXIcSt11char_traitsIcEEppEv,
_ZNSt19istreambuf_iteratorIcSt11char_traitsIcEEppEv)
#ifdef _GLIBCXX_USE_WCHAR_T
_GLIBCXX_APPLY_SYMVER(_ZNSt21istreambuf_iteratorXXIwSt11char_traitsIwEEppEv,
_ZNSt19istreambuf_iteratorIwSt11char_traitsIwEEppEv)
#endif
} // anonymous namespace
/* gcc-4.0.0
_ZNSs4_Rep26_M_set_length_and_sharableEj
_ZNSs7_M_copyEPcPKcj
_ZNSs7_M_moveEPcPKcj
_ZNSs9_M_assignEPcjc
_ZNKSs11_M_disjunctEPKc
_ZNKSs15_M_check_lengthEjjPKc
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEj
_ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwj
_ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwj
_ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw
_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw
_ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEjjPKc
_ZNKSt13basic_fstreamIcSt11char_traitsIcEE7is_openEv
_ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv
_ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv
_ZNKSt14basic_ifstreamIwSt11char_traitsIwEE7is_openEv
_ZNKSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv
_ZNKSt14basic_ofstreamIwSt11char_traitsIwEE7is_openEv
_ZNSi6ignoreEi
_ZNSi6ignoreEv
_ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEi
_ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv
_ZNSt11char_traitsIcE2eqERKcS2_
_ZNSt11char_traitsIwE2eqERKwS2_
*/
namespace
{
_GLIBCXX_APPLY_SYMVER(_ZNSt11char_traitsIcE4eqXXERKcS2_,
_ZNSt11char_traitsIcE2eqERKcS2_)
#ifdef _GLIBCXX_SIZE_T_IS_UINT
_GLIBCXX_APPLY_SYMVER(_ZNSs9_M_copyXXEPcPKcj,
_ZNSs7_M_copyEPcPKcj)
#else
_GLIBCXX_APPLY_SYMVER(_ZNSs9_M_copyXXEPcPKcm,
_ZNSs7_M_copyEPcPKcm)
#endif
#ifdef _GLIBCXX_SIZE_T_IS_UINT
_GLIBCXX_APPLY_SYMVER(_ZNSs9_M_moveXXEPcPKcj,
_ZNSs7_M_moveEPcPKcj)
#else
_GLIBCXX_APPLY_SYMVER(_ZNSs9_M_moveXXEPcPKcm,
_ZNSs7_M_moveEPcPKcm)
#endif
#ifdef _GLIBCXX_SIZE_T_IS_UINT
_GLIBCXX_APPLY_SYMVER(_ZNSs11_M_assignXXEPcjc,
_ZNSs9_M_assignEPcjc)
#else
_GLIBCXX_APPLY_SYMVER(_ZNSs11_M_assignXXEPcmc,
_ZNSs9_M_assignEPcmc)
#endif
_GLIBCXX_APPLY_SYMVER(_ZNKSs13_M_disjunctXXEPKc,
_ZNKSs11_M_disjunctEPKc)
#ifdef _GLIBCXX_SIZE_T_IS_UINT
_GLIBCXX_APPLY_SYMVER(_ZNKSs17_M_check_lengthXXEjjPKc,
_ZNKSs15_M_check_lengthEjjPKc)
#else
_GLIBCXX_APPLY_SYMVER(_ZNKSs17_M_check_lengthXXEmmPKc,
_ZNKSs15_M_check_lengthEmmPKc)
#endif
#ifdef _GLIBCXX_SIZE_T_IS_UINT
_GLIBCXX_APPLY_SYMVER(_ZNSs4_Rep28_M_set_length_and_sharableXXEj,
_ZNSs4_Rep26_M_set_length_and_sharableEj)
#else
_GLIBCXX_APPLY_SYMVER(_ZNSs4_Rep28_M_set_length_and_sharableXXEm,
_ZNSs4_Rep26_M_set_length_and_sharableEm)
#endif
_GLIBCXX_APPLY_SYMVER(_ZNSi8ignoreXXEv, _ZNSi6ignoreEv)
#ifdef _GLIBCXX_PTRDIFF_T_IS_INT
_GLIBCXX_APPLY_SYMVER(_ZNSi8ignoreXXEi, _ZNSi6ignoreEi)
#else
_GLIBCXX_APPLY_SYMVER(_ZNSi8ignoreXXEl, _ZNSi6ignoreEl)
#endif
_GLIBCXX_APPLY_SYMVER(_ZNKSt15basic_fstreamXXIcSt11char_traitsIcEE7is_openEv,
_ZNKSt13basic_fstreamIcSt11char_traitsIcEE7is_openEv)
_GLIBCXX_APPLY_SYMVER(_ZNKSt16basic_ifstreamXXIcSt11char_traitsIcEE7is_openEv,
_ZNKSt14basic_ifstreamIcSt11char_traitsIcEE7is_openEv)
_GLIBCXX_APPLY_SYMVER(_ZNKSt16basic_ofstreamXXIcSt11char_traitsIcEE7is_openEv,
_ZNKSt14basic_ofstreamIcSt11char_traitsIcEE7is_openEv)
// Support for wchar_t.
#ifdef _GLIBCXX_USE_WCHAR_T
_GLIBCXX_APPLY_SYMVER(_ZNSt11char_traitsIwE4eqXXERKwS2_,
_ZNSt11char_traitsIwE2eqERKwS2_)
#ifdef _GLIBCXX_SIZE_T_IS_UINT
_GLIBCXX_APPLY_SYMVER(_ZNSbIwSt11char_traitsIwESaIwEE9_M_copyXXEPwPKwj,
_ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwj)
#else
_GLIBCXX_APPLY_SYMVER(_ZNSbIwSt11char_traitsIwESaIwEE9_M_copyXXEPwPKwm,
_ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKwm)
#endif
#ifdef _GLIBCXX_SIZE_T_IS_UINT
_GLIBCXX_APPLY_SYMVER(_ZNSbIwSt11char_traitsIwESaIwEE9_M_moveXXEPwPKwj,
_ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwj)
#else
_GLIBCXX_APPLY_SYMVER(_ZNSbIwSt11char_traitsIwESaIwEE9_M_moveXXEPwPKwm,
_ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKwm)
#endif
#ifdef _GLIBCXX_SIZE_T_IS_UINT
_GLIBCXX_APPLY_SYMVER(_ZNSbIwSt11char_traitsIwESaIwEE11_M_assignXXEPwjw,
_ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw)
#else
_GLIBCXX_APPLY_SYMVER(_ZNSbIwSt11char_traitsIwESaIwEE11_M_assignXXEPwmw,
_ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwmw)
#endif
_GLIBCXX_APPLY_SYMVER(_ZNKSbIwSt11char_traitsIwESaIwEE13_M_disjunctXXEPKw,
_ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw)
#ifdef _GLIBCXX_SIZE_T_IS_UINT
_GLIBCXX_APPLY_SYMVER(_ZNKSbIwSt11char_traitsIwESaIwEE17_M_check_lengthXXEjjPKc,
_ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEjjPKc)
#else
_GLIBCXX_APPLY_SYMVER(_ZNKSbIwSt11char_traitsIwESaIwEE17_M_check_lengthXXEmmPKc,
_ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthEmmPKc)
#endif
#ifdef _GLIBCXX_SIZE_T_IS_UINT
_GLIBCXX_APPLY_SYMVER(_ZNSbIwSt11char_traitsIwESaIwEE4_Rep28_M_set_length_and_sharableXXEj,
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEj)
#else
_GLIBCXX_APPLY_SYMVER(_ZNSbIwSt11char_traitsIwESaIwEE4_Rep28_M_set_length_and_sharableXXEm,
_ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableEm)
#endif
_GLIBCXX_APPLY_SYMVER(_ZNSt13basic_istreamIwSt11char_traitsIwEE8ignoreXXEv,
_ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEv)
#ifdef _GLIBCXX_PTRDIFF_T_IS_INT
_GLIBCXX_APPLY_SYMVER(_ZNSt13basic_istreamIwSt11char_traitsIwEE8ignoreXXEi,
_ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEi)
#else
_GLIBCXX_APPLY_SYMVER(_ZNSt13basic_istreamIwSt11char_traitsIwEE8ignoreXXEl,
_ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreEl)
#endif
_GLIBCXX_APPLY_SYMVER(_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv,
_ZNKSt13basic_fstreamIwSt11char_traitsIwEE7is_openEv)
_GLIBCXX_APPLY_SYMVER(_ZNKSt16basic_ifstreamXXIwSt11char_traitsIwEE7is_openEv,
_ZNKSt14basic_ifstreamIwSt11char_traitsIwEE7is_openEv)
_GLIBCXX_APPLY_SYMVER(_ZNKSt16basic_ofstreamXXIwSt11char_traitsIwEE7is_openEv,
_ZNKSt14basic_ofstreamIwSt11char_traitsIwEE7is_openEv)
#endif
} // anonymous namespace

View File

@ -1,4 +1,4 @@
// Optimizations for random number handling, generic version -*- C++ -*- // Optimizations for random number functions, x86 version -*- C++ -*-
// Copyright (C) 2012-2013 Free Software Foundation, Inc. // Copyright (C) 2012-2013 Free Software Foundation, Inc.
// //
@ -30,9 +30,190 @@
#ifndef _BITS_OPT_RANDOM_H #ifndef _BITS_OPT_RANDOM_H
#define _BITS_OPT_RANDOM_H 1 #define _BITS_OPT_RANDOM_H 1
#include <x86intrin.h>
#pragma GCC system_header #pragma GCC system_header
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#ifdef __SSE3__
template<>
template<typename _UniformRandomNumberGenerator>
void
normal_distribution<double>::
__generate(typename normal_distribution<double>::result_type* __f,
typename normal_distribution<double>::result_type* __t,
_UniformRandomNumberGenerator& __urng,
const param_type& __param)
{
typedef uint64_t __uctype;
if (__f == __t)
return;
if (_M_saved_available)
{
_M_saved_available = false;
*__f++ = _M_saved * __param.stddev() + __param.mean();
if (__f == __t)
return;
}
constexpr uint64_t __maskval = 0xfffffffffffffull;
static const __m128i __mask = _mm_set1_epi64x(__maskval);
static const __m128i __two = _mm_set1_epi64x(0x4000000000000000ull);
static const __m128d __three = _mm_set1_pd(3.0);
const __m128d __av = _mm_set1_pd(__param.mean());
const __uctype __urngmin = __urng.min();
const __uctype __urngmax = __urng.max();
const __uctype __urngrange = __urngmax - __urngmin;
const __uctype __uerngrange = __urngrange + 1;
while (__f + 1 < __t)
{
double __le;
__m128d __x;
do
{
union
{
__m128i __i;
__m128d __d;
} __v;
if (__urngrange > __maskval)
{
if (__detail::_Power_of_2(__uerngrange))
__v.__i = _mm_and_si128(_mm_set_epi64x(__urng(),
__urng()),
__mask);
else
{
const __uctype __uerange = __maskval + 1;
const __uctype __scaling = __urngrange / __uerange;
const __uctype __past = __uerange * __scaling;
uint64_t __v1;
do
__v1 = __uctype(__urng()) - __urngmin;
while (__v1 >= __past);
__v1 /= __scaling;
uint64_t __v2;
do
__v2 = __uctype(__urng()) - __urngmin;
while (__v2 >= __past);
__v2 /= __scaling;
__v.__i = _mm_set_epi64x(__v1, __v2);
}
}
else if (__urngrange == __maskval)
__v.__i = _mm_set_epi64x(__urng(), __urng());
else if ((__urngrange + 2) * __urngrange >= __maskval
&& __detail::_Power_of_2(__uerngrange))
{
uint64_t __v1 = __urng() * __uerngrange + __urng();
uint64_t __v2 = __urng() * __uerngrange + __urng();
__v.__i = _mm_and_si128(_mm_set_epi64x(__v1, __v2),
__mask);
}
else
{
size_t __nrng = 2;
__uctype __high = __maskval / __uerngrange / __uerngrange;
while (__high > __uerngrange)
{
++__nrng;
__high /= __uerngrange;
}
const __uctype __highrange = __high + 1;
const __uctype __scaling = __urngrange / __highrange;
const __uctype __past = __highrange * __scaling;
__uctype __tmp;
uint64_t __v1;
do
{
do
__tmp = __uctype(__urng()) - __urngmin;
while (__tmp >= __past);
__v1 = __tmp / __scaling;
for (size_t __cnt = 0; __cnt < __nrng; ++__cnt)
{
__tmp = __v1;
__v1 *= __uerngrange;
__v1 += __uctype(__urng()) - __urngmin;
}
}
while (__v1 > __maskval || __v1 < __tmp);
uint64_t __v2;
do
{
do
__tmp = __uctype(__urng()) - __urngmin;
while (__tmp >= __past);
__v2 = __tmp / __scaling;
for (size_t __cnt = 0; __cnt < __nrng; ++__cnt)
{
__tmp = __v2;
__v2 *= __uerngrange;
__v2 += __uctype(__urng()) - __urngmin;
}
}
while (__v2 > __maskval || __v2 < __tmp);
__v.__i = _mm_set_epi64x(__v1, __v2);
}
__v.__i = _mm_or_si128(__v.__i, __two);
__x = _mm_sub_pd(__v.__d, __three);
__m128d __m = _mm_mul_pd(__x, __x);
__le = _mm_cvtsd_f64(_mm_hadd_pd (__m, __m));
}
while (__le == 0.0 || __le >= 1.0);
double __mult = (std::sqrt(-2.0 * std::log(__le) / __le)
* __param.stddev());
__x = _mm_add_pd(_mm_mul_pd(__x, _mm_set1_pd(__mult)), __av);
_mm_storeu_pd(__f, __x);
__f += 2;
}
if (__f != __t)
{
result_type __x, __y, __r2;
__detail::_Adaptor<_UniformRandomNumberGenerator, result_type>
__aurng(__urng);
do
{
__x = result_type(2.0) * __aurng() - 1.0;
__y = result_type(2.0) * __aurng() - 1.0;
__r2 = __x * __x + __y * __y;
}
while (__r2 > 1.0 || __r2 == 0.0);
const result_type __mult = std::sqrt(-2 * std::log(__r2) / __r2);
_M_saved = __x * __mult;
_M_saved_available = true;
*__f = __y * __mult * __param.stddev() + __param.mean();
}
}
#endif
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#endif // _BITS_OPT_RANDOM_H #endif // _BITS_OPT_RANDOM_H

View File

@ -75,4 +75,7 @@
#define _GLIBCXX_LLP64 1 #define _GLIBCXX_LLP64 1
#endif #endif
// See libstdc++/59807
#define _GTHREAD_USE_MUTEX_INIT_FUNC 1
#endif #endif

View File

@ -1,4 +1,4 @@
// Optimizations for random number extensions, generic version -*- C++ -*- // Optimizations for random number extensions, x86 version -*- C++ -*-
// Copyright (C) 2012-2013 Free Software Foundation, Inc. // Copyright (C) 2012-2013 Free Software Foundation, Inc.
// //
@ -22,7 +22,7 @@
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
/** @file ext/opt_random.h /** @file ext/random.tcc
* This is an internal header file, included by other library headers. * This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{ext/random} * Do not attempt to use it directly. @headername{ext/random}
*/ */
@ -32,7 +32,109 @@
#pragma GCC system_header #pragma GCC system_header
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#ifdef __SSE2__
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace {
template<size_t __sl1, size_t __sl2, size_t __sr1, size_t __sr2,
uint32_t __msk1, uint32_t __msk2, uint32_t __msk3, uint32_t __msk4>
inline __m128i __sse2_recursion(__m128i __a, __m128i __b,
__m128i __c, __m128i __d)
{
__m128i __y = _mm_srli_epi32(__b, __sr1);
__m128i __z = _mm_srli_si128(__c, __sr2);
__m128i __v = _mm_slli_epi32(__d, __sl1);
__z = _mm_xor_si128(__z, __a);
__z = _mm_xor_si128(__z, __v);
__m128i __x = _mm_slli_si128(__a, __sl2);
__y = _mm_and_si128(__y, _mm_set_epi32(__msk4, __msk3, __msk2, __msk1));
__z = _mm_xor_si128(__z, __x);
return _mm_xor_si128(__z, __y);
}
}
#define _GLIBCXX_OPT_HAVE_RANDOM_SFMT_GEN_READ 1
template<typename _UIntType, size_t __m,
size_t __pos1, size_t __sl1, size_t __sl2,
size_t __sr1, size_t __sr2,
uint32_t __msk1, uint32_t __msk2,
uint32_t __msk3, uint32_t __msk4,
uint32_t __parity1, uint32_t __parity2,
uint32_t __parity3, uint32_t __parity4>
void simd_fast_mersenne_twister_engine<_UIntType, __m,
__pos1, __sl1, __sl2, __sr1, __sr2,
__msk1, __msk2, __msk3, __msk4,
__parity1, __parity2, __parity3,
__parity4>::
_M_gen_rand(void)
{
__m128i __r1 = _mm_load_si128(&_M_state[_M_nstate - 2]);
__m128i __r2 = _mm_load_si128(&_M_state[_M_nstate - 1]);
size_t __i;
for (__i = 0; __i < _M_nstate - __pos1; ++__i)
{
__m128i __r = __sse2_recursion<__sl1, __sl2, __sr1, __sr2,
__msk1, __msk2, __msk3, __msk4>
(_M_state[__i], _M_state[__i + __pos1], __r1, __r2);
_mm_store_si128(&_M_state[__i], __r);
__r1 = __r2;
__r2 = __r;
}
for (; __i < _M_nstate; ++__i)
{
__m128i __r = __sse2_recursion<__sl1, __sl2, __sr1, __sr2,
__msk1, __msk2, __msk3, __msk4>
(_M_state[__i], _M_state[__i + __pos1 - _M_nstate], __r1, __r2);
_mm_store_si128(&_M_state[__i], __r);
__r1 = __r2;
__r2 = __r;
}
_M_pos = 0;
}
#define _GLIBCXX_OPT_HAVE_RANDOM_SFMT_OPERATOREQUAL 1
template<typename _UIntType, size_t __m,
size_t __pos1, size_t __sl1, size_t __sl2,
size_t __sr1, size_t __sr2,
uint32_t __msk1, uint32_t __msk2,
uint32_t __msk3, uint32_t __msk4,
uint32_t __parity1, uint32_t __parity2,
uint32_t __parity3, uint32_t __parity4>
bool
operator==(const __gnu_cxx::simd_fast_mersenne_twister_engine<_UIntType,
__m, __pos1, __sl1, __sl2, __sr1, __sr2,
__msk1, __msk2, __msk3, __msk4,
__parity1, __parity2, __parity3, __parity4>& __lhs,
const __gnu_cxx::simd_fast_mersenne_twister_engine<_UIntType,
__m, __pos1, __sl1, __sl2, __sr1, __sr2,
__msk1, __msk2, __msk3, __msk4,
__parity1, __parity2, __parity3, __parity4>& __rhs)
{
__m128i __res = _mm_cmpeq_epi8(__lhs._M_state[0], __rhs._M_state[0]);
for (size_t __i = 1; __i < __lhs._M_nstate; ++__i)
__res = _mm_and_si128(__res, _mm_cmpeq_epi8(__lhs._M_state[__i],
__rhs._M_state[__i]));
return (_mm_movemask_epi8(__res) == 0xffff
&& __lhs._M_pos == __rhs._M_pos);
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#endif // __SSE2__
#endif // __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#endif // _EXT_OPT_RANDOM_H #endif // _EXT_OPT_RANDOM_H

View File

@ -0,0 +1,122 @@
// The -*- C++ -*- dynamic memory management header.
// Copyright (C) 1994-2013 Free Software Foundation, Inc.
// This file is part of GCC.
//
// GCC 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.
//
// 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.
// 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
// <http://www.gnu.org/licenses/>.
/** @file new
* This is a Standard C++ Library header.
*
* The header @c new defines several functions to manage dynamic memory and
* handling memory allocation errors; see
* http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more.
*/
#ifndef _NEW
#define _NEW
#pragma GCC system_header
#include <bits/c++config.h>
#include <exception>
#pragma GCC visibility push(default)
extern "C++" {
namespace std
{
/**
* @brief Exception possibly thrown by @c new.
* @ingroup exceptions
*
* @c bad_alloc (or classes derived from it) is used to report allocation
* errors from the throwing forms of @c new. */
class bad_alloc : public exception
{
public:
bad_alloc() throw() { }
// This declaration is not useless:
// http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
virtual ~bad_alloc() throw();
// See comment in eh_exception.cc.
virtual const char* what() const throw();
};
struct nothrow_t { };
extern const nothrow_t nothrow;
/** If you write your own error handler to be called by @c new, it must
* be of this type. */
typedef void (*new_handler)();
/// Takes a replacement handler as the argument, returns the
/// previous handler.
new_handler set_new_handler(new_handler) throw();
} // namespace std
//@{
/** These are replaceable signatures:
* - normal single new and delete (no arguments, throw @c bad_alloc on error)
* - normal array new and delete (same)
* - @c nothrow single new and delete (take a @c nothrow argument, return
* @c NULL on error)
* - @c nothrow array new and delete (same)
*
* Placement new and delete signatures (take a memory address argument,
* does nothing) may not be replaced by a user's program.
*/
void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
__attribute__((__externally_visible__));
void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
__attribute__((__externally_visible__));
void operator delete(void*) _GLIBCXX_USE_NOEXCEPT
__attribute__((__externally_visible__));
void operator delete[](void*) _GLIBCXX_USE_NOEXCEPT
__attribute__((__externally_visible__));
void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
__attribute__((__externally_visible__));
void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
__attribute__((__externally_visible__));
void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
__attribute__((__externally_visible__));
void operator delete[](void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
__attribute__((__externally_visible__));
// Default placement versions of operator new.
inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
{ return __p; }
inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
{ return __p; }
// Default placement versions of operator delete.
inline void operator delete (void*, void*) _GLIBCXX_USE_NOEXCEPT { }
inline void operator delete[](void*, void*) _GLIBCXX_USE_NOEXCEPT { }
//@}
} // extern "C++"
#pragma GCC visibility pop
#endif

View File

@ -600,7 +600,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _CharT, typename _Traits, typename _Tp> template<typename _CharT, typename _Traits, typename _Tp>
inline basic_ostream<_CharT, _Traits>& inline basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x) operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
{ return (__os << __x); } {
__os << __x;
return __os;
}
#endif // C++11 #endif // C++11
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION

View File

@ -105,6 +105,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__inner_type_impl() = default; __inner_type_impl() = default;
__inner_type_impl(const __inner_type_impl&) = default; __inner_type_impl(const __inner_type_impl&) = default;
__inner_type_impl(__inner_type_impl&&) = default; __inner_type_impl(__inner_type_impl&&) = default;
__inner_type_impl& operator=(const __inner_type_impl&) = default;
__inner_type_impl& operator=(__inner_type_impl&&) = default;
template<typename _Alloc> template<typename _Alloc>
__inner_type_impl(const __inner_type_impl<_Alloc>& __other) __inner_type_impl(const __inner_type_impl<_Alloc>& __other)
@ -136,6 +138,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__inner_type_impl() = default; __inner_type_impl() = default;
__inner_type_impl(const __inner_type_impl&) = default; __inner_type_impl(const __inner_type_impl&) = default;
__inner_type_impl(__inner_type_impl&&) = default; __inner_type_impl(__inner_type_impl&&) = default;
__inner_type_impl& operator=(const __inner_type_impl&) = default;
__inner_type_impl& operator=(__inner_type_impl&&) = default;
template<typename... _Allocs> template<typename... _Allocs>
__inner_type_impl(const __inner_type_impl<_Allocs...>& __other) __inner_type_impl(const __inner_type_impl<_Allocs...>& __other)
@ -310,6 +314,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_inner(std::move(__other._M_inner)) _M_inner(std::move(__other._M_inner))
{ } { }
scoped_allocator_adaptor&
operator=(const scoped_allocator_adaptor&) = default;
scoped_allocator_adaptor&
operator=(scoped_allocator_adaptor&&) = default;
inner_allocator_type& inner_allocator() noexcept inner_allocator_type& inner_allocator() noexcept
{ return _M_inner._M_get(this); } { return _M_inner._M_get(this); }

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -1 +0,0 @@
timestamp

View File

@ -158,143 +158,143 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// functions // functions
using ::acosh; using ::acosh;
using ::acoshf; using ::acoshf;
using ::acoshl; // using ::acoshl;
using ::asinh; using ::asinh;
using ::asinhf; using ::asinhf;
using ::asinhl; // using ::asinhl;
using ::atanh; using ::atanh;
using ::atanhf; using ::atanhf;
using ::atanhl; // using ::atanhl;
using ::cbrt; using ::cbrt;
using ::cbrtf; using ::cbrtf;
using ::cbrtl; // using ::cbrtl;
using ::copysign; using ::copysign;
using ::copysignf; using ::copysignf;
using ::copysignl; // using ::copysignl;
using ::erf; using ::erf;
using ::erff; using ::erff;
using ::erfl; // using ::erfl;
using ::erfc; using ::erfc;
using ::erfcf; using ::erfcf;
using ::erfcl; // using ::erfcl;
using ::exp2; using ::exp2;
using ::exp2f; using ::exp2f;
using ::exp2l; // using ::exp2l;
using ::expm1; using ::expm1;
using ::expm1f; using ::expm1f;
using ::expm1l; // using ::expm1l;
using ::fdim; using ::fdim;
using ::fdimf; using ::fdimf;
using ::fdiml; // using ::fdiml;
using ::fma; using ::fma;
using ::fmaf; using ::fmaf;
using ::fmal; // using ::fmal;
using ::fmax; using ::fmax;
using ::fmaxf; using ::fmaxf;
using ::fmaxl; // using ::fmaxl;
using ::fmin; using ::fmin;
using ::fminf; using ::fminf;
using ::fminl; // using ::fminl;
using ::hypot; using ::hypot;
using ::hypotf; using ::hypotf;
using ::hypotl; // using ::hypotl;
using ::ilogb; using ::ilogb;
using ::ilogbf; using ::ilogbf;
using ::ilogbl; // using ::ilogbl;
using ::lgamma; using ::lgamma;
using ::lgammaf; using ::lgammaf;
using ::lgammal; // using ::lgammal;
using ::llrint; using ::llrint;
using ::llrintf; using ::llrintf;
using ::llrintl; // using ::llrintl;
using ::llround; using ::llround;
using ::llroundf; using ::llroundf;
using ::llroundl; // using ::llroundl;
using ::log1p; using ::log1p;
using ::log1pf; using ::log1pf;
using ::log1pl; // using ::log1pl;
using ::log2; using ::log2;
using ::log2f; using ::log2f;
using ::log2l; // using ::log2l;
using ::logb; using ::logb;
using ::logbf; using ::logbf;
using ::logbl; // using ::logbl;
using ::lrint; using ::lrint;
using ::lrintf; using ::lrintf;
using ::lrintl; // using ::lrintl;
using ::lround; using ::lround;
using ::lroundf; using ::lroundf;
using ::lroundl; // using ::lroundl;
using ::nan; using ::nan;
using ::nanf; using ::nanf;
using ::nanl; // using ::nanl;
using ::nearbyint; using ::nearbyint;
using ::nearbyintf; using ::nearbyintf;
using ::nearbyintl; // using ::nearbyintl;
using ::nextafter; using ::nextafter;
using ::nextafterf; using ::nextafterf;
using ::nextafterl; // using ::nextafterl;
using ::nexttoward; // using ::nexttoward;
using ::nexttowardf; // using ::nexttowardf;
using ::nexttowardl; // using ::nexttowardl;
using ::remainder; using ::remainder;
using ::remainderf; using ::remainderf;
using ::remainderl; // using ::remainderl;
using ::remquo; using ::remquo;
using ::remquof; using ::remquof;
using ::remquol; // using ::remquol;
using ::rint; using ::rint;
using ::rintf; using ::rintf;
using ::rintl; // using ::rintl;
using ::round; using ::round;
using ::roundf; using ::roundf;
using ::roundl; // using ::roundl;
using ::scalbln; using ::scalbln;
using ::scalblnf; using ::scalblnf;
using ::scalblnl; // using ::scalblnl;
using ::scalbn; using ::scalbn;
using ::scalbnf; using ::scalbnf;
using ::scalbnl; // using ::scalbnl;
using ::tgamma; using ::tgamma;
using ::tgammaf; using ::tgammaf;
using ::tgammal; // using ::tgammal;
using ::trunc; using ::trunc;
using ::truncf; using ::truncf;
using ::truncl; // using ::truncl;
#endif #endif

View File

@ -2112,9 +2112,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
if (static_cast<bool>(__x)) if (static_cast<bool>(__x))
{ {
__x._M_manager(_M_functor, __x._M_functor, __clone_functor);
_M_invoker = __x._M_invoker; _M_invoker = __x._M_invoker;
_M_manager = __x._M_manager; _M_manager = __x._M_manager;
__x._M_manager(_M_functor, __x._M_functor, __clone_functor);
} }
} }
@ -2130,9 +2130,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
if (_My_handler::_M_not_empty_function(__f)) if (_My_handler::_M_not_empty_function(__f))
{ {
_My_handler::_M_init_functor(_M_functor, __f);
_M_invoker = &_My_handler::_M_invoke; _M_invoker = &_My_handler::_M_invoke;
_M_manager = &_My_handler::_M_manager; _M_manager = &_My_handler::_M_manager;
_My_handler::_M_init_functor(_M_functor, __f);
} }
} }

View File

@ -44,7 +44,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* bool_set * bool_set
* *
* See N2136, Bool_set: multi-valued logic * See N2136, Bool_set: multi-valued logic
* by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion. * by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion.
* *
* The implicit conversion to bool is slippery! I may use the new * The implicit conversion to bool is slippery! I may use the new
* explicit conversion. This has been specialized in the language * explicit conversion. This has been specialized in the language

View File

@ -88,21 +88,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr _Head_base(const _Head& __h) constexpr _Head_base(const _Head& __h)
: _Head(__h) { } : _Head(__h) { }
template<typename _UHead, typename = typename constexpr _Head_base(const _Head_base&) = default;
enable_if<!is_convertible<_UHead, constexpr _Head_base(_Head_base&&) = default;
__uses_alloc_base>::value>::type>
template<typename _UHead>
constexpr _Head_base(_UHead&& __h) constexpr _Head_base(_UHead&& __h)
: _Head(std::forward<_UHead>(__h)) { } : _Head(std::forward<_UHead>(__h)) { }
_Head_base(__uses_alloc0) _Head_base(allocator_arg_t, __uses_alloc0)
: _Head() { } : _Head() { }
template<typename _Alloc> template<typename _Alloc>
_Head_base(__uses_alloc1<_Alloc> __a) _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a)
: _Head(allocator_arg, *__a._M_a) { } : _Head(allocator_arg, *__a._M_a) { }
template<typename _Alloc> template<typename _Alloc>
_Head_base(__uses_alloc2<_Alloc> __a) _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a)
: _Head(*__a._M_a) { } : _Head(*__a._M_a) { }
template<typename _UHead> template<typename _UHead>
@ -133,21 +134,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr _Head_base(const _Head& __h) constexpr _Head_base(const _Head& __h)
: _M_head_impl(__h) { } : _M_head_impl(__h) { }
template<typename _UHead, typename = typename constexpr _Head_base(const _Head_base&) = default;
enable_if<!is_convertible<_UHead, constexpr _Head_base(_Head_base&&) = default;
__uses_alloc_base>::value>::type>
template<typename _UHead>
constexpr _Head_base(_UHead&& __h) constexpr _Head_base(_UHead&& __h)
: _M_head_impl(std::forward<_UHead>(__h)) { } : _M_head_impl(std::forward<_UHead>(__h)) { }
_Head_base(__uses_alloc0) _Head_base(allocator_arg_t, __uses_alloc0)
: _M_head_impl() { } : _M_head_impl() { }
template<typename _Alloc> template<typename _Alloc>
_Head_base(__uses_alloc1<_Alloc> __a) _Head_base(allocator_arg_t, __uses_alloc1<_Alloc> __a)
: _M_head_impl(allocator_arg, *__a._M_a) { } : _M_head_impl(allocator_arg, *__a._M_a) { }
template<typename _Alloc> template<typename _Alloc>
_Head_base(__uses_alloc2<_Alloc> __a) _Head_base(allocator_arg_t, __uses_alloc2<_Alloc> __a)
: _M_head_impl(*__a._M_a) { } : _M_head_impl(*__a._M_a) { }
template<typename _UHead> template<typename _UHead>
@ -285,7 +287,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Alloc> template<typename _Alloc>
_Tuple_impl(allocator_arg_t __tag, const _Alloc& __a) _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a)
: _Inherited(__tag, __a), : _Inherited(__tag, __a),
_Base(__use_alloc<_Head>(__a)) { } _Base(__tag, __use_alloc<_Head>(__a)) { }
template<typename _Alloc> template<typename _Alloc>
_Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
@ -755,14 +757,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename tuple_element<__i, tuple<_Elements...>>::type typename tuple_element<__i, tuple<_Elements...>>::type
>::type >::type
get(tuple<_Elements...>& __t) noexcept get(tuple<_Elements...>& __t) noexcept
{ return __get_helper<__i>(__t); } { return std::__get_helper<__i>(__t); }
template<std::size_t __i, typename... _Elements> template<std::size_t __i, typename... _Elements>
constexpr typename __add_c_ref< constexpr typename __add_c_ref<
typename tuple_element<__i, tuple<_Elements...>>::type typename tuple_element<__i, tuple<_Elements...>>::type
>::type >::type
get(const tuple<_Elements...>& __t) noexcept get(const tuple<_Elements...>& __t) noexcept
{ return __get_helper<__i>(__t); } { return std::__get_helper<__i>(__t); }
template<std::size_t __i, typename... _Elements> template<std::size_t __i, typename... _Elements>
constexpr typename __add_r_ref< constexpr typename __add_r_ref<

View File

@ -0,0 +1,222 @@
// RTTI support for -*- C++ -*-
// Copyright (C) 1994-2013 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
// GCC 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.
//
// 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.
// 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
// <http://www.gnu.org/licenses/>.
/** @file typeinfo
* This is a Standard C++ Library header.
*/
#ifndef _TYPEINFO
#define _TYPEINFO
#pragma GCC system_header
#include <exception>
#if __cplusplus >= 201103L
#include <bits/hash_bytes.h>
#endif
#pragma GCC visibility push(default)
extern "C++" {
namespace __cxxabiv1
{
class __class_type_info;
} // namespace __cxxabiv1
// Determine whether typeinfo names for the same type are merged (in which
// case comparison can just compare pointers) or not (in which case strings
// must be compared), and whether comparison is to be implemented inline or
// not. We used to do inline pointer comparison by default if weak symbols
// are available, but even with weak symbols sometimes names are not merged
// when objects are loaded with RTLD_LOCAL, so now we always use strcmp by
// default. For ABI compatibility, we do the strcmp inline if weak symbols
// are available, and out-of-line if not. Out-of-line pointer comparison
// is used where the object files are to be portable to multiple systems,
// some of which may not be able to use pointer comparison, but the
// particular system for which libstdc++ is being built can use pointer
// comparison; in particular for most ARM EABI systems, where the ABI
// specifies out-of-line comparison. The compiler's target configuration
// can override the defaults by defining __GXX_TYPEINFO_EQUALITY_INLINE to
// 1 or 0 to indicate whether or not comparison is inline, and
// __GXX_MERGED_TYPEINFO_NAMES to 1 or 0 to indicate whether or not pointer
// comparison can be used.
#ifndef __GXX_MERGED_TYPEINFO_NAMES
// By default, typeinfo names are not merged.
#define __GXX_MERGED_TYPEINFO_NAMES 0
#endif
// By default follow the old inline rules to avoid ABI changes.
#ifndef __GXX_TYPEINFO_EQUALITY_INLINE
#if !__GXX_WEAK__
#define __GXX_TYPEINFO_EQUALITY_INLINE 0
#else
#define __GXX_TYPEINFO_EQUALITY_INLINE 1
#endif
#endif
namespace std
{
/**
* @brief Part of RTTI.
*
* The @c type_info class describes type information generated by
* an implementation.
*/
class type_info
{
public:
/** Destructor first. Being the first non-inline virtual function, this
* controls in which translation unit the vtable is emitted. The
* compiler makes use of that information to know where to emit
* the runtime-mandated type_info structures in the new-abi. */
virtual ~type_info();
/** Returns an @e implementation-defined byte string; this is not
* portable between compilers! */
const char* name() const _GLIBCXX_NOEXCEPT
{ return __name[0] == '*' ? __name + 1 : __name; }
#if !__GXX_TYPEINFO_EQUALITY_INLINE
// In old abi, or when weak symbols are not supported, there can
// be multiple instances of a type_info object for one
// type. Uniqueness must use the _name value, not object address.
bool before(const type_info& __arg) const _GLIBCXX_NOEXCEPT;
bool operator==(const type_info& __arg) const _GLIBCXX_NOEXCEPT;
#else
#if !__GXX_MERGED_TYPEINFO_NAMES
/** Returns true if @c *this precedes @c __arg in the implementation's
* collation order. */
// Even with the new abi, on systems that support dlopen
// we can run into cases where type_info names aren't merged,
// so we still need to do string comparison.
bool before(const type_info& __arg) const _GLIBCXX_NOEXCEPT
{ return (__name[0] == '*' && __arg.__name[0] == '*')
? __name < __arg.__name
: __builtin_strcmp (__name, __arg.__name) < 0; }
bool operator==(const type_info& __arg) const _GLIBCXX_NOEXCEPT
{
return ((__name == __arg.__name)
|| (__name[0] != '*' &&
__builtin_strcmp (__name, __arg.__name) == 0));
}
#else
// On some targets we can rely on type_info's NTBS being unique,
// and therefore address comparisons are sufficient.
bool before(const type_info& __arg) const _GLIBCXX_NOEXCEPT
{ return __name < __arg.__name; }
bool operator==(const type_info& __arg) const _GLIBCXX_NOEXCEPT
{ return __name == __arg.__name; }
#endif
#endif
bool operator!=(const type_info& __arg) const _GLIBCXX_NOEXCEPT
{ return !operator==(__arg); }
#if __cplusplus >= 201103L
size_t hash_code() const noexcept
{
# if !__GXX_MERGED_TYPEINFO_NAMES
return _Hash_bytes(name(), __builtin_strlen(name()),
static_cast<size_t>(0xc70f6907UL));
# else
return reinterpret_cast<size_t>(__name);
# endif
}
#endif // C++11
// Return true if this is a pointer type of some kind
virtual bool __is_pointer_p() const;
// Return true if this is a function type
virtual bool __is_function_p() const;
// Try and catch a thrown type. Store an adjusted pointer to the
// caught type in THR_OBJ. If THR_TYPE is not a pointer type, then
// THR_OBJ points to the thrown object. If THR_TYPE is a pointer
// type, then THR_OBJ is the pointer itself. OUTER indicates the
// number of outer pointers, and whether they were const
// qualified.
virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
unsigned __outer) const;
// Internally used during catch matching
virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
void **__obj_ptr) const;
protected:
const char *__name;
explicit type_info(const char *__n): __name(__n) { }
private:
/// Assigning type_info is not supported.
type_info& operator=(const type_info&);
type_info(const type_info&);
};
/**
* @brief Thrown during incorrect typecasting.
* @ingroup exceptions
*
* If you attempt an invalid @c dynamic_cast expression, an instance of
* this class (or something derived from this class) is thrown. */
class bad_cast : public exception
{
public:
bad_cast() _GLIBCXX_USE_NOEXCEPT { }
// This declaration is not useless:
// http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
virtual ~bad_cast() _GLIBCXX_USE_NOEXCEPT;
// See comment in eh_exception.cc.
virtual const char* what() const _GLIBCXX_USE_NOEXCEPT;
};
/**
* @brief Thrown when a NULL pointer in a @c typeid expression is used.
* @ingroup exceptions
*/
class bad_typeid : public exception
{
public:
bad_typeid () _GLIBCXX_USE_NOEXCEPT { }
// This declaration is not useless:
// http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
virtual ~bad_typeid() _GLIBCXX_USE_NOEXCEPT;
// See comment in eh_exception.cc.
virtual const char* what() const _GLIBCXX_USE_NOEXCEPT;
};
} // namespace std
} // extern "C++"
#pragma GCC visibility pop
#endif

View File

@ -26,7 +26,7 @@
#include <new> #include <new>
#include "bits/gthr.h" #include "bits/gthr.h"
#if HAVE___CXA_THREAD_ATEXIT_IMPL #if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
extern "C" int __cxa_thread_atexit_impl (void (*func) (void *), extern "C" int __cxa_thread_atexit_impl (void (*func) (void *),
void *arg, void *d); void *arg, void *d);
@ -38,7 +38,7 @@ __cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *),
return __cxa_thread_atexit_impl (dtor, obj, dso_handle); return __cxa_thread_atexit_impl (dtor, obj, dso_handle);
} }
#else /* HAVE___CXA_THREAD_ATEXIT_IMPL */ #else /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
namespace { namespace {
// One element in a singly-linked stack of cleanups. // One element in a singly-linked stack of cleanups.
@ -142,4 +142,4 @@ __cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *), void *obj, void */*dso_ha
return 0; return 0;
} }
#endif /* HAVE___CXA_THREAD_ATEXIT_IMPL */ #endif /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */

File diff suppressed because it is too large Load Diff

View File

@ -56,6 +56,18 @@ __dynamic_cast (const void *src_ptr, // object started from
const __class_type_info *whole_type = prefix->whole_type; const __class_type_info *whole_type = prefix->whole_type;
__class_type_info::__dyncast_result result; __class_type_info::__dyncast_result result;
// If the whole object vptr doesn't refer to the whole object type, we're
// in the middle of constructing a primary base, and src is a separate
// base. This has undefined behavior and we can't find anything outside
// of the base we're actually constructing, so fail now rather than
// segfault later trying to use a vbase offset that doesn't exist.
const void *whole_vtable = *static_cast <const void *const *> (whole_ptr);
const vtable_prefix *whole_prefix =
adjust_pointer <vtable_prefix> (whole_vtable,
-offsetof (vtable_prefix, origin));
if (whole_prefix->whole_type != whole_type)
return NULL;
whole_type->__do_dyncast (src2dst, __class_type_info::__contained_public, whole_type->__do_dyncast (src2dst, __class_type_info::__contained_public,
dst_type, whole_ptr, src_type, src_ptr, result); dst_type, whole_ptr, src_type, src_ptr, result);
if (!result.dst_ptr) if (!result.dst_ptr)

View File

@ -129,12 +129,6 @@ __cxxabiv1::__cxa_allocate_exception(std::size_t thrown_size) _GLIBCXX_NOTHROW
std::terminate (); std::terminate ();
} }
// We have an uncaught exception as soon as we allocate memory. This
// yields uncaught_exception() true during the copy-constructor that
// initializes the exception object. See Issue 475.
__cxa_eh_globals *globals = __cxa_get_globals ();
globals->uncaughtExceptions += 1;
memset (ret, 0, sizeof (__cxa_refcounted_exception)); memset (ret, 0, sizeof (__cxa_refcounted_exception));
return (void *)((char *)ret + sizeof (__cxa_refcounted_exception)); return (void *)((char *)ret + sizeof (__cxa_refcounted_exception));
@ -191,12 +185,6 @@ __cxxabiv1::__cxa_allocate_dependent_exception() _GLIBCXX_NOTHROW
std::terminate (); std::terminate ();
} }
// We have an uncaught exception as soon as we allocate memory. This
// yields uncaught_exception() true during the copy-constructor that
// initializes the exception object. See Issue 475.
__cxa_eh_globals *globals = __cxa_get_globals ();
globals->uncaughtExceptions += 1;
memset (ret, 0, sizeof (__cxa_dependent_exception)); memset (ret, 0, sizeof (__cxa_dependent_exception));
return ret; return ret;

View File

@ -140,7 +140,11 @@ __cxa_call_unexpected(void* exc_obj_in)
&new_ptr) != ctm_failed) &new_ptr) != ctm_failed)
__throw_exception_again; __throw_exception_again;
if (catch_type->__do_catch(&bad_exc, 0, 1)) // If the exception spec allows std::bad_exception, throw that.
// We don't have a thrown object to compare against, but since
// bad_exception doesn't have virtual bases, that's OK; just pass NULL.
void* obj = NULL;
if (catch_type->__do_catch(&bad_exc, &obj, 1))
bad_exception_allowed = true; bad_exception_allowed = true;
} }

View File

@ -378,6 +378,12 @@ PERSONALITY_FUNCTION (int version,
switch (state & _US_ACTION_MASK) switch (state & _US_ACTION_MASK)
{ {
case _US_VIRTUAL_UNWIND_FRAME: case _US_VIRTUAL_UNWIND_FRAME:
// If the unwind state pattern is
// _US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND
// then we don't need to search for any handler as it is not a real
// exception. Just unwind the stack.
if (state & _US_FORCE_UNWIND)
CONTINUE_UNWINDING;
actions = _UA_SEARCH_PHASE; actions = _UA_SEARCH_PHASE;
break; break;

View File

@ -62,6 +62,9 @@ __cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
{ {
PROBE2 (throw, obj, tinfo); PROBE2 (throw, obj, tinfo);
__cxa_eh_globals *globals = __cxa_get_globals ();
globals->uncaughtExceptions += 1;
// Definitely a primary. // Definitely a primary.
__cxa_refcounted_exception *header __cxa_refcounted_exception *header
= __get_refcounted_exception_header_from_obj (obj); = __get_refcounted_exception_header_from_obj (obj);

View File

@ -85,11 +85,11 @@ extern char **dupargv (char **) ATTRIBUTE_MALLOC;
/* Expand "@file" arguments in argv. */ /* Expand "@file" arguments in argv. */
extern void expandargv PARAMS ((int *, char ***)); extern void expandargv (int *, char ***);
/* Write argv to an @-file, inserting necessary quoting. */ /* Write argv to an @-file, inserting necessary quoting. */
extern int writeargv PARAMS ((char **, FILE *)); extern int writeargv (char **, FILE *);
/* Return the number of elements in argv. */ /* Return the number of elements in argv. */

View File

@ -183,7 +183,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
::usleep(__us); ::usleep(__us);
} }
# else # else
::sleep(__s.count() + (__ns >= 1000000)); ::sleep(__s.count() + (__ns.count() >= 1000000));
# endif # endif
#elif defined(_GLIBCXX_HAVE_WIN32_SLEEP) #elif defined(_GLIBCXX_HAVE_WIN32_SLEEP)
unsigned long ms = __ns.count() / 1000000; unsigned long ms = __ns.count() / 1000000;

View File

@ -37,7 +37,7 @@ namespace __gnu_internal _GLIBCXX_VISIBILITY(hidden)
{ {
using namespace __gnu_cxx; using namespace __gnu_cxx;
// Extern declarations for global objects in src/globals.cc. // Extern declarations for global objects in src/c++98/globals.cc.
extern stdio_sync_filebuf<char> buf_cout_sync; extern stdio_sync_filebuf<char> buf_cout_sync;
extern stdio_sync_filebuf<char> buf_cin_sync; extern stdio_sync_filebuf<char> buf_cin_sync;
extern stdio_sync_filebuf<char> buf_cerr_sync; extern stdio_sync_filebuf<char> buf_cerr_sync;