- Apr 22, 2016
-
-
Eric Fiselier authored
llvm-svn: 267074
-
- Apr 21, 2016
-
-
Weiming Zhao authored
Summary: when setting LIBCXX_ENABLE_EXCEPTIONS=false, _LIBCPP_NO_EXCEPTIONS wil be defined in both commandline and _config Reviewers: bcraig, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19344 llvm-svn: 266956
-
- Apr 20, 2016
-
-
Eric Fiselier authored
Summary: Hi, When creating a new thread libc++ performs at least 2 allocations. The first allocates a tuple of args and the functor that will be passed to the new thread. The second allocation is for the thread local storage needed internally by libc++. Currently the second allocation happens in the child thread, meaning that if it throws the program will terminate with an uncaught bad alloc. The solution to this is to allocate ALL memory in the parent thread and then pass it to the child. See https://llvm.org/bugs/show_bug.cgi?id=15638 Reviewers: mclow.lists, danalbert, jroelofs, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13748 llvm-svn: 266851
-
Eric Fiselier authored
The primary purpose of this patch is to add the 'is_callable' traits. Since 'is_nothrow_callable' required making 'INVOKE' conditionally noexcept I also took this oppertunity to implement a constexpr version of INVOKE. This fixes 'std::experimental::apply' which required constexpr 'INVOKE support'. This patch will be followed up with some cleanup. Primarly removing most of "__member_function_traits" since it's no longer used by INVOKE (in C++11 at least). llvm-svn: 266836
-
- Apr 19, 2016
-
-
Ben Craig authored
The C++11 and C++14 standards both say in the header <utility> synopsis that <utility> shall include <initializer_list>. llvm-svn: 266808
-
Eric Fiselier authored
llvm-svn: 266703
-
- Apr 18, 2016
-
-
Eric Fiselier authored
Mark LWG issue 2469 as done. Also simplify try_emplace and insert_or_assign implementations in unordered_map llvm-svn: 266591
-
Eric Fiselier authored
llvm-svn: 266590
-
Eric Fiselier authored
llvm-svn: 266587
-
Eric Fiselier authored
llvm-svn: 266585
-
- Apr 16, 2016
-
-
Eric Fiselier authored
In cases where emplace is called with two arguments and the first one matches the key_type we can Key to check for duplicates before allocating. This patch expands on work done by dexonsmith@apple.com. llvm-svn: 266498
-
Eric Fiselier authored
Summary: This patch applies Duncan's work on __hash_table to __tree. Reviewers: mclow.lists, dexonsmith Subscribers: dexonsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D18637 llvm-svn: 266491
-
- Apr 15, 2016
-
-
Eric Fiselier authored
There are two main fixes in this patch. First the constructor SFINAE was changed so that it's evaluated in two stages where the first stage evaluates the "safe" SFINAE conditions and the second evaluates the "dangerous" ones. The key is that the second stage is lazily evaluated only if the first stage passes. This helps fix PR23256 (https://llvm.org/bugs/show_bug.cgi?id=23256). The second fix is for PR22806 and LWG issue 2549. This fix applies the suggested resolution to the LWG issue in order to prevent the construction of dangling references. The SFINAE for this check is contained within the _PreferTupleLikeConstructor alias template. The tuple-like constructors are disabled whenever that trait returns false. (https://llvm.org/bugs/show_bug.cgi?id=22806) (http://cplusplus.github.io/LWG/lwg-active.html#2549) llvm-svn: 266461
-
Eric Fiselier authored
Summary: A default uses-allocator constructor has been added since that overload was previously provided by the extended constructor. Since Clang does implicit conversion checking after substitution this constructor has to deduce the allocator_arg_t parameter so that it can prevent the evaluation of "is_default_constructible" if the first argument doesn't match. See http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1391 for more information. This patch fixes PR24779 (https://llvm.org/bugs/show_bug.cgi?id=24779) Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19006 llvm-svn: 266409
-
- Apr 13, 2016
-
-
Marshall Clow authored
llvm-svn: 266209
-
- Apr 11, 2016
-
-
Marshall Clow authored
Implement LWG#680, which was missed lo these many moons ago, and was reported as bug #27259. As a drive-by fix, replace the hand-rolled equivalent to addressof in __wrap_iter with the real thing. llvm-svn: 265914
-
- Apr 07, 2016
-
-
Marshall Clow authored
Recommit r263036 with additional inlining, so that it will continue to work with existing system dylibs. Implements LWG#2583 llvm-svn: 265706
-
Marshall Clow authored
llvm-svn: 265672
-
- Apr 05, 2016
-
-
Marshall Clow authored
llvm-svn: 265363
-
Marshall Clow authored
Put back the undefs that Richard removed. Boost won't build w/o these; specifically the file 'bytes_methods.h' in Apple's python framework defines these. llvm-svn: 265358
-
- Apr 04, 2016
-
-
Marshall Clow authored
Fix for Bug #27193; 'std::acos on complex does not agree with C'. Tests need work; so the bug will stay open. llvm-svn: 265306
-
- Mar 31, 2016
-
-
Eric Fiselier authored
map's allocator may only be used to construct objects of 'value_type', or in this case 'pair<const Key, Value>'. In order to respect this requirement in operator[], which requires default constructing the 'mapped_type', we have to use pair's piecewise constructor with '(tuple<Kep>, tuple<>)'. Unfortunately we still need to provide a fallback implementation for C++03 since we don't have <tuple>. Even worse this fallback is the last remaining user of '__hash_map_node_destructor' and '__construct_node_with_key'. This patch also switches try_emplace over to __tree.__emplace_unique_key_args. llvm-svn: 264989
-
Eric Fiselier authored
This patch is fairly large and contains a number of changes. The changes all work towards allowing __tree to properly handle __value_type esspecially when inserting into the __tree. I chose not to break this change into smaller patches because it wouldn't be possible to write meaningful standard-compliant tests for each patch. It is very similar to r260513 "[libcxx] Teach __hash_table how to handle unordered_map's __hash_value_type". Changes in <map> * Remove __value_type's constructors because it should never be constructed directly. * Make map::emplace and multimap::emplace forward to __tree and remove the old definitions * Remove "__construct_node" map and multimap member functions. Almost all of the construction is done within __tree. * Fix map's move constructor to access "__value_type.__nc" directly and pass this object to __tree::insert. Changes in <__tree> * Add traits to detect, handle, and unwrap, map's "__value_type". * Convert methods taking "value_type" to take "__container_value_type" instead. Previously these methods caused unwanted implicit conversions from "std::pair<Key, Value>" to "__value_type<Key, Value>". * Delete __tree_node and __tree_node_base's constructors and assignment operators. The node types should never be constructed because the "__value_" member of __tree_node must be constructed directly by the allocator. * Make the __tree_node_destructor class and "__construct_node" methods unwrap "__node_value_type" into "__container_value_type" before invoking the allocator. The user's allocator can only be used to construct and destroy the container's value_type. Passing it map's "__value_type" was incorrect. * Cleanup the "__insert" and "__emplace" methods. Have __insert forward to an __emplace function wherever possible to reduce code duplication. __insert_unique(value_type const&) and __insert_unique(value_type&&) forward to __emplace_unique_key_args. These functions will not allocate a new node if the value is already in the tree. * Change the __find* functions to take the "key_type" directly instead of passing in "value_type" and unwrapping the key later. This change allows the find functions to be used without having to construct a "value_type" first. This allows for a number of optimizations. * Teach __move_assign and __assign_multi methods to unwrap map's __value_type. llvm-svn: 264986
-
- Mar 25, 2016
-
-
JF Bastien authored
Summary: This was voted into C++17 at the Jacksonville meeting. The final P0152R1 paper will be in the upcoming post-Jacksonville mailing, and is also available here: http://jfbastien.github.io/papers/P0152R1.html Reviewers: mclow.lists, rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17951 llvm-svn: 264413
-
- Mar 17, 2016
-
-
Duncan P. N. Exon Smith authored
unordered_set::emplace and unordered_map::emplace construct a node, then try to insert it. If insertion fails, the node gets deleted. To avoid this unnecessary malloc traffic, check to see if the argument to emplace has the appropriate key_type. If so, we can use that key directly and delay the malloc until we're sure we're inserting something new. Test updates by Eric Fiselier, who rewrote the old allocation tests to include the new cases. There are two orthogonal future directions: 1. Apply the same optimization to set and map. 2. Extend the optimization to when the argument is not key_type, but can be converted to it without side effects. Ideally, we could do this whenever key_type is trivially destructible and the argument is trivially convertible to key_type, but in practise the relevant type traits "blow up sometimes". At least, we should catch a few simple cases (such as when both are primitive types). llvm-svn: 263746
-
Eric Fiselier authored
llvm-svn: 263688
-
- Mar 16, 2016
-
-
Eric Fiselier authored
llvm-svn: 263659
-
Eric Fiselier authored
This adds clang thread safety annotations to std::mutex and std::lock_guard so code using these types can use these types directly instead of having to wrap the types to provide annotations. These checks when enabled by -Wthread-safety provide simple but useful static checking to detect potential race conditions. See http://clang.llvm.org/docs/ThreadSafetyAnalysis.html for details. This patch was reviewed in http://reviews.llvm.org/D14731. llvm-svn: 263611
-
- Mar 15, 2016
-
-
Marshall Clow authored
llvm-svn: 263506
-
- Mar 14, 2016
-
-
Marshall Clow authored
llvm-svn: 263450
-
- Mar 12, 2016
-
-
Evgeniy Stepanov authored
std::addressof may be used on a storage of an object before the start of its lifetime (see std::allocate_shared for example). CFI flags the C-style cast as invalid in that case. llvm-svn: 263310
-
- Mar 11, 2016
-
-
Nico Weber authored
llvm-svn: 263246
-
- Mar 09, 2016
-
-
Marshall Clow authored
Implement LWG#2579: Inconsistency wrt Allocators in basic_string assignment vs. basic_string::assign llvm-svn: 263042
-
Marshall Clow authored
llvm-svn: 263036
-
Ben Craig authored
For the locale refactor, the locale management functions (newlocale, freelocale, uselocale) are needed in a separate header from the various _l functions. This is because some platforms implement the _l functions in terms of a locale switcher RAII helper, and the locale switcher RAII helper needs the locale management functions. This patch helps pave the way by getting all the functions in the right files, so that later diffs aren't completely horrible. Unfortunately, the Windows, Cygwin, and MinGW builds seemed to have bit-rotted, so I wasn't able to test this completely. I don't think I made things any worse than they already are though. http://reviews.llvm.org/D17419 llvm-svn: 263020
-
Ben Craig authored
Instead of checking _LIBCPP_LOCALE_L_EXTENSIONS all over, instead check it once, and define the various *_l symbols once. The private redirector symbol names are all prefixed with _libcpp_* so that they won't conflict with user symbols, and so they won't conflict with future C library symbols. In particular, glibc likes providing private symbols such as __locale_t, so we should follow a different naming pattern (like _libcpp_*) to avoid problems on that front. Tested on Linux with glibc. Hoping for the best on OSX and the various BSDs. http://reviews.llvm.org/D17456 llvm-svn: 263016
-
- Mar 08, 2016
-
-
Marshall Clow authored
llvm-svn: 262931
-
Marshall Clow authored
llvm-svn: 262928
-
- Mar 07, 2016
-
-
Marshall Clow authored
llvm-svn: 262871
-
Marshall Clow authored
non-member swap for array was mistakenly taking const ref params. Fixed and added test. Thanks to Ben Craig for the catch llvm-svn: 262866
-