Skip to content

Commit 6f894d4

Browse files
Update libcxx to revision 187959, 2013-08-08.
1 parent 6c275be commit 6f894d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4865
-2387
lines changed

system/include/libcxx/CREDITS.TXT

+24
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ E: mclow.lists@gmail.com
3333
E: marshall@idio.com
3434
D: Minor patches and bug fixes.
3535

36+
N: Bill Fisher
37+
E: william.w.fisher@gmail.com
38+
D: Regex bug fixes.
39+
40+
N: Matthew Dempsky
41+
E: matthew@dempsky.org
42+
D: Minor patches and bug fixes.
43+
3644
N: Google Inc.
3745
D: Copyright owner and contributor of the CityHash algorithm
3846

@@ -48,6 +56,10 @@ N: Argyrios Kyrtzidis
4856
E: kyrtzidis@apple.com
4957
D: Bug fixes.
5058

59+
N: Bruce Mitchener, Jr.
60+
E: bruce.mitchener@gmail.com
61+
D: Emscripten-related changes.
62+
5163
N: Michel Morin
5264
E: mimomorin@gmail.com
5365
D: Minor patches to is_convertible.
@@ -74,6 +86,14 @@ D: Implemented Cityhash as the string hash function on 64-bit machines
7486
N: Richard Smith
7587
D: Minor patches.
7688

89+
N: Joerg Sonnenberger
90+
E: joerg@NetBSD.org
91+
D: NetBSD port.
92+
93+
N: Stephan Tolksdorf
94+
E: st@quanttec.com
95+
D: Minor <atomic> fix
96+
7797
N: Michael van der Westhuizen
7898
E: r1mikey at gmail dot com
7999

@@ -85,6 +105,10 @@ N: Zhang Xiongpang
85105
E: zhangxiongpang@gmail.com
86106
D: Minor patches and bug fixes.
87107

108+
N: Zhihao Yuan
109+
E: lichray@gmail.com
110+
D: Standard compatibility fixes.
111+
88112
N: Jeffrey Yasskin
89113
E: jyasskin@gmail.com
90114
E: jyasskin@google.com

system/include/libcxx/__bit_reference

+27-8
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
173173
__storage_type __b = *__first.__seg_ & __m;
174174
if (__b)
175175
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
176+
if (__n == __dn)
177+
return _It(__first.__seg_, __first.__ctz_ + __n);
176178
__n -= __dn;
177179
++__first.__seg_;
178180
}
@@ -207,6 +209,8 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
207209
__storage_type __b = ~*__first.__seg_ & __m;
208210
if (__b)
209211
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
212+
if (__n == __dn)
213+
return _It(__first.__seg_, __first.__ctz_ + __n);
210214
__n -= __dn;
211215
++__first.__seg_;
212216
}
@@ -333,7 +337,7 @@ __fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
333337
}
334338
// do middle whole words
335339
__storage_type __nw = __n / __bits_per_word;
336-
_VSTD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
340+
_VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), 0, __nw * sizeof(__storage_type));
337341
__n -= __nw * __bits_per_word;
338342
// do last partial word
339343
if (__n > 0)
@@ -363,7 +367,7 @@ __fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
363367
}
364368
// do middle whole words
365369
__storage_type __nw = __n / __bits_per_word;
366-
_VSTD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
370+
_VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), -1, __nw * sizeof(__storage_type));
367371
__n -= __nw * __bits_per_word;
368372
// do last partial word
369373
if (__n > 0)
@@ -430,7 +434,9 @@ __copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsCon
430434
// __first.__ctz_ == 0;
431435
// do middle words
432436
__storage_type __nw = __n / __bits_per_word;
433-
_VSTD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
437+
_VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
438+
_VSTD::__to_raw_pointer(__first.__seg_),
439+
__nw * sizeof(__storage_type));
434440
__n -= __nw * __bits_per_word;
435441
__result.__seg_ += __nw;
436442
// do last word
@@ -569,7 +575,9 @@ __copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_C
569575
__storage_type __nw = __n / __bits_per_word;
570576
__result.__seg_ -= __nw;
571577
__last.__seg_ -= __nw;
572-
_VSTD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
578+
_VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
579+
_VSTD::__to_raw_pointer(__last.__seg_),
580+
__nw * sizeof(__storage_type));
573581
__n -= __nw * __bits_per_word;
574582
// do last word
575583
if (__n > 0)
@@ -870,6 +878,7 @@ struct __bit_array
870878
{
871879
typedef typename _Cp::difference_type difference_type;
872880
typedef typename _Cp::__storage_type __storage_type;
881+
typedef typename _Cp::__storage_pointer __storage_pointer;
873882
typedef typename _Cp::iterator iterator;
874883
static const unsigned __bits_per_word = _Cp::__bits_per_word;
875884
static const unsigned _Np = 4;
@@ -880,9 +889,15 @@ struct __bit_array
880889
_LIBCPP_INLINE_VISIBILITY static difference_type capacity()
881890
{return static_cast<difference_type>(_Np * __bits_per_word);}
882891
_LIBCPP_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {}
883-
_LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__word_, 0);}
884-
_LIBCPP_INLINE_VISIBILITY iterator end() {return iterator(__word_ + __size_ / __bits_per_word,
885-
static_cast<unsigned>(__size_ % __bits_per_word));}
892+
_LIBCPP_INLINE_VISIBILITY iterator begin()
893+
{
894+
return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
895+
}
896+
_LIBCPP_INLINE_VISIBILITY iterator end()
897+
{
898+
return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
899+
static_cast<unsigned>(__size_ % __bits_per_word));
900+
}
886901
};
887902

