summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
* Holger Arnold: Correct the use and testing of __GNUC__ and __GNUC_MINOR__ ↵Howard Hinnant2012-10-032-6/+15
| | | | | | in <__config>. llvm-svn: 165151
* Make vector::iterator and string::iterator more resilient against overly ↵Howard Hinnant2012-10-021-0/+32
| | | | | | generic relational operators. llvm-svn: 165033
* Due to a mistake on my own part, I need to burn some version numbers. This ↵Howard Hinnant2012-09-281-1/+1
| | | | | | does not impact any of the implementation of libc++, and does not impact the ABI in any way. llvm-svn: 164832
* Bump _LIBCPP_VERSION to 1002Howard Hinnant2012-09-261-1/+1
| | | | llvm-svn: 164700
* Apply the emulated nullptr_t with constexpr. This is an unusual ↵Howard Hinnant2012-09-241-11/+11
| | | | | | 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
* Updating email addressMarshall Clow2012-09-241-1/+1
| | | | llvm-svn: 164489
* Fix installheaders target to do what it did prior to r161760. rdar://12348765Bob Wilson2012-09-211-0/+9
| | | | llvm-svn: 164413
* Add overflow check to tanh(complex) and reduce to finite answer. Fixes ↵Howard Hinnant2012-09-192-1/+6
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=13874 llvm-svn: 164266
* Overloaded __pad_and_output on ostreambuf_iterator and in this overload call ↵Howard Hinnant2012-09-192-0/+54
| | | | | | 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
* Align <atomic> with clang r163964 which disallows const _Atomic types.Howard Hinnant2012-09-161-1/+1
| | | | llvm-svn: 164004
* Update CREDITS.TXTHoward Hinnant2012-09-141-0/+4
| | | | llvm-svn: 163949
* Dimitry Andric: many visibility fixes. Howard: Much appreciated. Can you ↵Howard Hinnant2012-09-1426-59/+110
| | | | | | send me a patch to CREDITS.TXT? llvm-svn: 163862
* Dimitry Andric: FreeBSD porting tweaks for PTHREAD_MUTEX_INITIALIZER and ↵Howard Hinnant2012-09-111-2/+2
| | | | | | PTHREAD_COND_INITIALIZER llvm-svn: 163626
* Some minor mingw64 porting tweaks from Glen.Howard Hinnant2012-09-032-4/+9
| | | | llvm-svn: 163120
* Change sleep_for, sleep_until, and the condition_variable timed waitHoward Hinnant2012-08-304-31/+53
| | | | | | | | | | | | | 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
* Hyeon-bin Jeong: libc++ fails to create any classes inherit from basic_ios ↵Howard Hinnant2012-08-261-2/+4
| | | | | | | | | | | 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
* Update CREDITS.TXTHoward Hinnant2012-08-261-0/+4
| | | | llvm-svn: 162647
* Michel Morin: My previous fix for C++03 was incomplete. Howard Hinnant2012-08-251-15/+18
| | | | | | | | | | | | | | | | | | 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
* Wrap throw in _LIBCPP_NO_EXCEPTIONS in debug.cpp. Calls abort if can't ↵Howard Hinnant2012-08-241-0/+20
| | | | | | throw an exception. Fixes http://llvm.org/bugs/show_bug.cgi?id=13082. llvm-svn: 162613
* Have basic_istream seekg, putback and unget first clear eofbit. Fixes ↵Howard Hinnant2012-08-241-0/+3
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=13089. llvm-svn: 162608
* Add Hyeon-bin Jeong to CREDITS.TXTHoward Hinnant2012-08-241-0/+4
| | | | llvm-svn: 162604
* Hyeon-Bin Jeong: 1. sync() should reset it’s external buffer pointers. Howard Hinnant2012-08-241-23/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix basic_filebuf's internal buffer is shrinking when using with some ↵Howard Hinnant2012-08-241-2/+3
| | | | | | codecvt. http://llvm.org/bugs/show_bug.cgi?id=13602 llvm-svn: 162585
* Fixed order of calling use_facet vs setbuf in basic_filebuf default constructor.Howard Hinnant2012-08-241-1/+1
| | | | llvm-svn: 162571
* basic_filebuf needs to delay obtaining a codecvt facet from the global ↵Howard Hinnant2012-08-241-2/+23
| | | | | | 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
* Fix a typo in the docsMarshall Clow2012-08-221-1/+1
| | | | llvm-svn: 162335
* In C++03 mode add an explicit conversion from int to the emulated class ↵Howard Hinnant2012-08-191-0/+2
| | | | | | enum. Fixes a problem reported by C. Bergström. llvm-svn: 162189
* Patch contributed by Dev Dude for mingw64 port.Howard Hinnant2012-08-192-1/+4
| | | | llvm-svn: 162188
* Apply patches supplied by Michel Morin in ↵Howard Hinnant2012-08-171-4/+8
| | | | | | 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
* Consistently label __bit_array as a struct, not a class.Howard Hinnant2012-08-172-3/+3
| | | | llvm-svn: 162108
* Remove obsolete do-installhdrs target (again).Howard Hinnant2012-08-131-2/+2
| | | | llvm-svn: 161761
* Remove obsolete do-installhdrs target.Howard Hinnant2012-08-131-11/+0
| | | | llvm-svn: 161760
* Patch constributed by Michel Moren in ↵Howard Hinnant2012-08-131-1/+2
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=13592 . Fixes is_convertible<From, To> when To is an abstract type. llvm-svn: 161755
* Change size of reference count field in __libcpp_nmstr from 32 bits to 64 ↵Howard Hinnant2012-08-081-3/+3
| | | | | | bits for 64 bit targets. This is controls the data layout of all exceptions defined in <stdexcept>. This aligns the ABI with that of gcc-4.2. llvm-svn: 161497
* std::equal operating on non-const __bit_iterators was not working. This ↵Howard Hinnant2012-08-051-14/+14
| | | | | | fixes it. llvm-svn: 161309
* Andrew Morrow: The current CMake setup for libc++ incorrectly uses the variableHoward Hinnant2012-08-051-1/+2
| | | | | | | | | | | | LLVM_ENABLE_ASSERTIONS instead of LIBCXX_ENABLE_ASSERTIONS when figuring out what _DEBUG/NDEBUG defines to set. It also tries to test the non-existent variable 'uppercase_CMAKE_BUILD_TYPE', which the top level LLVM CMakeLists.txt sets up, but which the top level libc++ CMakeLists.txt currently does not. Changing the variable name tested and creating the uppercase release name variable allows libc++ to honor the LIBCXX_ENABLE_ASSERTIONS option correctly. llvm-svn: 161308
* Loosen up the timing requirements on 4 more tests.Howard Hinnant2012-08-044-4/+4
| | | | llvm-svn: 161289
* Performance tweaking rotate.Howard Hinnant2012-08-031-27/+84
| | | | | | | | | | | | | | | | | | | | | | 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
* Andrew Morrow: The attached patch updates the initialization of the 'struct ↵Howard Hinnant2012-08-021-1/+1
| | | | | | | | | | tm' in __time_get_storage<char> to match the initialization behavior in __time_get_storage<wchar>. Without the initialization, valgrind reports errors in the subsequent calls to strftime_l. llvm-svn: 161196
* Andrew Morrow: There are two tests under test/utilities/memory that heap ↵Howard Hinnant2012-08-022-4/+0
| | | | | | | | | | | | | allocate two integers which remain unused and are subsequently leaked, so the test fail when run under valgrind. Unless I'm overlooking a subtle reason why they are needed I think they can be removed, allowing these tests to pass under valgrind. The attached patch removes the variables. If there is a reason for them to exist, I can change this to just delete them at the end of the test. llvm-svn: 161195
* Andrew Morrow: The attached patch updates the lit.config for libc++ unit ↵Howard Hinnant2012-08-021-0/+2
| | | | | | | | | tests so that the valgrind configuration passed to lit.py is used to run .pass tests. llvm-svn: 161193
* Andrew Morrow: Among the various libc++ tests that currently don't pass on ↵Howard Hinnant2012-08-022-26/+21
| | | | | | | | | | | | | | | | Linux are localization/locale.categories/category.collate/category.ctype/locale.ctype.byname/is_1.pass.cpp and scan_is.pass.cpp. The tests fail when the character class being tested is compound, like ctype_base::alnum or ctype_base::graph, because the existing series of conditionals in do_is an do_scan_is will abort too early. For instance, if the character class being tested is alnum, and the character is numeric, do_is will return false because iswalpha_l will return false, 'result' becomes false, and the 'true' result from the later call to iswdigit_l ends up being ignored . A similar problem exists in do_scan_is. llvm-svn: 161192
* Andrew Morrow: The attached patch is an attempt to implementHoward Hinnant2012-08-022-9/+11
| | | | | | | std::thread::hardware_concurrency for platforms that don't offer sysctl, but do provide a POSIX sysconf and _SC_NPROCESSORS_ONLN. llvm-svn: 161190
* Andrew Morrow: This patch fixesHoward Hinnant2012-08-022-6/+1
| | | | | | | | | test/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp to accept '(nil)' as a valid representation for NULL so that the test passes on Linux. The same thing is already done in some other tests, like in /test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp. llvm-svn: 161188
* Andrew Morrow: Attached is a writeup of the current state of the libc++ test ↵Howard Hinnant2012-07-312-2/+141
| | | | | | | | | | | | | | | | | | | suite on Linux. There are a few tests that are listed as failing here for which I have a patch in the works. I'll be sending those along soon. There are others where I know what is going on but don't yet have a solution, and I've included some notes for those. Several still need to be investigated, mostly in localization and the regex test suite. I think that many of these failures are due to locale implementation variations that make the expected test results not match the actual results. I'm not sure what the best way to make the tests accomodate this sort of variation might be. The failures in the unique_ptr test suite are very new and are caused by a clang crash which I've not yet looked into. llvm-svn: 161079
* Despite my pathological distrust of spin locks, the number just don't lie. ↵Howard Hinnant2012-07-301-2/+13
| | | | | | I've put a small spin in __sp_mut::lock() on std::mutex::try_lock(), which is testing quite well. In my experience, putting in a yield for every failed iteration is also a major performance booster. This change makes one of the performance tests I was using (a highly contended one) run about 20 times faster. llvm-svn: 160967
* Updated statusHoward Hinnant2012-07-301-6/+0
| | | | llvm-svn: 160959
* Updated the complete by-chapter graphHoward Hinnant2012-07-302-1/+1
| | | | llvm-svn: 160943
* Implement [util.smartptr.shared.atomic]. This is the last unimplementedHoward Hinnant2012-07-3013-1/+592
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update CREDITS.TXTHoward Hinnant2012-07-261-0/+4
| | | | llvm-svn: 160812
OpenPOWER on IntegriCloud