Commit Graph

700 Commits

Author SHA1 Message Date
Howard Hinnant ead480d30a Change _LIBCPP_TYPE_VIS to use __type_visibility__(default) instead of __visibility__(default) when available. This change makes just the type_info visible so that types like vectors and strings can be used as exception objects across dylib boundaries even when hidden visibility is specified globally (at the command line), and yet this allows clients to hide the member functions of things like vector and string (with global visibility commands).
llvm-svn: 176639
2013-03-07 19:25:03 +00:00
Howard Hinnant 6e41256f68 No functionality change at this time. I've split _LIBCPP_VISIBLE up into two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute.
llvm-svn: 176593
2013-03-06 23:30:19 +00:00
Howard Hinnant 65f58f3fe8 Have basic_istream::read call sgetn intead of sbumpc individual characters. This addresses http://llvm.org/bugs/show_bug.cgi?id=15427.
llvm-svn: 176573
2013-03-06 19:27:56 +00:00
Howard Hinnant 3fb6c6e50d Correct silly type-o. Thanks Richard.
llvm-svn: 176568
2013-03-06 18:16:12 +00:00
Howard Hinnant 53b9ee061f The bitset(unsigned long long) constructor was broken by the constexpr additions only on 32 bit platforms. Fixed. This addresses http://llvm.org/bugs/show_bug.cgi?id=15444.
llvm-svn: 176559
2013-03-06 17:30:26 +00:00
Howard Hinnant a9f698009f Alexey Samsonov: #ifdefs out undefined function in static build of libc++ w/o RTTI.
llvm-svn: 176026
2013-02-25 15:50:36 +00:00
Howard Hinnant c0c9748c11 Constrain bind operator()() to not exist if the call is not valid. Fixes http://llvm.org/bugs/show_bug.cgi?id=15295.
llvm-svn: 175774
2013-02-21 18:16:55 +00:00
Marshall Clow b6e5f854f5 Change the 'result_type' from unsigned to 'uint_fast32_t'. This eliminates truncation warnings on Linux
llvm-svn: 174669
2013-02-07 22:12:02 +00:00
Howard Hinnant aba500d633 Revert accidental check-in. These changes are probably good, but premature at this point.
llvm-svn: 174625
2013-02-07 15:31:44 +00:00
Howard Hinnant 804f9116e5 Michael van der Westhuizen: The attached patch add support for building against libc++abi and libcxxrt to CMake builds of libc++.
Usage (with the appropriate CC and CXX environment variables) is:
$ cmake -DLIBCXX_CXX_ABI=libcxxabi '-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=/home/michael/libcxxabi/include' ../libcxx
and:
$ cmake -DLIBCXX_CXX_ABI=libcxxrt '-DLIBCXX_LIBCXXRT_INCLUDE_PATHS=/home/michael/libcxxrt/src' ../libcxx

llvm-svn: 174623
2013-02-07 15:27:39 +00:00
Howard Hinnant d3d4356f6e Marcin Zalewski: Change the name of a template parameter in __copy_backward from _InputIterator to _BidirectionalIterator to better document the intent of the algorithm.
llvm-svn: 174544
2013-02-06 21:03:39 +00:00
Howard Hinnant 2446649c1e Saleem Abdulrasool: If errno is defined as volatile int, the qualifier differences can cause
template typename deductions on swap<> (used in string.cpp).  Use
decltype(errno) to replicate the type and qualifier information for holding the
errno value.  Because errno is expected to be assignable, there is no need to
use typename std::remove_const<decltype(errno)>::type to hold the value.

llvm-svn: 173172
2013-01-22 17:26:08 +00:00
Howard Hinnant ead15d1f95 Implement the ATOMIC_*_LOCK_FREE macros.
llvm-svn: 173084
2013-01-21 20:39:41 +00:00
Howard Hinnant 8d3e797444 Donated anonymously: This enables GCC 4.8.0 to build libc++.
llvm-svn: 173060
2013-01-21 17:26:55 +00:00
Howard Hinnant 3d7eb2f806 Optimize basic_ostream::write by having it call sputn instead of sputc.
llvm-svn: 172542
2013-01-15 17:22:03 +00:00
Howard Hinnant 980e7e7402 Make <cmath> classification macros work with integral types.
llvm-svn: 172461
2013-01-14 20:56:22 +00:00
Howard Hinnant 2153d69672 Fix a race in the construction of future. This fixes http://llvm.org/bugs/show_bug.cgi?id=14934.
llvm-svn: 172456
2013-01-14 20:01:24 +00:00
Howard Hinnant f1e633c154 Michael van der Westhuizen: Patches for Linux. Fixes http://llvm.org/bugs/show_bug.cgi?id=14648.
llvm-svn: 172435
2013-01-14 17:07:27 +00:00
Howard Hinnant 8d9aec8802 Fix exception safety bug in vector::push_back
llvm-svn: 172250
2013-01-11 20:36:59 +00:00
Howard Hinnant 114676622f atomic_bool was missing (just a typedef to atomic<bool>).
llvm-svn: 171498
2013-01-04 18:58:50 +00:00
Howard Hinnant 861f006d3f Klaas de Vries: Fix bug in libc++'s std::string::find_first_not_of.
llvm-svn: 171321
2012-12-31 20:09:48 +00:00
Chandler Carruth e70a813b59 Don't mark variadic functions as always inline -- they cannot in fact be
inlined.

Patch by Saleem Abdulrasool, reviewed by Michael Spencer and Richard Smith.

llvm-svn: 171276
2012-12-31 06:09:54 +00:00
Howard Hinnant a96d74585f Remove test for eof from istreambuf_iterator constructors. It is no longer necessary and potentially violates the constructor's noexcept spec.
llvm-svn: 171232
2012-12-29 17:45:42 +00:00
Howard Hinnant 3b42bdd58a Hyeon-Bin Jeong: readsome() need to reset gcount to zero. This fixes http://llvm.org/bugs/show_bug.cgi?id=14670.
llvm-svn: 170703
2012-12-20 15:40:28 +00:00
Richard Smith e3fbbccc0f Implement std::is_base_of for the case where we don't have a compiler
intrinsic. This relies upon the fact that overload resolution does not check
access and ambiguity for a derived-to-base conversion. This passes all
is_base_of tests in the test suite.

