summaryrefslogtreecommitdiffstats
path: root/libcxx/src
Commit message (Collapse)AuthorAgeFilesLines
* Some minor mingw64 porting tweaks from Glen.Howard Hinnant2012-09-031-2/+7
| | | | llvm-svn: 163120
* Change sleep_for, sleep_until, and the condition_variable timed waitHoward Hinnant2012-08-302-5/+29
| | | | | | | | | | | | | 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
* 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
* Patch contributed by Dev Dude for mingw64 port.Howard Hinnant2012-08-191-0/+3
| | | | llvm-svn: 162188
* 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
* 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: Among the various libc++ tests that currently don't pass on ↵Howard Hinnant2012-08-021-22/+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-021-2/+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
* 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
* Implement [util.smartptr.shared.atomic]. This is the last unimplementedHoward Hinnant2012-07-301-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Patch by Andrew C. Morrow: Conditionally include cxxabi.h in new.cpp and ↵Howard Hinnant2012-07-262-1/+17
| | | | | | | | | | | | typeinfo.cpp. Both new.cpp and typeinfo.cpp have code that is conditionally compiled based on the LIBCXXRT and _LIBCPPABI_VERSION defines, but those files do not currently include <cxxabi.h> in the non __APPLE__ case. The attached patch updates those files so that for non __APPLE__ builds <cxxabi.h> is included if available or if LIBCXXRT is set. I'm modeling this on the recent updates to exception.cpp. llvm-svn: 160790
* libc++: switch from using _ATTRIBUTE(noreturn) (which conflicts with aRichard Smith2012-07-261-4/+4
| | | | | | platform-provided macro on some systems) to _LIBCPP_NORETURN. llvm-svn: 160773
* noexcept applied to <future>.Howard Hinnant2012-07-211-1/+1
| | | | llvm-svn: 160607
* noexcept applied to <thread>.Howard Hinnant2012-07-211-1/+1
| | | | llvm-svn: 160606
* noexcept applied to <condition_variable>.Howard Hinnant2012-07-211-2/+2
| | | | llvm-svn: 160605
* noexcept and constexpr applied to <mutex>.Howard Hinnant2012-07-211-8/+9
| | | | llvm-svn: 160604
* noexcept and constexpr applied to <ios>.Howard Hinnant2012-07-211-1/+1
| | | | llvm-svn: 160593
* noexcept applied to <random>.Howard Hinnant2012-07-201-1/+1
| | | | llvm-svn: 160579
* Teach libc++ to check for libc++abi and use its features if they're available.Richard Smith2012-07-111-8/+11
| | | | llvm-svn: 160038
* Appy constexpr to <memory>. Picked up a few missing noexcepts as well.Howard Hinnant2012-07-071-0/+1
| | | | llvm-svn: 159902
* Protect use of alignas against older versions of clangHoward Hinnant2012-05-311-14/+14
| | | | llvm-svn: 157764
* libc++: only #include <cxxabi.h> if it exists. This allows libc++ to buildRichard Smith2012-04-191-0/+4
| | | | | | | | out of the box on Linux systems. If you're building against libc++abi, you still need to make sure it can find <cxxabi.h> so it knows not to export symbols which libc++abi provides. llvm-svn: 155091
* Put std::piecewise_construct_t back into the dylib for ABI stability. When ↵Howard Hinnant2012-04-031-2/+1
| | | | | | clients are in C++11/constexpr mode this will be safely ignored because piecewise_construct is then declared with internal linkage. llvm-svn: 153981
* constexpr support for <utility>. Patch contributed by Jonathan Sauer.Howard Hinnant2012-04-031-0/+2
| | | | llvm-svn: 153968
* Alter the terminal streams such that they do not get added to the atexit ↵Howard Hinnant2012-03-161-25/+38
| | | | | | chain, and thus never get destructed. llvm-svn: 152926
* Undo some overzealous #ifdefs for LIBCXXRT.David Chisnall2012-03-142-10/+11
| | | | llvm-svn: 152718
* Fix moneypunct_byname algorithm to more accurately represent C locales in C++.Jeffrey Yasskin2012-03-101-67/+235
| | | | llvm-svn: 152501
* Change some smart_ptr == 0 to smart_ptr == nullptr. Fixes ↵Howard Hinnant2012-03-071-6/+6
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=12185. llvm-svn: 152240
* Add a warning to ctype<char>::classic_table() if not implemented.Howard Hinnant2012-02-291-0/+1
| | | | llvm-svn: 151728
* I'm reverting one of the changes made to exception.cpp in r151717. I'm ↵Howard Hinnant2012-02-291-0/+4
| | | | | | unsure what the change was trying to do, but it didn't do the right thing for __APPLE__. So instead of trying to guess what was intended, I'm just putting it back the way it was. llvm-svn: 151727
* Add support files required for building on Solaris.David Chisnall2012-02-294-0/+418
| | | | llvm-svn: 151721
* Solaris port. Currently sees around 200 test failures, mostly related toDavid Chisnall2012-02-293-1/+15
| | | | | | | | | | 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
* Some libcxxrt-compatibility cleanups (avoid defining things twice).David Chisnall2012-02-293-30/+31
| | | | llvm-svn: 151717
* At least temporarily move operator new/delete from the abi back to here. ↵Howard Hinnant2012-02-251-2/+2
| | | | | | I'm having trouble reexporting it as a weak symbol. llvm-svn: 151459
* Silence -Wmissing-field-initializers a little higher in the source.Howard Hinnant2012-02-201-1/+2
| | | | llvm-svn: 150964
* Initialize all the fields of struct tm before passing it to strftime. One of ↵Howard Hinnant2012-02-191-2/+2
| | | | | | the uninitialized fields, probably the pointer field tm_zone, was causing a segfault on linux. Patch contributed by Jeffrey Yasskin. llvm-svn: 150929
* Move typeinfos for exceptions in <stdexcept> to the abiHoward Hinnant2012-02-171-0/+9
| | | | llvm-svn: 150835
* Fix up narrowing conversions in switch statement.Howard Hinnant2012-02-081-4/+4
| | | | llvm-svn: 150082
* Make attributes on definition consistent with those on declaration.Howard Hinnant2012-02-031-0/+1
| | | | llvm-svn: 149701
* Prepare for running on top of new libc++abi.Howard Hinnant2012-02-023-13/+35
| | | | llvm-svn: 149634
* Explicitly convert int to future_errc. Fixes ↵Howard Hinnant2012-02-021-1/+1
| | | | | | http://llvm.org/bugs/show_bug.cgi?id=11428 llvm-svn: 149630
* Fix memory leak in converting weak_ptr to shared_ptrHoward Hinnant2011-12-271-3/+0
| | | | llvm-svn: 147298
* Quash a whole bunch of warningsHoward Hinnant2011-12-0113-169/+185
| | | | llvm-svn: 145624
* More windows port work by Ruben Van BoxemHoward Hinnant2011-10-221-6/+6
| | | | llvm-svn: 142732
* de-tabbifyHoward Hinnant2011-10-173-6/+6
| | | | llvm-svn: 142237
* Windows port work by Ruben Van BoxemHoward Hinnant2011-09-292-1/+95
| | | | llvm-svn: 140805
* Windows patch work by Ruben Van BoxemHoward Hinnant2011-09-291-43/+49
| | | | llvm-svn: 140781
* Attempted locale refactoring. _LIBCPP_LOCALE__L_EXTENSIONS now should be ↵Howard Hinnant2011-09-281-62/+47
| | | | | | 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
* Work on Windows port by Ruben Van BoxemHoward Hinnant2011-09-281-2/+11
| | | | llvm-svn: 140728
* Another installment on debug mode. This addresses list. However this ↵Howard Hinnant2011-09-271-31/+42
| | | | | | 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
OpenPOWER on IntegriCloud