888903
template <class _Cp>
@@ -1093,7 +1108,11 @@ private:
10931108
unsigned __ctz_;
10941109

10951110
public:
1096-
_LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT {}
1111+
_LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT
1112+
#if _LIBCPP_STD_VER > 11
1113+
: __seg_(nullptr), __ctz_(0)
1114+
#endif
1115+
{}
10971116

10981117
_LIBCPP_INLINE_VISIBILITY
10991118
__bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT

system/include/libcxx/__config

+62-15
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#ifndef _LIBCPP_CONFIG
1212
#define _LIBCPP_CONFIG
1313

14-
#ifndef _MSC_VER // explicit macro necessary because it is only defined below in this file
14+
#if !defined(_MSC_VER) || defined(__clang__)
1515
#pragma GCC system_header
1616
#endif
1717

@@ -56,19 +56,36 @@
5656
# endif // __LONG_LONG_SUPPORTED
5757
#endif // __FreeBSD__
5858

59+
#ifdef __NetBSD__
60+
# include <sys/endian.h>
61+
# if _BYTE_ORDER == _LITTLE_ENDIAN
62+
# define _LIBCPP_LITTLE_ENDIAN 1
63+
# define _LIBCPP_BIG_ENDIAN 0
64+
# else // _BYTE_ORDER == _LITTLE_ENDIAN
65+
# define _LIBCPP_LITTLE_ENDIAN 0
66+
# define _LIBCPP_BIG_ENDIAN 1
67+
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
68+
# define _LIBCPP_HAS_QUICK_EXIT
69+
#endif // __NetBSD__
70+
5971
#ifdef _WIN32
6072
# define _LIBCPP_LITTLE_ENDIAN 1
6173
# define _LIBCPP_BIG_ENDIAN 0
6274
// Compiler intrinsics (GCC or MSVC)
63-
# if (defined(_MSC_VER) && _MSC_VER >= 1400) \
75+
# if defined(__clang__) \
76+
|| (defined(_MSC_VER) && _MSC_VER >= 1400) \
6477
|| (defined(__GNUC__) && _GNUC_VER > 403)
65-
# define _LIBCP_HAS_IS_BASE_OF
78+
# define _LIBCPP_HAS_IS_BASE_OF
6679
# endif
80+
# if defined(_MSC_VER) && !defined(__clang__)
81+
# define _LIBCPP_MSVC // Using Microsoft Visual C++ compiler
82+
# endif
83+
# define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
6784
#endif // _WIN32
6885

6986
#ifdef __linux__
7087
# if defined(__GNUC__) && _GNUC_VER >= 403
71-
# define _LIBCP_HAS_IS_BASE_OF
88+
# define _LIBCPP_HAS_IS_BASE_OF
7289
# endif
7390
#endif
7491

@@ -116,7 +133,7 @@
116133
#endif
117134

118135
#ifndef _LIBCPP_INLINE_VISIBILITY
119-
# ifdef _MSC_VER
136+
# ifdef _LIBCPP_MSVC
120137
# define _LIBCPP_INLINE_VISIBILITY __forceinline
121138
# else // MinGW GCC and Clang
122139
# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
@@ -128,13 +145,17 @@
128145
#endif
129146

130147
#ifndef _LIBCPP_ALWAYS_INLINE
131-
# ifdef _MSC_VER
148+
# ifdef _LIBCPP_MSVC
132149
# define _LIBCPP_ALWAYS_INLINE __forceinline
133150
# endif
134151
#endif
135152

136153
#endif // _WIN32
137154

155+
#ifndef __has_attribute
156+
#define __has_attribute(__x) 0
157+
#endif
158+
138159
#ifndef _LIBCPP_HIDDEN
139160
#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
140161
#endif
@@ -212,7 +233,9 @@ typedef __char32_t char32_t;
212233
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
213234
#endif
214235