llvm-svn: 170662
2012-12-20 04:20:28 +00:00
Marshall Clow 36a60721ce Added static_assert to std::get<N>(std::array) calls to catch "out of bounds" calls
llvm-svn: 170435
2012-12-18 16:46:30 +00:00
Howard Hinnant 16694b5df5 Zhang Xiongpang: Add definitions for const data members. Fixes http://llvm.org/bugs/show_bug.cgi?id=14585.
llvm-svn: 170026
2012-12-12 21:14:28 +00:00
Richard Smith e1f363c724 Remove 'noreturn' attribute from friend declaration. This attribute will be
inherited from the previous out-of-class declaration, and attributes on friend
function declarations are ill-formed in C++11.

llvm-svn: 168853
2012-11-29 04:30:50 +00:00
Howard Hinnant f8b24cf5f7 Dimitry Andric: When using libc++ headers on FreeBSD, in combination with -std=c++98,
-ansi or -std=c++03, the long long type is not supported.  So in this
case, several functions and types, like lldiv_t, strtoll(), are not
declared.

llvm-svn: 168610
2012-11-26 21:18:17 +00:00
Howard Hinnant dfdf5085df istreambuf_iterator increment should call sbumpc instead of snextc. Patch
by Kimball Thurston.  This fixes http://llvm.org/bugs/show_bug.cgi?id=14358.

llvm-svn: 168209
2012-11-16 22:17:23 +00:00
Howard Hinnant b5c63a2e07 Restrict optimized __pad_and_output implementation detail to desired releases.
llvm-svn: 167980
2012-11-14 21:17:15 +00:00
Howard Hinnant 119703f984 Dimitry Andric: Silence some miscellaneous warnings.
llvm-svn: 167493
2012-11-06 21:55:44 +00:00
Howard Hinnant 3e2740a36c Dimitry Andric: Silence some warnings in <locale>.
llvm-svn: 167492
2012-11-06 21:48:33 +00:00
Howard Hinnant a01739a03a Enable the tuple interface of pair in C++03 mode.
llvm-svn: 167491
2012-11-06 21:42:45 +00:00
Howard Hinnant cd47cbc7a4 Provide a way to disable use of extern templates in libc++. This is intended for the clients of libc++, not the libc++ build. The dylib should always contain the extern templates. To disable the client needs to put -D'_LIBCPP_EXTERN_TEMPLATE(...)=' on the command line.
llvm-svn: 167486
2012-11-06 21:08:48 +00:00
Howard Hinnant 66e7ed959f peek should set eofbit if sgetc() returns eof.
llvm-svn: 167238
2012-11-01 17:32:07 +00:00
Howard Hinnant b304811686 Richard Smith: This fixes a problem in std::is_constructible for incomplete types, and those types with a user-defined operator,().
llvm-svn: 167233
2012-11-01 16:32:14 +00:00
Howard Hinnant 54d333a601 Rename uses of _ and __ because these are getting stepped on by macros from other system code.
llvm-svn: 167038
2012-10-30 19:06:59 +00:00
Howard Hinnant 6758190507 Use traits_type::to_int_type in basic_streambuf<_CharT, _Traits>::xsputn when calling overflow to correctly handle negative signed character types. This fixes http://llvm.org/bugs/show_bug.cgi?id=14074.
llvm-svn: 165884
2012-10-13 19:31:51 +00:00
Howard Hinnant 7ba8160360 Dimitry Andric: FreeBSD only: Add the C11 aligned_alloc to <cstdlib> and adjust the inclusion of quick_exit.
llvm-svn: 165882
2012-10-13 18:03:53 +00:00
Argyrios Kyrtzidis 88db3171dd Don't neglect to "return *this".
llvm-svn: 165860
2012-10-13 02:03:45 +00:00
Howard Hinnant f543a75be1 Holger Arnold: Correct the use and testing of __GNUC__ and __GNUC_MINOR__ in <__config>.
llvm-svn: 165151
2012-10-03 20:48:05 +00:00
Howard Hinnant 6e551ae1a3 Make vector::iterator and string::iterator more resilient against overly generic relational operators.
llvm-svn: 165033
2012-10-02 19:45:42 +00:00
Howard Hinnant 59fb5c6559 Due to a mistake on my own part, I need to burn some version numbers. This does not impact any of the implementation of libc++, and does not impact the ABI in any way.
llvm-svn: 164832
2012-09-28 17:42:25 +00:00
Howard Hinnant 324c084654 Bump _LIBCPP_VERSION to 1002
llvm-svn: 164700
2012-09-26 15:38:09 +00:00
Howard Hinnant 8e747d3671 Apply the emulated nullptr_t with constexpr. This is an unusual configuration that would take advantage of this. But it has popped up in the wild and does no harm to support it.
llvm-svn: 164575
2012-09-24 23:36:40 +00:00
Howard Hinnant c43826f003 Add overflow check to tanh(complex) and reduce to finite answer. Fixes http://llvm.org/bugs/show_bug.cgi?id=13874
llvm-svn: 164266
2012-09-19 23:51:47 +00:00
Howard Hinnant 92b5940fbb Overloaded __pad_and_output on ostreambuf_iterator and in this overload call sputn instead of dereferencing the iterator which calls sputc. This is intended to be purely a performance optimization, especially for clients who may have overloaded the virtual function xsputn.
llvm-svn: 164241
2012-09-19 19:14:15 +00:00
Howard Hinnant a0bc10dca6 Align <atomic> with clang r163964 which disallows const _Atomic types.
llvm-svn: 164004
2012-09-16 20:33:09 +00:00
Howard Hinnant aeb85680fb Dimitry Andric: many visibility fixes. Howard: Much appreciated. Can you send me a patch to CREDITS.TXT?
llvm-svn: 163862
2012-09-14 00:39:16 +00:00
Howard Hinnant ab303f7e47 Dimitry Andric: FreeBSD porting tweaks for PTHREAD_MUTEX_INITIALIZER and PTHREAD_COND_INITIALIZER
llvm-svn: 163626
2012-09-11 16:10:20 +00:00
Howard Hinnant 49713b442c Some minor mingw64 porting tweaks from Glen.
llvm-svn: 163120
2012-09-03 18:13:11 +00:00
Howard Hinnant aad745a024 Change sleep_for, sleep_until, and the condition_variable timed wait
functions to protect against duration and time_point overflow.  Since
we're about to wait anyway, we can afford to spend a few more cycles on
this checking.  I purposefully did not treat the timed try_locks with
overflow checking.  This fixes
http://llvm.org/bugs/show_bug.cgi?id=13721 .  I'm unsure if the standard
needs clarification in this area, or if this is simply QOI.  The
<chrono> facilities were never intended to overflow check, but just to
not overflow if durations stayed within +/- 292 years.

