aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-09-24 19:06:33 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-09-24 19:06:33 -0700
commit1ea039eea38dad37c5b0c836cf98829bad6013ce (patch)
tree6d851de99c00b4aa1c45624df570b5cb7f89fed5
parentdd0230c9cf09a7b19712a4acefe0ae27ea40ea85 (diff)
include libcxx
-rw-r--r--system/include/libcxx/LICENSE.txt76
-rw-r--r--system/include/libcxx/__bit_reference1245
-rw-r--r--system/include/libcxx/__config336
-rw-r--r--system/include/libcxx/__debug190
-rw-r--r--system/include/libcxx/__functional_032128
-rw-r--r--system/include/libcxx/__functional_base428
-rw-r--r--system/include/libcxx/__functional_base_031087
-rw-r--r--system/include/libcxx/__hash_table1916
-rw-r--r--system/include/libcxx/__locale1400
-rw-r--r--system/include/libcxx/__mutex_base437
-rw-r--r--system/include/libcxx/__split_buffer648
-rw-r--r--system/include/libcxx/__sso_allocator75
-rw-r--r--system/include/libcxx/__std_stream313
-rw-r--r--system/include/libcxx/__tree2291
-rw-r--r--system/include/libcxx/__tuple267
-rw-r--r--system/include/libcxx/__tuple_0325
-rw-r--r--system/include/libcxx/algorithm5352
-rw-r--r--system/include/libcxx/array336
-rw-r--r--system/include/libcxx/atomic1513
-rw-r--r--system/include/libcxx/bitset1046
-rw-r--r--system/include/libcxx/cassert23
-rw-r--r--system/include/libcxx/ccomplex27
-rw-r--r--system/include/libcxx/cctype159
-rw-r--r--system/include/libcxx/cerrno391
-rw-r--r--system/include/libcxx/cfenv80
-rw-r--r--system/include/libcxx/cfloat76
-rw-r--r--system/include/libcxx/chrono871
-rw-r--r--system/include/libcxx/cinttypes257
-rw-r--r--system/include/libcxx/ciso64623
-rw-r--r--system/include/libcxx/climits46
-rw-r--r--system/include/libcxx/clocale51
-rw-r--r--system/include/libcxx/cmath1574
-rw-r--r--system/include/libcxx/codecvt545
-rw-r--r--system/include/libcxx/complex1514
-rw-r--r--system/include/libcxx/complex.h33
-rw-r--r--system/include/libcxx/condition_variable254
-rw-r--r--system/include/libcxx/csetjmp50
-rw-r--r--system/include/libcxx/csignal56
-rw-r--r--system/include/libcxx/cstdarg46
-rw-r--r--system/include/libcxx/cstdbool30
-rw-r--r--system/include/libcxx/cstddef100
-rw-r--r--system/include/libcxx/cstdint189
-rw-r--r--system/include/libcxx/cstdio159
-rw-r--r--system/include/libcxx/cstdlib138
-rw-r--r--system/include/libcxx/cstring109
-rw-r--r--system/include/libcxx/ctgmath27
-rw-r--r--system/include/libcxx/ctime70
-rw-r--r--system/include/libcxx/cwchar195
-rw-r--r--system/include/libcxx/cwctype211
-rw-r--r--system/include/libcxx/deque2840
-rw-r--r--system/include/libcxx/exception248
-rw-r--r--system/include/libcxx/ext/__hash46
-rw-r--r--system/include/libcxx/ext/hash_map995
-rw-r--r--system/include/libcxx/ext/hash_set657
-rw-r--r--system/include/libcxx/forward_list1632
-rw-r--r--system/include/libcxx/fstream1394
-rw-r--r--system/include/libcxx/functional1997
-rw-r--r--system/include/libcxx/future2515
-rw-r--r--system/include/libcxx/initializer_list103
-rw-r--r--system/include/libcxx/iomanip502
-rw-r--r--system/include/libcxx/ios985
-rw-r--r--system/include/libcxx/iosfwd192
-rw-r--r--system/include/libcxx/iostream58
-rw-r--r--system/include/libcxx/istream1707
-rw-r--r--system/include/libcxx/iterator1802
-rw-r--r--system/include/libcxx/limits613
-rw-r--r--system/include/libcxx/list1676
-rw-r--r--system/include/libcxx/locale4503
-rw-r--r--system/include/libcxx/map1929
-rw-r--r--system/include/libcxx/memory4193
-rw-r--r--system/include/libcxx/mutex560
-rw-r--r--system/include/libcxx/new115
-rw-r--r--system/include/libcxx/numeric195
-rw-r--r--system/include/libcxx/ostream1293
-rw-r--r--system/include/libcxx/queue713
-rw-r--r--system/include/libcxx/random6599
-rw-r--r--system/include/libcxx/ratio477
-rw-r--r--system/include/libcxx/readme.txt1
-rw-r--r--system/include/libcxx/regex6413
-rw-r--r--system/include/libcxx/scoped_allocator576
-rw-r--r--system/include/libcxx/set1023
-rw-r--r--system/include/libcxx/sstream884
-rw-r--r--system/include/libcxx/stack288
-rw-r--r--system/include/libcxx/stdexcept160
-rw-r--r--system/include/libcxx/streambuf562
-rw-r--r--system/include/libcxx/string3977
-rw-r--r--system/include/libcxx/strstream398
-rw-r--r--system/include/libcxx/system_error641
-rw-r--r--system/include/libcxx/tgmath.h27
-rw-r--r--system/include/libcxx/thread444
-rw-r--r--system/include/libcxx/tuple940
-rw-r--r--system/include/libcxx/type_traits3077
-rw-r--r--system/include/libcxx/typeindex101
-rw-r--r--system/include/libcxx/typeinfo122
-rw-r--r--system/include/libcxx/unordered_map1793
-rw-r--r--system/include/libcxx/unordered_set1142
-rw-r--r--system/include/libcxx/utility582
-rw-r--r--system/include/libcxx/valarray4771
-rw-r--r--system/include/libcxx/vector3135
99 files changed, 100009 insertions, 0 deletions
diff --git a/system/include/libcxx/LICENSE.txt b/system/include/libcxx/LICENSE.txt
new file mode 100644
index 00000000..926f0676
--- /dev/null
+++ b/system/include/libcxx/LICENSE.txt
@@ -0,0 +1,76 @@
+==============================================================================
+libc++ License
+==============================================================================
+
+The libc++ library is dual licensed under both the University of Illinois
+"BSD-Like" license and the MIT license. As a user of this code you may choose
+to use it under either license. As a contributor, you agree to allow your code
+to be used under both.
+
+Full text of the relevant licenses is included below.
+
+==============================================================================
+
+University of Illinois/NCSA
+Open Source License
+
+Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT
+
+All rights reserved.
+
+Developed by:
+
+ LLVM Team
+
+ University of Illinois at Urbana-Champaign
+
+ http://llvm.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal with
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimers.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimers in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of the LLVM Team, University of Illinois at
+ Urbana-Champaign, nor the names of its contributors may be used to
+ endorse or promote products derived from this Software without specific
+ prior written permission.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+SOFTWARE.
+
+==============================================================================
+
+Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/system/include/libcxx/__bit_reference b/system/include/libcxx/__bit_reference
new file mode 100644
index 00000000..53d3c860
--- /dev/null
+++ b/system/include/libcxx/__bit_reference
@@ -0,0 +1,1245 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___BIT_REFERENCE
+#define _LIBCPP___BIT_REFERENCE
+
+#include <__config>
+#include <algorithm>
+
+#pragma GCC system_header
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _C, bool _IsConst> class __bit_iterator;
+template <class _C> class __bit_const_reference;
+
+template <class _Tp>
+struct __has_storage_type
+{
+ static const bool value = false;
+};
+
+template <class _C, bool = __has_storage_type<_C>::value>
+class __bit_reference
+{
+ typedef typename _C::__storage_type __storage_type;
+ typedef typename _C::__storage_pointer __storage_pointer;
+
+ __storage_pointer __seg_;
+ __storage_type __mask_;
+
+#if defined(__clang__)
+ friend typename _C::__self;
+#else
+ friend class _C::__self;
+#endif
+ friend class __bit_const_reference<_C>;
+ friend class __bit_iterator<_C, false>;
+public:
+ _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
+ {return static_cast<bool>(*__seg_ & __mask_);}
+ _LIBCPP_INLINE_VISIBILITY bool operator ~() const _NOEXCEPT
+ {return !static_cast<bool>(*this);}
+
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_reference& operator=(bool __x) _NOEXCEPT
+ {
+ if (__x)
+ *__seg_ |= __mask_;
+ else
+ *__seg_ &= ~__mask_;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_reference& operator=(const __bit_reference& __x) _NOEXCEPT
+ {return operator=(static_cast<bool>(__x));}
+
+ _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;}
+ _LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, false> operator&() const _NOEXCEPT
+ {return __bit_iterator<_C, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
+private:
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
+ : __seg_(__s), __mask_(__m) {}
+};
+
+template <class _C>
+class __bit_reference<_C, false>
+{
+};
+
+template <class _C, class _D>
+_LIBCPP_INLINE_VISIBILITY inline
+void
+swap(__bit_reference<_C> __x, __bit_reference<_D> __y) _NOEXCEPT
+{
+ bool __t = __x;
+ __x = __y;
+ __y = __t;
+}
+
+template <class _C>
+_LIBCPP_INLINE_VISIBILITY inline
+void
+swap(__bit_reference<_C> __x, bool& __y) _NOEXCEPT
+{
+ bool __t = __x;
+ __x = __y;
+ __y = __t;
+}
+
+template <class _C>
+_LIBCPP_INLINE_VISIBILITY inline
+void
+swap(bool& __x, __bit_reference<_C> __y) _NOEXCEPT
+{
+ bool __t = __x;
+ __x = __y;
+ __y = __t;
+}
+
+template <class _C>
+class __bit_const_reference
+{
+ typedef typename _C::__storage_type __storage_type;
+ typedef typename _C::__const_storage_pointer __storage_pointer;
+
+ __storage_pointer __seg_;
+ __storage_type __mask_;
+
+#if defined(__clang__)
+ friend typename _C::__self;
+#else
+ friend class _C::__self;
+#endif
+ friend class __bit_iterator<_C, true>;
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_const_reference(const __bit_reference<_C>& __x) _NOEXCEPT
+ : __seg_(__x.__seg_), __mask_(__x.__mask_) {}
+
+ _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
+ {return static_cast<bool>(*__seg_ & __mask_);}
+
+ _LIBCPP_INLINE_VISIBILITY __bit_iterator<_C, true> operator&() const _NOEXCEPT
+ {return __bit_iterator<_C, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
+private:
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
+ : __seg_(__s), __mask_(__m) {}
+
+ __bit_const_reference& operator=(const __bit_const_reference& __x);
+};
+
+// find
+
+template <class _C>
+__bit_iterator<_C, false>
+__find_bool_true(__bit_iterator<_C, false> __first, typename _C::size_type __n)
+{
+ typedef __bit_iterator<_C, false> _It;
+ typedef typename _It::__storage_type __storage_type;
+ static const unsigned __bits_per_word = _It::__bits_per_word;
+ // do first partial word
+ if (__first.__ctz_ != 0)
+ {
+ __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
+ __storage_type __dn = _VSTD::min(__clz_f, __n);
+ __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
+ __storage_type __b = *__first.__seg_ & __m;
+ if (__b)
+ return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
+ __n -= __dn;
+ ++__first.__seg_;
+ }
+ // do middle whole words
+ for (; __n >= __bits_per_word; ++__first.__seg_, __n -= __bits_per_word)
+ if (*__first.__seg_)
+ return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(*__first.__seg_)));
+ // do last partial word
+ if (__n > 0)
+ {
+ __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
+ __storage_type __b = *__first.__seg_ & __m;
+ if (__b)
+ return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
+ }
+ return _It(__first.__seg_, static_cast<unsigned>(__n));
+}
+
+templ