summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement LWG685 (which is from C++11!). Fixes PR#28421. Note: this ↵Marshall Clow2016-07-081-2/+123
| | | | | | (subtly) changes the return type of operator-(Iter1, Iter2) where Iter1 is a reverse iterator or a move_iterator, and Iter2 is some other move/reverse iterator type. In practice, I believe that almost every time the second param will be const_XXX and this will mean that the return type will be the same as it was before. llvm-svn: 274880
* [libc++] Check hash before calling __hash_table key_eq functionKwasi Mensah2016-07-081-2/+2
| | | | | | | | | | | | Summary: The current implementations of __hash_table::find used by std::unordered_set/unordered_map call key_eq on each key that lands in the same bucket as the key you're looking for. However, since equal objects mush hash to the same value, you can short-circuit the possibly expensive call to key_eq by checking the hashes first. Reviewers: EricWF Subscribers: kmensah, cfe-commits Differential Revision: http://reviews.llvm.org/D21510 llvm-svn: 274857
* Revert r274605 due to bot failure: ↵Manman Ren2016-07-061-7/+7
| | | | | | http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/244/ llvm-svn: 274651
* Fix typo in #ifdef, and re-enable tests now that the green-dragon bots are ↵Marshall Clow2016-07-061-7/+7
| | | | | | no more llvm-svn: 274605
* Add unordered_map::insert benchmark test and rename fileEric Fiselier2016-07-022-29/+44
| | | | llvm-svn: 274424
* Improve performance of unordered_set<uint32_t>::find by 45%. Add benchmarks.Eric Fiselier2016-07-022-2/+33
| | | | | | | | | | | | | | | | This patch improves the performance of unordered_set's find by 45% when the value exists within the set. __hash_tables find method needs to check if it's reached the end of the bucket by constraining the hash of the current node and checking it against the bucket index. However constraining the hash is an expensive operations and it can be avoided if the two unconstrained hashes are equal. This patch applies that optimization. This patch also adds a top level directory called benchmarks. 'benchmarks/' is intended to store any/all benchmarks written for the standard library. Currently nothing is done with files under 'benchmarks/' but I would like to move towards introducing a formal format and test runner. llvm-svn: 274423
* Handle std::get<T>(...) for std::tuple<>Eric Fiselier2016-07-022-0/+8
| | | | llvm-svn: 274422
* Remove workarounds for C++17 inline variable ABI break. It has been fixed in ↵Eric Fiselier2016-07-022-11/+0
| | | | | | clang. llvm-svn: 274419
* Rewrite std::get<Type>(...) helper using constexpr functions.Eric Fiselier2016-07-026-120/+63
| | | | llvm-svn: 274418
* Cleanup SFINAE in tuple, and add tests for reference assignmentEric Fiselier2016-07-023-30/+48
| | | | llvm-svn: 274414
* Make tuple_constructible and family lazy again.Eric Fiselier2016-07-022-3/+111
| | | | llvm-svn: 274413
* Add another workaround for C++17 inline variable ABI breakage.Eric Fiselier2016-07-011-1/+4
| | | | llvm-svn: 274408
* Remove accidental change committed in r274403.Eric Fiselier2016-07-011-1/+1
| | | | llvm-svn: 274407
* Turn off ASAN's odr-violation diagnostics for now. See PR28391Eric Fiselier2016-07-011-0/+3
| | | | llvm-svn: 274404
* Work around ABI break caused by C++17 inline variables.Eric Fiselier2016-07-011-1/+8
| | | | llvm-svn: 274403
* Flatten tuple_constructible, tuple_convertible and tuple_assignable.Eric Fiselier2016-07-012-82/+40
| | | | | | | | | | | | | | | | This patch is the last in a series that replaces recursive meta-programming in std::tuple with non-recursive implementations. Previously std::tuple could only be instantiated with 126 elements before it blew the max template instantiation depth. Now the size of std::tuple is essentially unbounded (I've tested with over 5000 elements). One unfortunate side-effect of this change is that tuple_constructible and similar no longer short circuit after the first failure. Instead they evaluate the conditions for all elements. This could be potentially breaking. I plan to look into this further. llvm-svn: 274331
* Flatten the tuple_element and __make_tuple_types implementations.Eric Fiselier2016-07-012-33/+139
| | | | | | | | | | This patch attempts to improve the QoI of std::tuples tuple_element and __make_tuple_types helpers. Previously they required O(N) instantiations, one for every element in the tuple The new implementations are O(1) after __tuple_indices<Id...> is created. llvm-svn: 274330
* Replace __make_tuple_indices implementation with superior implementation.Eric Fiselier2016-06-302-77/+81
| | | | | | | | | | | | | | | | | The previous __make_tuple_indices implementation caused O(N) instantiations and was pretty inefficient. The C++14 __make_integer_sequence implementation is much better, since it either uses a builtin to generate the sequence or a very nice Log8(N) implementation provided by richard smith. This patch moves the __make_integer_sequence implementation into __tuple and uses it to implement __make_tuple_indices. Since libc++ can't expose the name 'integer_sequence' in C++11 this patch also introduces a dummy type '__integer_sequence' which is used when generating the sequence. One the sequence is generated '__integer_sequence' can be converted into the required type; either '__tuple_indices' or 'integer_sequence'. llvm-svn: 274286
* Fix static assert problem on gcc; remove XFAILs that I put in in r274250Marshall Clow2016-06-308-18/+6
| | | | llvm-svn: 274285
* Fix C++03 build.Eric Fiselier2016-06-305-1/+16
| | | | llvm-svn: 274274
* Mark issues 2550, 2551, 2555, 2685, 2698 as complete. These issues are ↵Marshall Clow2016-06-301-7/+7
| | | | | | wording clarifications; no code changes required. llvm-svn: 274255
* Mark issues 2667, 2669, 2670, 2671, 2673 as complete. These issues are ↵Marshall Clow2016-06-301-5/+5
| | | | | | wording clarifications; no code changes required. llvm-svn: 274253
* Implement LWG#2688: 'clamp misses preconditions and has extraneous condition ↵Marshall Clow2016-06-303-5/+136
| | | | | | on result'. We already did this, just added tests llvm-svn: 274252
* Temporarily XFAIL the incomplete type tests for GCC while I figure out why ↵Marshall Clow2016-06-306-0/+12
| | | | | | adding a static_assert in r274235 broken them llvm-svn: 274250
* Implement LWG#2684: 'priority_queue lacking comparator typedef'. We already ↵Marshall Clow2016-06-302-1/+5
| | | | | | did this, just added tests llvm-svn: 274243
* Implement LWG#2596: 'vector::data() should use addressof'Marshall Clow2016-06-303-4/+42
| | | | llvm-svn: 274241
* Implement LWG#2441: 'Exact-width atomic typedefs should be provided'Marshall Clow2016-06-305-1/+70
| | | | llvm-svn: 274236
* Implement LWG#2436: 'Comparators for associative containers should always be ↵Marshall Clow2016-06-3015-1/+355
| | | | | | CopyConstructible' llvm-svn: 274235
* Update status of already completed Oulu issues.Eric Fiselier2016-06-301-15/+15
| | | | | | | | | | | | | | | | | | | | | | * P0163r0: Implemented in r273839. * LWG 2309: pthread_mutex_lock only returns this error if certain debug flags were passed during construction. libc++ does not pass these flags. There is nothing to do. * LWG 2310: Wording fix. No impact on libc++'s implementation. * LWG 2312: libc++'s std::tuple implementation already constrains the overloads based on the number of arguments. * LWG 2549: libc++'s std::tuple already applied this fix. * LWG 2674: libc++ already depends on this relaxed wording. * LWG 2704, 2706, 2707, 2719, 2720, 2721, 2723, 2725, 2728: All of these filesystem were either submitted by me and fixed before submission, or have already been applied. llvm-svn: 274214
* Make futures.overview enum tests more portable. Patch from STL@microsoft.comEric Fiselier2016-06-302-9/+16
| | | | llvm-svn: 274211
* Make std::array typedef tests more portable.Eric Fiselier2016-06-301-4/+25
| | | | llvm-svn: 274210
* Fix ::reference typedef in insert iterators.Eric Fiselier2016-06-304-12/+12
| | | | | | | | | | | | Since at least the C++11 standard insert iterators are specified as having ::reference typedef void. Libc++ was not doing that. This patch corrects the typedef. This patch changes the std::iterator base class of insert_iterator, front_insert_iterator and back_insert_iterator. This should not be an ABI breaking change. llvm-svn: 274209
* Make instreambuf.iterator/types.pass.cpp more portable.Eric Fiselier2016-06-301-6/+12
| | | | llvm-svn: 274207
* Fix use of terse static assert. Patch from STL@microsoft.comEric Fiselier2016-06-301-1/+1
| | | | llvm-svn: 274206
* Fix unary_function inheritance assumption. Patch from STL@microsoft.comEric Fiselier2016-06-301-2/+2
| | | | llvm-svn: 274205
* Fix unreferenced parameter warning. Patch from STL@microsoft.comEric Fiselier2016-06-301-1/+1
| | | | llvm-svn: 274204
* Avoid applying unary minus to unsigned integers. Patch from STL@microsoft.comEric Fiselier2016-06-302-8/+8
| | | | llvm-svn: 274203
* [libcxx] Fix a bug in strstreambuf::overflow.Akira Hatanaka2016-06-292-2/+33
| | | | | | | | | | | The end pointer should point to one past the end of the newly allocated buffer. rdar://problem/24265174 Differential Revision: http://reviews.llvm.org/D20334 llvm-svn: 274132
* Use WG21.link reflector to get to issues, rather than linking directlyMarshall Clow2016-06-281-129/+129
| | | | llvm-svn: 274018
* Updated C++1Z status page with new work from Oulu WG21 meetingMarshall Clow2016-06-281-0/+79
| | | | llvm-svn: 274016
* Fix bad link for P0006Marshall Clow2016-06-271-1/+1
| | | | llvm-svn: 273861
* Fix UB in uses_alloc_types.hppEric Fiselier2016-06-271-2/+2
| | | | llvm-svn: 273840
* Implement P0163r0. Add shared_ptr::weak_type.Eric Fiselier2016-06-274-2/+12
| | | | | | | | | | This patch adds the weak_type typedef in shared_ptr. It is available in C++17 and newer. This patch also updates the _LIBCPP_STD_VER and TEST_STD_VER macros to have the value of 16, since 2016 is the current year. llvm-svn: 273839
* Implement p0337r0. Delete operator= for polymorphic_allocator.Eric Fiselier2016-06-273-14/+14
| | | | llvm-svn: 273838
* Implement P0358r1. Fixes for not_fn.Eric Fiselier2016-06-272-30/+86
| | | | llvm-svn: 273837
* Fix C++03 failure in enable_shared_from_this testEric Fiselier2016-06-271-1/+2
| | | | llvm-svn: 273836
* Fix PR27115 - enable_shared_from_this does not work as a virtual base class.Eric Fiselier2016-06-262-24/+39
| | | | | | | | | | | | | See https://llvm.org/bugs/show_bug.cgi?id=27115 The problem was that the conversion from 'const enable_shared_from_this<T>*' to 'const T*' didn't work if T inherited enable_shared_from_this as a virtual base class. The fix is to take the original pointer passed to shared_ptr's constructor in the __enable_weak_this method and perform an upcast to 'const T*' instead of performing a downcast from the enable_shared_from_this base. llvm-svn: 273835
* Fix C++03 buildEric Fiselier2016-06-262-0/+6
| | | | llvm-svn: 273832
* Fix PR28079 - std::wstring_convert move constructor broken.Eric Fiselier2016-06-263-1/+61
| | | | | | | | | | | | | The move constructor for wstring_convert accidentally copied the state member into the converted count member in the move constructor. This patch fixes the typo. While working on this I discovered that wstring_convert doesn't actually provide a move constructor according to the standard and therefore this constructor is a libc++ extension. I'll look further into whether libc++ should provide this constructor at all. Neither libstdc++ or MSVC's STL provide it. llvm-svn: 273831
* Implement LWG 2488 - Make the placeholders constexpr.Eric Fiselier2016-06-264-21/+63
| | | | | | | | | | | | | | | | | | | This patch makes the bind placeholders in std::placeholders both (1) const and (2) constexpr (See below). This is technically a breaking change for any code using the placeholders outside of std::bind and depending on them being non-const. However I don't think this will break any real world code. (1) Previously the placeholders were non-const extern globals in all dialects. This patch changes these extern globals to be const in all dialects. Since the cv-qualifiers don't participate in name mangling for globals this is an ABI compatible change. (2) Make the placeholders constexpr in C++11 and beyond. Although LWG 2488 only applies to C++17 I don't see any reason not to backport this change. llvm-svn: 273824
OpenPOWER on IntegriCloud