llvm-svn: 162925
2012-08-30 19:14:33 +00:00
Howard Hinnant 3320c058bf Hyeon-bin Jeong: libc++ fails to create any classes inherit from basic_ios if they
provided char type other than char or wchar_t. It throw exception during
construction, so there is no chance to imbue own ctype.

This fixes http://llvm.org/bugs/show_bug.cgi?id=13698

llvm-svn: 162648
2012-08-26 18:05:35 +00:00
Howard Hinnant e890ab2377 Michel Morin: My previous fix for C++03 was incomplete.
It does not consider user-defined conversions that convert an rvalue
into an lvalue and works incorrectly for types with such a conversion
operator.
For example, 

    struct foo
    {
        operator int&();
    };

 returns false_type. 
Attached a patch that fixes this problem. 
http://llvm.org/bugs/show_bug.cgi?id=13601

llvm-svn: 162644
2012-08-25 15:06:50 +00:00
Howard Hinnant dbbdd0c1f0 Have basic_istream seekg, putback and unget first clear eofbit. Fixes http://llvm.org/bugs/show_bug.cgi?id=13089.
llvm-svn: 162608
2012-08-24 22:03:03 +00:00
Howard Hinnant bfd96e11ed Hyeon-Bin Jeong: 1. sync() should reset it’s external buffer pointers.
Remaining characters should be discarded once sync() called. If don’t, garbage
characters can be inserted to the front of external buffer in underflow().
Because underflow() copies remaining characters in external buffer to it’s
front. This results wrong characters insertion when seekpos() or seekoff() is
called.

this line should be inserted in sync() just before return:
__extbufnext_ = __extbufend_ = __extbuf_;

2. sync() should use length() rather than out() to calculate offset.
Reversing iterators and calling out() to calculate offset from behind is
working fine in stateless character encoding. However, in stateful encoding,
escape sequences could differ in length. As a result, out() could return wrong
length. 

For example, if we have internal buffer converted from this external sequence:
(capital letters mean escape sequence)
… a a a a B b b b b

out() produces this sequence. 
b b b b A a a a a

Because out() inserts escape sequence A rather than B, result sequence doesn't
match to external sequence. A and B could have different lengths, result offset
could be wrong value too.

length() method in codecvt is right for calculating offset, but it counts
offset from the beginning of buffer. So it requires another state member
variable to hold state before conversion.
Fixes http://llvm.org/bugs/show_bug.cgi?id=13667

llvm-svn: 162601
2012-08-24 21:20:56 +00:00
Howard Hinnant 49a37bbb9f Fix basic_filebuf's internal buffer is shrinking when using with some codecvt. http://llvm.org/bugs/show_bug.cgi?id=13602
llvm-svn: 162585
2012-08-24 20:37:00 +00:00
Howard Hinnant 45c03a8f8d Fixed order of calling use_facet vs setbuf in basic_filebuf default constructor.
llvm-svn: 162571
2012-08-24 18:06:47 +00:00
Howard Hinnant cc27317a62 basic_filebuf needs to delay obtaining a codecvt facet from the global locale to give the client a chance to imbue the proper locale. Fixes http://llvm.org/bugs/show_bug.cgi?id=13663.
llvm-svn: 162567
2012-08-24 16:52:47 +00:00
Howard Hinnant a3b7a802cc In C++03 mode add an explicit conversion from int to the emulated class enum. Fixes a problem reported by C. Bergström.
llvm-svn: 162189
2012-08-19 17:14:47 +00:00
Howard Hinnant e4b2a743b8 Patch contributed by Dev Dude for mingw64 port.
llvm-svn: 162188
2012-08-19 15:13:16 +00:00
Howard Hinnant a0b42cacbf Apply patches supplied by Michel Morin in http://llvm.org/bugs/show_bug.cgi?id=13601 to correct bugs in is_convertible for the case that the intrinsic __is_convertible_to is not available.
llvm-svn: 162111
2012-08-17 17:54:11 +00:00
Howard Hinnant 7ee271360d Consistently label __bit_array as a struct, not a class.
llvm-svn: 162108
2012-08-17 17:10:18 +00:00
Howard Hinnant 4179da6a6a Patch constributed by Michel Moren in http://llvm.org/bugs/show_bug.cgi?id=13592 . Fixes is_convertible<From, To> when To is an abstract type.
llvm-svn: 161755
2012-08-13 12:29:17 +00:00
Howard Hinnant 1237dccaea std::equal operating on non-const __bit_iterators was not working. This fixes it.
llvm-svn: 161309
2012-08-05 21:43:11 +00:00
Howard Hinnant aca09de378 Performance tweaking rotate.
rotate is a critical algorithm because it is often used by other algorithms,
both std and non-std.  The main thrust of this optimization is a specialized
algorithm when the 'distance' to be shifted is 1 (either left or right).  To my
surprise, this 'optimization' was not effective for types like std::string.
std::string favors rotate algorithms which only use swap.  But for types like
scalars, and especially when the sequence is random access, these new
specializations are a big win.  If it is a vector<size_t> for example, the
rotate is done via a memmove and can be several times faster than the gcd
algorithm.

I'm using is_trivially_move_assignable to distinguish between types like int and
types like string.  This is obviously an ad-hoc approximation, but I haven't
found a case where it doesn't give good results.

I've used a 'static if' (with is_trivially_move_assignable) in three places. 
Testing with both -Os and -O3 showed that clang eliminated all code not be
executed by the 'static if' (including the 'static if' itself).

llvm-svn: 161247
2012-08-03 18:01:20 +00:00
Howard Hinnant d77851e837 Implement [util.smartptr.shared.atomic]. This is the last unimplemented
section in libc++.  This requires a recompiled dylib.  Failure to rebuild
the dylib will result in a link-time error if and only if the functions from
[util.smartptr.shared.atomic] are used.

The implementation is not lock free.  After considerable thought, I know of no
way to make the implementation lock free.  Ideas welcome along that front.  But
changing the ABI of shared_ptr is not on the table at this point.

