summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Patch by Andrew C. Morrow: shims to work around macroized getc and putc on ↵Howard Hinnant2012-07-261-0/+12
| | | | | | | | | 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
* 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
* <algorithm> no longer needs to include <cstdlib>, but can get away with just ↵Howard Hinnant2012-07-263-1/+3
| | | | | | <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
* locale::id really needs to be constructed at compile time.Howard Hinnant2012-07-261-1/+1
| | | | llvm-svn: 160785
* libc++: switch from using _ATTRIBUTE(noreturn) (which conflicts with aRichard Smith2012-07-263-15/+15
| | | | | | platform-provided macro on some systems) to _LIBCPP_NORETURN. llvm-svn: 160773
* Apple LWG 2067: ↵Howard Hinnant2012-07-211-6/+6
| | | | | | 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
* noexcept applied to <future>.Howard Hinnant2012-07-212-125/+125
| | | | llvm-svn: 160607
* noexcept applied to <thread>.Howard Hinnant2012-07-212-38/+38
| | | | llvm-svn: 160606
* noexcept applied to <condition_variable>.Howard Hinnant2012-07-213-12/+12
| | | | llvm-svn: 160605
* noexcept and constexpr applied to <mutex>.Howard Hinnant2012-07-214-54/+65
| | | | llvm-svn: 160604
* noexcept and constexpr applied to <regex>.Howard Hinnant2012-07-211-29/+28
| | | | llvm-svn: 160594
* noexcept and constexpr applied to <ios>.Howard Hinnant2012-07-213-36/+39
| | | | llvm-svn: 160593
* noexcept applied to <valarray>.Howard Hinnant2012-07-211-11/+11
| | | | llvm-svn: 160592
* constexpr applied to <complex>.Howard Hinnant2012-07-2011-22/+134
| | | | llvm-svn: 160585
* noexcept applied to <random>.Howard Hinnant2012-07-202-9/+9
| | | | llvm-svn: 160579
* Relax the tolerances on some timing tests.Howard Hinnant2012-07-202-2/+2
| | | | llvm-svn: 160566
* noexcept applied to <iterator>.Howard Hinnant2012-07-202-15/+15
| | | | llvm-svn: 160565
* constexpr applied to <array>.Howard Hinnant2012-07-202-4/+18
| | | | llvm-svn: 160564
* constexpr applied to <string>.Howard Hinnant2012-07-201-42/+44
| | | | llvm-svn: 160563
* Further tweaks on relaxing complete type checking for function.Howard Hinnant2012-07-202-15/+16
| | | | llvm-svn: 160562
* Jean-Daniel : clang now supports all required type_traits.Howard Hinnant2012-07-191-2/+2
| | | | llvm-svn: 160510
* Jean-Daniel updates the libc++ index page to reflect not so recent changes ↵Howard Hinnant2012-07-191-6/+6
| | | | | | in C++ standard status. llvm-svn: 160509
* Relax the complete-type checks that are happening under __invokable<Fp, ↵Howard Hinnant2012-07-162-1/+30
| | | | | | 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
* Applied constexpr to <chrono>.Howard Hinnant2012-07-1326-58/+432
| | | | llvm-svn: 160184
* Fixed a bug in wstring_convert concerning zero-length inputs. Thanks to ↵Howard Hinnant2012-07-123-2/+8
| | | | | | Jonathan Coxhead for reporting this bug. llvm-svn: 160136
* Teach libc++ to check for libc++abi and use its features if they're available.Richard Smith2012-07-111-8/+11
| | | | llvm-svn: 160038
* Add test for self-referencing emplace test.Howard Hinnant2012-07-091-0/+34
| | | | llvm-svn: 159921
* Change emplace for vector and deque to create the temporary (when necessary) ↵Howard Hinnant2012-07-082-3/+6
| | | | | | 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
* Appy constexpr to <memory>. Picked up a few missing noexcepts as well.Howard Hinnant2012-07-073-14/+30
| | | | llvm-svn: 159902
* Apply constexpr to the mutex constructor. As a conforming extension, apply ↵Howard Hinnant2012-07-071-0/+8
| | | | | | 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
* Apply constexpr to <bitset>.Howard Hinnant2012-07-075-16/+44
| | | | llvm-svn: 159899
* Apply noexcept to tuple.Howard Hinnant2012-07-061-24/+48
| | | | llvm-svn: 159865
* As a conforming extension give tuple a noexcept default constructor ↵Howard Hinnant2012-07-061-5/+9
| | | | | | conditionalized on its held types. llvm-svn: 159858
* Give tuple a constexpr default constructor.Howard Hinnant2012-07-062-3/+23
| | | | llvm-svn: 159857
* New Windows libc++ test results provided by Ruben Van Boxem.Howard Hinnant2012-07-061-255/+72
| | | | llvm-svn: 159852
* Apply noexcept to those functions implemented in <cstdlib> as a conforming ↵Howard Hinnant2012-07-061-4/+4
| | | | | | extension. llvm-svn: 159850
* Apply noexcept to those functions implemented in <cmath> as a conforming ↵Howard Hinnant2012-07-061-195/+195
| | | | | | extension. llvm-svn: 159849
* Add noexcept test for offsetof macro per [support.types]/p4.Howard Hinnant2012-07-061-0/+8
| | | | llvm-svn: 159846
* This commit establishes a new bucket_count policy in the unordered ↵Howard Hinnant2012-07-065-43/+68
| | | | | | 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
* link to Marshall's notes.Howard Hinnant2012-07-061-0/+1
| | | | llvm-svn: 159791
* mark operator new(std::nothrow) as noalias (aka __attribute__((malloc))Nuno Lopes2012-06-282-2/+8
| | | | llvm-svn: 159359
* Fixed a bug regarding result_of reported by Sven Behne. The fix is C++11 ↵Howard Hinnant2012-06-261-66/+8
| | | | | | 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
* fix help with bashNuno Lopes2012-06-251-1/+1
| | | | llvm-svn: 159177
* Revert pair constructors back to using is_convertible instead of ↵Howard Hinnant2012-06-091-6/+6
| | | | | | 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
OpenPOWER on IntegriCloud