236+
#if !(__has_feature(cxx_defaulted_functions))
215237
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
238+
#endif // !(__has_feature(cxx_defaulted_functions))
216239

217240
#if !(__has_feature(cxx_deleted_functions))
218241
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
@@ -255,7 +278,7 @@ typedef __char32_t char32_t;
255278
#endif
256279

257280
#if __has_feature(is_base_of)
258-
# define _LIBCP_HAS_IS_BASE_OF
281+
# define _LIBCPP_HAS_IS_BASE_OF
259282
#endif
260283

261284
// Objective-C++ features (opt-in)
@@ -272,9 +295,19 @@ typedef __char32_t char32_t;
272295
#define _LIBCPP_HAS_NO_CONSTEXPR
273296
#endif
274297

275-
#if defined(__FreeBSD__) && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
298+
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
299+
#if defined(__FreeBSD__)
276300
#define _LIBCPP_HAS_QUICK_EXIT
277301
#define _LIBCPP_HAS_C11_FEATURES
302+
#elif defined(__linux__)
303+
#include <features.h>
304+
#if __GLIBC_PREREQ(2, 15)
305+
#define _LIBCPP_HAS_QUICK_EXIT
306+
#endif
307+
#if __GLIBC_PREREQ(2, 17)
308+
#define _LIBCPP_HAS_C11_FEATURES
309+
#endif
310+
#endif
278311
#endif
279312

280313
#if (__has_feature(cxx_noexcept))
@@ -368,7 +401,7 @@ namespace _LIBCPP_NAMESPACE {
368401
using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
369402
}
370403

371-
#elif defined(_MSC_VER)
404+
#elif defined(_LIBCPP_MSVC)
372405

373406
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
374407
#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
@@ -390,7 +423,7 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
390423
namespace std {
391424
}
392425

393-
#endif // __clang__ || __GNUC___ || _MSC_VER
426+
#endif // __clang__ || __GNUC__ || _LIBCPP_MSVC
394427

395428
#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
396429
typedef unsigned short char16_t;
@@ -418,8 +451,14 @@ template <unsigned> struct __static_assert_check {};
418451
#define _LIBCPP_CONSTEXPR constexpr
419452
#endif
420453

454+
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
455+
#define _LIBCPP_DEFAULT {}
456+
#else
457+
#define _LIBCPP_DEFAULT = default;
458+
#endif
459+
421460
#ifdef __GNUC__
422-
#define _NOALIAS __attribute__((malloc))
461+
#define _NOALIAS __attribute__((__malloc__))
423462
#else
424463
#define _NOALIAS
425464
#endif
@@ -451,7 +490,7 @@ template <unsigned> struct __static_assert_check {};
451490
#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
452491
#endif
453492

454-
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__)
493+
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) || defined(__NetBSD__)
455494
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
456495
#endif
457496
#ifdef __FreeBSD__
@@ -476,10 +515,18 @@ template <unsigned> struct __static_assert_check {};
476515
# endif
477516
#endif
478517

479-
#ifdef _LIBCPP_DEBUG2
480-
# include <__debug>
518+
#ifndef _LIBCPP_STD_VER
519+
# if __cplusplus <= 201103L
520+
# define _LIBCPP_STD_VER 11
521+
# else
522+
# define _LIBCPP_STD_VER 13 // current year, or date of c++14 ratification
523+
# endif
524+
#endif // _LIBCPP_STD_VER
525+
526+
#if _LIBCPP_STD_VER <= 11
527+
#define _LIBCPP_CONSTEXPR_AFTER_CXX11
481528
#else
482-
# define _LIBCPP_ASSERT(x, m) ((void)0)
529+
#define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
483530
#endif
484531

485532
#endif // _LIBCPP_CONFIG

system/include/libcxx/__debug

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424

2525
#if _LIBCPP_DEBUG_LEVEL >= 2
2626

27+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
28+
#pragma GCC system_header
29+
#endif
30+
2731
_LIBCPP_BEGIN_NAMESPACE_STD
2832

2933
struct _LIBCPP_TYPE_VIS __c_node;
@@ -171,7 +175,7 @@ public:
171175
bool __decrementable(const void* __i) const;
172176
bool __addable(const void* __i, ptrdiff_t __n) const;
173177
bool __subscriptable(const void* __i, ptrdiff_t __n) const;
174-
bool __comparable(const void* __i, const void* __j) const;
178+
bool __less_than_comparable(const void* __i, const void* __j) const;
175179
private:
176180
_LIBCPP_HIDDEN
177181
__i_node* __insert_iterator(void* __i);

0 commit comments

Comments
 (0)