The mutex used to lock these function is encapsulated by std::__sp_mut.  The
only thing the client knows about std::__sp_mut is that it has a void* data
member, can't be constructed, and has lock and unlock members.  Within the
binary __sp_mut is currently implemented as a pointer to a std::mutex.  That can
change in the future without disturbing the ABI (as long as sizeof(__sp_mut)
remains constant.

I specifically did not make __sp_mut a spin lock as I have a pathological
distrust of spin locks.  Testing on OS X reveals that the use of std::mutex in
this role is not a large performance penalty as long as the contention for the
mutex is low (more likely to get the lock than to have to wait).  In the future
we can still make __sp_mut a spin lock if that is what is desired (without ABI
damage).

The dylib contains 16 __sp_mut's to be chosen based on the hash of the address
of the shared_ptr.  The constant 16 is a ball-park reasonable space/time
tradeoff.

std::hash<T*> was changed to call __murmur2_or_cityhash, instead of the identity
function.  I had thought we had already done this, but I was mistaken.

All of this is under #if __has_feature(cxx_atomic) even though the
implementation is not lock free, because the signatures require access to
std::memory_order, which is currently available only under
__has_feature(cxx_atomic).

llvm-svn: 160940
2012-07-30 01:40:57 +00:00
Howard Hinnant c904ad4518 Patch by Andrew C. Morrow: shims to work around macroized getc and putc on linux. On my eglibc 2.13 based Debian system 'getc' is a macro defined in
/usr/include/stdio.h. This decision to make it a macro doesn't seem to
be guarded by any feature test macro as far as I can see.

llvm-svn: 160799
2012-07-26 20:01:13 +00:00
Howard Hinnant a1d07d57a7 <algorithm> no longer needs to include <cstdlib>, but can get away with just <cstddef>. This was brought to my attention by Salvatore Benedetto in his port to a bare-metal coretex-m3. This exposed two test bugs where an explicit #include <cstdlib> was needed.
llvm-svn: 160786
2012-07-26 17:09:09 +00:00
Howard Hinnant 6a03f169db locale::id really needs to be constructed at compile time.
llvm-svn: 160785
2012-07-26 16:14:37 +00:00
Richard Smith 535a86c3f8 libc++: switch from using _ATTRIBUTE(noreturn) (which conflicts with a
platform-provided macro on some systems) to _LIBCPP_NORETURN.

llvm-svn: 160773
2012-07-26 02:04:22 +00:00
Howard Hinnant 9d772d17b3 Apple LWG 2067: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3318.html#2067 . This is the only actionable change that has been made to the C++ draft since C++11. In general it has not been decided exactly how libc++ will track changes made to C++11. New features and design changes will probably be #ifdef'd, especially if they are not backwards compatible. Defects and 'dumb mistakes' are more likely to just be put in. Decisions on telling one from the other will be made on a case by case basis.
llvm-svn: 160608
2012-07-21 19:34:12 +00:00
Howard Hinnant a4820bc4d5 noexcept applied to <future>.
llvm-svn: 160607
2012-07-21 17:46:55 +00:00
Howard Hinnant 36101a5b0a noexcept applied to <thread>.
llvm-svn: 160606
2012-07-21 16:50:47 +00:00
Howard Hinnant 45c663db4e noexcept applied to <condition_variable>.
llvm-svn: 160605
2012-07-21 16:32:53 +00:00
Howard Hinnant 02e610ef34 noexcept and constexpr applied to <mutex>.
llvm-svn: 160604
2012-07-21 16:13:09 +00:00
Howard Hinnant 42be98ab54 noexcept and constexpr applied to <regex>.
llvm-svn: 160594
2012-07-21 01:31:58 +00:00
Howard Hinnant 5d926bf1b8 noexcept and constexpr applied to <ios>.
llvm-svn: 160593
2012-07-21 01:03:40 +00:00
Howard Hinnant bf882037be noexcept applied to <valarray>.
llvm-svn: 160592
2012-07-21 00:51:28 +00:00
Howard Hinnant f4e11de8e8 constexpr applied to <complex>.
llvm-svn: 160585
2012-07-20 22:18:27 +00:00
Howard Hinnant 00586de436 noexcept applied to <random>.
llvm-svn: 160579
2012-07-20 21:44:27 +00:00
Howard Hinnant 8e882dcb2e noexcept applied to <iterator>.
llvm-svn: 160565
2012-07-20 19:36:34 +00:00
Howard Hinnant 397717b7c8 constexpr applied to <array>.
llvm-svn: 160564
2012-07-20 19:20:49 +00:00
Howard Hinnant 931644bfec constexpr applied to <string>.
llvm-svn: 160563
2012-07-20 19:09:12 +00:00
Howard Hinnant 14c56f6c4a Further tweaks on relaxing complete type checking for function.
llvm-svn: 160562
2012-07-20 18:56:07 +00:00
Howard Hinnant 403845ba75 Relax the complete-type checks that are happening under __invokable<Fp, Args...> to only check Fp, and not Args... . This should be sufficient to give the desired high quality diagnostics under both bind and function. And this allows a test reported by Rich E on cfe-dev to pass. Tracked by <rdar://problem/11880602>.
llvm-svn: 160285
2012-07-16 16:17:34 +00:00
Howard Hinnant c033115394 Applied constexpr to <chrono>.
llvm-svn: 160184
2012-07-13 19:17:27 +00:00
Howard Hinnant 9146984e73 Fixed a bug in wstring_convert concerning zero-length inputs. Thanks to Jonathan Coxhead for reporting this bug.
llvm-svn: 160136
2012-07-12 18:07:41 +00:00
Howard Hinnant 598f702b04 Change emplace for vector and deque to create the temporary (when necessary) before any changes to the container are made. Nikolay Ivchenkov deserves the credit for pushing this problem and the solution for it.
llvm-svn: 159918
2012-07-08 23:23:04 +00:00
Howard Hinnant c0937e8add Appy constexpr to <memory>. Picked up a few missing noexcepts as well.
llvm-svn: 159902
2012-07-07 20:56:04 +00:00
Howard Hinnant bfa7990b5a Apply constexpr to the mutex constructor. As a conforming extension, apply constexpr to the condition_variable constructor. These are important because it enables the compiler to construct these types at compile time, even though the object will be non-const. Since they are constructed at compile time, there is no chance of a data race before they are constructed.
llvm-svn: 159901
2012-07-07 20:01:52 +00:00
Howard Hinnant eeac9fcfb7 Apply constexpr to <bitset>.
llvm-svn: 159899
2012-07-07 17:04:52 +00:00
Howard Hinnant 8a9ee14803 Apply noexcept to tuple.
llvm-svn: 159865
2012-07-06 21:53:48 +00:00
Howard Hinnant a0f4c45c38 As a conforming extension give tuple a noexcept default constructor conditionalized on its held types.
llvm-svn: 159858
2012-07-06 20:50:27 +00:00
Howard Hinnant a62ebe043e Give tuple a constexpr default constructor.
llvm-svn: 159857
2012-07-06 20:39:45 +00:00
Howard Hinnant 9d6d1c6860 Apply noexcept to those functions implemented in <cstdlib> as a conforming extension.
llvm-svn: 159850
2012-07-06 19:16:56 +00:00
Howard Hinnant 9c14b75a37 Apply noexcept to those functions implemented in <cmath> as a conforming extension.
llvm-svn: 159849
2012-07-06 19:13:50 +00:00
Howard Hinnant 4cb38a82a2 This commit establishes a new bucket_count policy in the unordered containers: The policy now allows a power-of-2 number of buckets to be requested (and that request honored) by the client. And if the number of buckets is set to a power of 2, then the constraint of the hash to the number of buckets uses & instead of %. If the client does not specify a number of buckets, then the policy remains unchanged: a prime number of buckets is selected. The growth policy is that the number of buckets is roughly doubled when needed. While growing, either the prime, or the power-of-2 strategy will be preserved. There is a small run time cost for putting in this switch. For very cheap hash functions, e.g. identity for int, the cost can be as high as 18%. However with more typical use cases, e.g. strings, the cost is in the noise level. I've measured cases with very cheap hash functions (int) that using a power-of-2 number of buckets can make look up about twice as fast. However I've also noted that a power-of-2 number of buckets is more susceptible to accidental catastrophic collisions. Though I've also noted that accidental catastrophic collisions are also possible when using a prime number of buckets (but seems far less likely). In short, this patch adds an extra tuning knob for those clients trying to get the last bit of performance squeezed out of their hash containers. Casual users of the hash containers will not notice the introduction of this tuning knob. Those clients who swear by power-of-2 hash containers can now opt-in to that strategy. Clients who prefer a prime number of buckets can continue as they have.
llvm-svn: 159836
2012-07-06 17:31:14 +00:00
Nuno Lopes 6317bfb26a mark operator new(std::nothrow) as noalias (aka __attribute__((malloc))
llvm-svn: 159359
2012-06-28 16:47:34 +00:00
Howard Hinnant f08ebab2ea Fixed a bug regarding result_of reported by Sven Behne. The fix is C++11 only mainly because result_of is a variadic beast and working with variadics is just such a problem in C++03 mode. This should bring result_of up to full conformance with the C++11 spec.
llvm-svn: 159211
2012-06-26 17:37:15 +00:00
Howard Hinnant c418654096 Revert pair constructors back to using is_convertible instead of is_constructible. This should pull things into alignment with the final draft. Fixes http://llvm.org/bugs/show_bug.cgi?id=13063#add_comment.
llvm-svn: 158280
2012-06-09 20:01:23 +00:00
Howard Hinnant 4c0de496a0 Fix dangling else clause. Bug found and fixed by Dimitry Andric.
llvm-svn: 157779
2012-05-31 23:12:03 +00:00
Howard Hinnant 78b4015c1c Fix the new _ALIGNAS_TYPE per instructions supplied by Eli Friedman.
llvm-svn: 157765
2012-05-31 20:14:00 +00:00
Howard Hinnant bf33f5b292 Protect use of alignas against older versions of clang
llvm-svn: 157764
2012-05-31 19:31:14 +00:00
Howard Hinnant 8b805c915a The rules for emplace in map, multimap, unordered_map and unordered_multimap changed a while back and I'm just now updating to these new rules. In a nutshell, you've got to know you're emplacing to a pair and use one of pair's constructors. I made one extension: If you want to emplace the key and default construct the mapped_type, you can just emplace(key), as opposed to emplace(piecewise_construct, forward_as_tuple(key), forward_as_tuple()).
llvm-svn: 157503
2012-05-25 22:04:21 +00:00
Howard Hinnant a960edd203 Fix memory corruption bug found and fixed by Andrew C. Morrow.
llvm-svn: 157476
2012-05-25 15:55:46 +00:00
Howard Hinnant ed81e910bd Revert fix to http://llvm.org/bugs/show_bug.cgi?id=12867 for the reason now included in the code comment.
llvm-svn: 157128
2012-05-19 20:20:49 +00:00
Douglas Gregor a336f5e645 Revert my _LIBCPP_INLINE_VISIBILITY changes, r157097 and r157107
llvm-svn: 157108
2012-05-19 07:14:17 +00:00
Douglas Gregor a1b6937dba valarray resize should not be _LIBCPP_INLINE_VISIBILITY
llvm-svn: 157107
2012-05-19 07:01:14 +00:00
Douglas Gregor 8f69b1af3d Move _LIBCPP_VISIBLE_INLINE from the out-of-line definitions of member
functions to the original declarations, so that Clang will actually
see them. Part of <rdar://problem/11489333>.

llvm-svn: 157097
2012-05-19 04:41:25 +00:00
Howard Hinnant 9042d623bf Protect __shared_weak_count::__get_deleter declaration with _LIBCPP_NO_RTTI. Fixes http://llvm.org/bugs/show_bug.cgi?id=12867
llvm-svn: 157049
2012-05-18 13:06:21 +00:00
Howard Hinnant 423a8d7733 Fix several bugs in find/count specialized for bits.
llvm-svn: 156546
2012-05-10 14:55:00 +00:00
Howard Hinnant 19d9cbfb39 Add friends __count_bool_true and __count_bool_false to __bit_iterator.
llvm-svn: 156543
2012-05-10 14:01:40 +00:00
Howard Hinnant 0ae9efeb1a SFINAE __bit_iterator such that it will only get instantiated with a container that has the nested type __storage_type. This prevents accidental instantiation such as in http://llvm.org/bugs/show_bug.cgi?id=12755. This fixes http://llvm.org/bugs/show_bug.cgi?id=12755.
llvm-svn: 156308
2012-05-07 16:50:38 +00:00
Howard Hinnant df7aad41fd Constrain __bind functor constructor such that it won't accidentally get used as a copy constructor from a non-const lvalue. Fixes <rdar://problem/11359080>.
llvm-svn: 156182
2012-05-04 17:21:02 +00:00
Howard Hinnant 9acfc3af72 Change std::abs from a template function to three overloads for float, double and long double.
llvm-svn: 156064
2012-05-03 14:58:34 +00:00
Howard Hinnant bff1bfc6be Greatly scale back ambitions of emulating move semantics in C++03 mode. It was causing more problems than it solved. This fixes http://llvm.org/bugs/show_bug.cgi?id=12704.
llvm-svn: 155918
2012-05-01 15:37:54 +00:00
Howard Hinnant d01320c200 Apply noexcept and constexpr to <atomic>.
llvm-svn: 154526
2012-04-11 20:14:21 +00:00
Richard Smith 766e8ccbfc Switch libc++ from __atomic_* builtins to __c11_atomic_* builtins.
Per discussion with Howard, we are not interested in maintaining
compatibility with older versions of clang.

All tests pass with ToT clang, except for two which assert due to
a pre-existing, unrelated bug.

llvm-svn: 154521
2012-04-11 18:55:46 +00:00
David Chisnall cd42f9446b Now that clang supports doing the right thing with regard to atomic
initialisation, do the right thing with regard to atomic initialisation.

Note: clang r154507 or later required for <atomic> to work now.
llvm-svn: 154508
2012-04-11 17:26:23 +00:00
David Chisnall c5d5a98815 Fix use of __atomic_is_lock_free() intrinsic.
llvm-svn: 154093
2012-04-05 13:13:24 +00:00
Howard Hinnant 7e5b4c9328 Put std::piecewise_construct_t back into the dylib for ABI stability. When clients are in C++11/constexpr mode this will be safely ignored because piecewise_construct is then declared with internal linkage.
llvm-svn: 153981
2012-04-03 23:45:46 +00:00
Howard Hinnant b2e9f19caf constexpr support for <utility>. Patch contributed by Jonathan Sauer.
llvm-svn: 153968
2012-04-03 21:09:48 +00:00
Howard Hinnant e386b7b360 Update <random> with constexpr support. Patch contributed by Jonathan Sauer.
llvm-svn: 153896
2012-04-02 21:00:45 +00:00
Howard Hinnant 338eb3116c Update <limits> with constexpr support. Patch contributed by Jonathan Sauer.
llvm-svn: 153888
2012-04-02 19:23:15 +00:00
Howard Hinnant 788c9979d9 This is an initial commit of constexpr support as proposed by Richard Smith. This by no means completes constexpr support. Indeed, it hardly scratches the surface. All it does is lay the foundation in <__config> and changes those few places in the library that are already using that foundation.
llvm-svn: 153856
2012-04-02 00:40:41 +00:00
Howard Hinnant 0527c6207a I believe tuple is still under development in the standard. Daniel Krugler is/will be making convincing arguments that a modified form of LWG 2051 (currently NAD Future) is easily acheivable and desirable. He has demonstrated that a tuple<T...> where all of the T are implicitly convertible from U... should have a tuple constructor that is also implicit, instead of explicit. This would support the use cases in LWG 2051 while not undermining T... with explicit conversions from U.... This check-in is an experimental implementation of Daniel's work. I believe this work to be mature enough to warrant inclusion into libc++. If anyone sees real-world problems that this check in causes, please let me know and I will revert it, and provide the feedback to the LWG.
llvm-svn: 153855
2012-04-01 23:10:42 +00:00
Howard Hinnant cb16c68042 It appears that the standard accidentally removed the default constructor for error_category. I'm putting it back in. This fixes http://llvm.org/bugs/show_bug.cgi?id=12321.
llvm-svn: 153194
2012-03-21 16:18:57 +00:00
David Chisnall 5f13d66fb4 Make sure [at_]quick_exit is in std::
llvm-svn: 152717
2012-03-14 14:10:37 +00:00
Jeffrey Yasskin 9c95b19f9e Fix moneypunct_byname algorithm to more accurately represent C locales in C++.
llvm-svn: 152501
2012-03-10 18:31:43 +00:00
Howard Hinnant 8d5df9b9d4 Change some smart_ptr == 0 to smart_ptr == nullptr. Fixes http://llvm.org/bugs/show_bug.cgi?id=12185.
llvm-svn: 152240
2012-03-07 20:37:43 +00:00
David Chisnall 04e5ce2bc1 Define _WCHAR_T in solaris/wchar.h. This fixes a bug where Solaris 10 headers
try to define C++ keywords as typedefs (fixed in Solaris 11).

llvm-svn: 151890
2012-03-02 10:56:04 +00:00
David Chisnall 55661e7305 Fix MSVC / Sun #ifdef ordering. Remove another #if-nothing-#endif.
Sorry for the churn.

llvm-svn: 151731
2012-02-29 16:41:21 +00:00
David Chisnall 40d7a8acff Remove a spurious #ifdef / #endif pair with nothing between them.
llvm-svn: 151729
2012-02-29 16:22:33 +00:00
David Chisnall 06af2bbb04 Add support files required for building on Solaris.
llvm-svn: 151721
2012-02-29 13:17:28 +00:00
David Chisnall 14c25b80e9 Solaris port. Currently sees around 200 test failures, mostly related to
Solaris not providing some of the locales that the test suite uses.

Note: This depends on an xlocale (partial) implementation for Solaris and a
couple of fixed standard headers.  These will be committed to a branch later
today.

llvm-svn: 151720
2012-02-29 13:05:08 +00:00
David Chisnall ca78592c16 Don't define __locale_raii if we are not going to be using it.
llvm-svn: 151718
2012-02-29 13:00:07 +00:00
Howard Hinnant 9bb1429f20 Reduce the number of move constructions when constructing a std::function. This fixes http://llvm.org/bugs/show_bug.cgi?id=12105.
llvm-svn: 151652
2012-02-28 19:47:38 +00:00
Howard Hinnant 9ffe10106e vector::emplace_back was mistakenly requiring move assignable. Fixed that and did a little drive-by optimization at the same time. This fixes http://llvm.org/bugs/show_bug.cgi?id=12085.
llvm-svn: 151492
2012-02-26 15:30:12 +00:00
Howard Hinnant 8d01935c09 Hook up to the new clang __is_trivially_constructible and __is_trivially_assignable traits. Fixes r10925427 and http://llvm.org/bugs/show_bug.cgi?id=12038.
llvm-svn: 151406
2012-02-24 23:32:26 +00:00
Howard Hinnant f2f2d8b98d Modernize conversion to bool to the explicit bool conversion operator (library wide). This fixes http://llvm.org/bugs/show_bug.cgi?id=12058.
llvm-svn: 151088
2012-02-21 21:46:43 +00:00
Howard Hinnant 67f3964766 Modernize relational operators for shared_ptr and unique_ptr. This includes adding support for nullptr, and using less<T*>. Fixes http://llvm.org/bugs/show_bug.cgi?id=12056.
llvm-svn: 151084
2012-02-21 21:02:58 +00:00
Bob Wilson a4fd70ea77 Add missing newlines at EOF.
llvm-svn: 150965
2012-02-20 16:56:13 +00:00
Howard Hinnant 2a9a072485 Give the emulated nullptr_t a default constructor.
llvm-svn: 150893
2012-02-18 22:01:22 +00:00
Howard Hinnant f9c73f6629 Use __is_polymorphic if available. This fixes http://llvm.org/bugs/show_bug.cgi?id=11983 . Patch contributed by Jonathan Sauer.
llvm-svn: 150614
2012-02-15 20:47:11 +00:00
Howard Hinnant fa8df7db88 tuple was accidentally lacking a valid copy assignment operator. It went undetected because I had failed to test assigning from a const lvalue. This fixes http://llvm.org/bugs/show_bug.cgi?id=11921
llvm-svn: 150613
2012-02-15 20:13:52 +00:00
Howard Hinnant 6560953383 Do not parse sign if a sign is not the next legal character when parsing floating point from an input stream. Fixes http://llvm.org/bugs/show_bug.cgi?id=11871
llvm-svn: 150609
2012-02-15 19:19:37 +00:00
Howard Hinnant 2aa9a38b67 Another stab at fixing http://llvm.org/bugs/show_bug.cgi?id=12007. I earlier missed that there are two common_type definitions and corrected only one of them.
llvm-svn: 150599
2012-02-15 18:08:09 +00:00
Howard Hinnant 425e44d192 Remove reference from common_type definition. It looks like a recent clang decltype implementation got fixed/improved and exposed this. Fixes http://llvm.org/bugs/show_bug.cgi?id=12007.
llvm-svn: 150581
2012-02-15 15:08:30 +00:00
Howard Hinnant 9741d6c96e Implement a few optimizations for vector push_back and insert. Fixes r10828365.
llvm-svn: 150542
2012-02-15 00:41:34 +00:00
Howard Hinnant e586ac735d Provide a move(const T&) overload for C++03 mode to enable moving from rvalues. This is to support proxy references. Fixes r10858112.
llvm-svn: 150488
2012-02-14 16:03:09 +00:00
Howard Hinnant 21fa1887e0 Enable full functionality of shared_ptr<const void> by adding allocator<const void>. Credit to John Hurley for discovering this bug.
llvm-svn: 148508
2012-01-19 23:15:22 +00:00
Howard Hinnant c37917f309 Fix http://llvm.org/bugs/show_bug.cgi?id=11752
llvm-svn: 148069
2012-01-12 23:37:51 +00:00
Howard Hinnant a04d2b3330 Fix http://llvm.org/bugs/show_bug.cgi?id=11734
llvm-svn: 147853
2012-01-10 15:15:47 +00:00
Howard Hinnant 8e25104b10 1. Fix make_shared<const T>. 2. Allow allocator<const T> as an extension. 3. Refactor work which fixed unique_ptr<const T[]>. 4. Remove no-longer-needed private declarations from unique_ptr. 5. Add constraints to some shared_ptr and weak_ptr constructors and assignment operators so that is_constructible/is_assignable give the correct answers for shared_ptr and weak_ptr. 6. Make defensive preparations in the shared_ptr free functions for the introduction of shared_ptr<T[]> in the future. 7. As an optimization, add move constructor and move assignment to weak_ptr.
llvm-svn: 147437
2012-01-02 17:56:02 +00:00
Howard Hinnant b34b48196c The exception recovery mechanism for the uninitialized_* algorithms did not work for iterators into discontiguous memory.
llvm-svn: 147343
2011-12-29 17:45:35 +00:00
Howard Hinnant a87b5e3446 Fix http://llvm.org/bugs/show_bug.cgi?id=11616
llvm-svn: 146881
2011-12-19 17:58:44 +00:00
David Chisnall 18e33935f3 Some fixes to <atomic> operations to explicitly use atomic types and operations.
The integral types now work with clang trunk (if you remove the guard), although we're still missing an intrinsic for initialising atomics (needed for C1x too).

Howard: Please review.
llvm-svn: 146865
2011-12-19 11:44:20 +00:00
Howard Hinnant e4097ad7e6 Allow unique_ptr<T const []> to be constructed and assigned from a unique_ptr<T[]>
llvm-svn: 146853
2011-12-18 21:19:44 +00:00
Howard Hinnant d6f44b6601 Allow unique_ptr<T const []> to be constructed with a T* (in addition to a const T*)
llvm-svn: 146736
2011-12-16 15:37:23 +00:00
Howard Hinnant a1a9e77122 As an extension, support incomplete types in the unordered containers to match what we already do in the associative containers.
llvm-svn: 146376
2011-12-12 17:26:24 +00:00
Howard Hinnant 42b8bb5033 Fix http://llvm.org/bugs/show_bug.cgi?id=11461. Credit Alberto Ganesh Barbati.
llvm-svn: 146345
2011-12-11 20:31:33 +00:00
Howard Hinnant 53d2fb0aa2 Installation of CityHash by Craig Silverstein
llvm-svn: 146329
2011-12-10 20:28:56 +00:00
Howard Hinnant f3d14a65ca Starting using murmur2 when combining multiple size_t's into a single hash, and also for basic_string. Also made hash<thread::id> ever so slighly more portable. I had to tweak one test which is questionable (definitely not portable) anyway.
llvm-svn: 145795
2011-12-05 00:08:45 +00:00
Howard Hinnant 9b0cd149aa Version #next on the hash functions for scalars. This builds on Dave's work, extends it to T*, and changes the way double and long double are handled (no longer convert to float on 32 bit). I also picked up a minor bug with uninitialized bits on the upper end of size_t when sizeof(size_t) > sizeof(T), e.g. in hash<float>. Most of the functionality has been put in one place: __scalar_hash in <memory>. Unfortunately I could not reuse __scalar_hash for hash<long double> on x86 because of the padding bits which need to be zeroed. I didn't want to add this zeroing step to the more general __scalar_hash when it isn't needed (in the absence of padding bits). I'm not ignoring the hash<string> issue (possibly changing that to a better hash). I just haven't gotten there yet.
llvm-svn: 145778
2011-12-03 21:11:36 +00:00
Howard Hinnant 7f3884d58a I had picked up the wrong version of DaveZ's hash patches. Corrected here.
llvm-svn: 145728
2011-12-02 23:45:22 +00:00
Howard Hinnant 425d482c21 Fixes to hash for long long, unsigned long long, float, double and long double. Credit Dave Zarzycki
llvm-svn: 145721
2011-12-02 22:52:09 +00:00
Howard Hinnant 132bd622cf Fix http://llvm.org/bugs/show_bug.cgi?id=11459. Patch supplied by Alberto Ganesh Barbati.
llvm-svn: 145703
2011-12-02 20:41:47 +00:00
Howard Hinnant 75689c1018 Fix http://llvm.org/bugs/show_bug.cgi?id=11428. Fix provided by Alberto Ganesh Barbati
llvm-svn: 145698
2011-12-02 19:36:40 +00:00
Howard Hinnant a5bc2f877f Jean-Daniel: __builtin_popcountll support for Windows
llvm-svn: 145684
2011-12-02 17:22:38 +00:00
Howard Hinnant c206366fd7 Quash a whole bunch of warnings
llvm-svn: 145624
2011-12-01 20:21:04 +00:00
Howard Hinnant c003db1fca Further macro protection by replacing _[A-Z] with _[A-Z]p
llvm-svn: 145410
2011-11-29 18:15:50 +00:00
Howard Hinnant ab4f438239 Add protection from min/max macros
llvm-svn: 145407
2011-11-29 16:45:27 +00:00
Howard Hinnant 1c2c87c502 Remove redundant iterator assignment detected by Marshall Clow
llvm-svn: 145265
2011-11-28 19:49:26 +00:00
David Chisnall 5e8e0448c3 On FreeBSD, define a macro that causes the unimplemented C99 math.h functions to be declared. This prevents <cmath> users from being broken, unless they actually use the C++ wrappers that call the missing functions.
llvm-svn: 144501
2011-11-13 17:15:33 +00:00
Howard Hinnant 05e485879c Fix ratio arithmetic with zero
llvm-svn: 143519
2011-11-01 23:13:37 +00:00
Howard Hinnant 9563a09cee Windows port work by Ruben Van Boxem
llvm-svn: 143105
2011-10-27 16:24:42 +00:00
Howard Hinnant 0176bc6cf5 Fixed bug in __independent_bits_engine found by Nick (from stackoverflow)
llvm-svn: 143104
2011-10-27 16:12:10 +00:00
Howard Hinnant e4383379ae More windows port work by Ruben Van Boxem
llvm-svn: 142732
2011-10-22 20:59:45 +00:00
Howard Hinnant 8bece6fe69 Windows port work by Ruben Van Boxem
llvm-svn: 142578
2011-10-20 12:49:21 +00:00
Howard Hinnant a892966218 de-tabbify
llvm-svn: 142237
2011-10-17 20:08:59 +00:00
Howard Hinnant 073458b1ab Windows support by Ruben Van Boxem.
llvm-svn: 142235
2011-10-17 20:05:10 +00:00
Howard Hinnant 7ba930bfca Fix http://llvm.org/bugs/show_bug.cgi?id=11113
llvm-svn: 141714
2011-10-11 21:28:38 +00:00
Howard Hinnant a33d4bc1ff Starting on musl port by Arvid Picciani
llvm-svn: 141672
2011-10-11 16:00:46 +00:00
Howard Hinnant 1ed7df111b Fix <rdar://problem/10256836> getline of an empty string mistakenly causes failure
llvm-svn: 141506
2011-10-09 15:20:46 +00:00
Howard Hinnant 2a4812fd04 Fix <rdar://problem/10255403> match_results::begin() is off by one
llvm-svn: 141494
2011-10-08 14:36:16 +00:00
Howard Hinnant 1e31e53fe1 Fix <rdar://problem/10226704>
llvm-svn: 141054
2011-10-04 01:25:20 +00:00
Howard Hinnant 2c0a65ee78 Fix <rdar://problem/10217868>.
llvm-svn: 140907
2011-10-01 00:26:36 +00:00
Howard Hinnant 8909cdfff9 Windows port work by Ruben Van Boxem
llvm-svn: 140805
2011-09-29 20:33:10 +00:00
Howard Hinnant 0c06e58fae Windows patch work by Ruben Van Boxem
llvm-svn: 140781
2011-09-29 13:33:15 +00:00
Howard Hinnant 9978e3709f Attempted locale refactoring. _LIBCPP_LOCALE__L_EXTENSIONS now should be defined if one has all of the xxx_l() functions. I've defined this for apple, freebsd and win32. _LIBCPP_HAS_DEFAULTRUNELOCALE should be defined if there is a _DefaultRuneLocale. I've defined this for apple and freebsd. The block of code we're trying to migrate away from is now under #ifdef __linux__. I've tested only on OS X. I hope I haven't broken things too badly elsewhere. Please let me know.
llvm-svn: 140734
2011-09-28 23:39:33 +00:00
Howard Hinnant 3438889dec Work on Windows port by Ruben Van Boxem
llvm-svn: 140728
2011-09-28 21:39:20 +00:00
Howard Hinnant 0470a63776 Attempt to enable locale simplification. On which platforms can we now #define _LIBCPP_STABLE_APPLE_ABI?
llvm-svn: 140724
2011-09-28 21:05:01 +00:00
Howard Hinnant 920b56ca88 Another installment on debug mode. This addresses list. However this should be considered a temporary state. The API of the debug database and how vector and list use it, is unsatisfactory at the moment. It is both inefficient and overly verbose. I wanted to get this functionality checked in though. In the next day or so I'll refactor what is there in an attempt to streamline things.
llvm-svn: 140660
2011-09-27 23:55:03 +00:00
Howard Hinnant dbe8111948 Work on Windows port by Ruben Van Boxem
llvm-svn: 140384
2011-09-23 16:11:27 +00:00
Howard Hinnant 3c78ca07bc Partial Windows port by Ruben Van Boxem
llvm-svn: 140328
2011-09-22 19:10:18 +00:00
David Chisnall 89728139cb Fixes for FreeBSD, including some fairly obvious copy-and-paste errors.
libc++ now mostly works on FreeBSD with libcxxrt and this patch applied to the base system:

http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110920/e666632c/xlocale-0001.obj

Summary of tests on FreeBSD:


****************************************************
Results for /root/libcxx/test:
using FreeBSD clang version 3.0 (trunk 135360) 20110717
Target: x86_64-unknown-freebsd9.0
Thread model: posix
with -std=c++0x -stdlib=libc++ -I/root/libcxx/include -L/root/libcxx/build/lib
----------------------------------------------------
sections without tests   : 1
sections with failures   : 48
sections without failures: 1015
                       +   ----
total number of sections : 1064
----------------------------------------------------
number of tests failed   : 145
number of tests passed   : 4179
                       +   ----
total number of tests    : 4324
****************************************************

(Many due to this clang version not supporting C++ atomics)

More fixes to follow...

llvm-svn: 140245
2011-09-21 08:39:44 +00:00
Howard Hinnant c756bb3574 Chris Jefferson noted that vector iterator ownership can be transferred from source to target under move construction and move assignment. This commit makes that happen for debug mode.
llvm-svn: 140023
2011-09-19 16:34:29 +00:00
Howard Hinnant cdcfbf26dc Removed unneeded boost implementation of is_base_of
llvm-svn: 140014
2011-09-19 13:19:31 +00:00