aboutsummaryrefslogtreecommitdiff
path: root/libcxx
AgeCommit message (Collapse)AuthorFilesLines
2016-08-18Merging r279008:Hans Wennborg2-1/+163
------------------------------------------------------------------------ r279008 | marshall | 2016-08-17 16:24:02 -0700 (Wed, 17 Aug 2016) | 1 line make the associative containers do the right thing for propogate_on_container_assignment. Fixes bug #29001. Tests are only for <map> right now - more complete tests will come when we revamp our allocator testing structure. ------------------------------------------------------------------------ llvm-svn: 279017
2016-08-18Merging r278904:Hans Wennborg41-29/+1026
------------------------------------------------------------------------ r278904 | marshall | 2016-08-16 22:58:40 -0700 (Tue, 16 Aug 2016) | 1 line Support allocators with explicit conversion constructors. Fixes bug #29000 ------------------------------------------------------------------------ llvm-svn: 279015
2016-08-12Merging r278357:Hans Wennborg1-1/+2
------------------------------------------------------------------------ r278357 | compnerd | 2016-08-11 09:58:12 -0700 (Thu, 11 Aug 2016) | 6 lines test: relax the FS test a slight bit to be more reliable Some filesystems track atime always. This relaxes the test to accept either a filesystem which does not accurately track atime or does track the atime accurately. This allows the test to pass on filesystems mounted with `strictatime` on Linux or on macOS. ------------------------------------------------------------------------ llvm-svn: 278538
2016-08-11Merging r278282:Hans Wennborg2-8/+59
------------------------------------------------------------------------ r278282 | marshall | 2016-08-10 13:04:46 -0700 (Wed, 10 Aug 2016) | 1 line std:: quailfy the calls for cend/crend/cbegin/cend. Fixes bug 28927. ------------------------------------------------------------------------ llvm-svn: 278426
2016-08-11Merging r278387:Hans Wennborg1-1/+0
------------------------------------------------------------------------ r278387 | marshall | 2016-08-11 11:46:24 -0700 (Thu, 11 Aug 2016) | 1 line Remove test for the sign of a NaN - doesn't work on MIPS, not strictly legal. Fixes bug 28936 ------------------------------------------------------------------------ llvm-svn: 278425
2016-07-20Merging r276003:Eric Fiselier8-188/+302
------------------------------------------------------------------------ r276003 | ericwf | 2016-07-19 11:56:20 -0600 (Tue, 19 Jul 2016) | 35 lines Fix undefined behavior in __tree Summary: This patch attempts to fix the undefined behavior in __tree by changing the node pointer types used throughout. The pointer types are changed for raw pointers in the current ABI and for fancy pointers in ABI V2 (since the fancy pointer types may not be ABI compatible). The UB in `__tree` arises because tree downcasts the embedded end node and then deferences that pointer. Currently there are 3 node types in __tree. * `__tree_end_node` which contains the `__left_` pointer. This node is embedded within the container. * `__tree_node_base` which contains `__right_`, `__parent_` and `__is_black`. This node is used throughout the tree rebalancing algorithms. * `__tree_node` which contains `__value_`. Currently `__tree` stores the start of the tree, `__begin_node_`, as a pointer to a `__tree_node`. Additionally the iterators store their position as a pointer to a `__tree_node`. In both of these cases the pointee can be the end node. This is fixed by changing them to store `__tree_end_node` pointers instead. To make this change I introduced an `__iter_pointer` typedef which is defined to be a pointer to either `__tree_end_node` in the new ABI or `__tree_node` in the current one. Both `__tree::__begin_node_` and iterator pointers are now stored as `__iter_pointers`. The other situation where `__tree_end_node` is stored as the wrong type is in `__tree_node_base::__parent_`. Currently `__left_`, `__right_`, and `__parent_` are all `__tree_node_base` pointers. Since the end node will only be stored in `__parent_` the fix is to change `__parent_` to be a pointer to `__tree_end_node`. To make this change I introduced a `__parent_pointer` typedef which is defined to be a pointer to either `__tree_end_node` in the new ABI or `__tree_node_base` in the current one. Note that in the new ABI `__iter_pointer` and `__parent_pointer` are the same type (but not in the old one). The confusion between these two types is unfortunate but it was the best solution I could come up with that maintains the ABI. The typedef changes force a ton of explicit type casts to correct pointer types and to make current code compatible with both the old and new pointer typedefs. This is the bulk of the change and it's really messy. Unfortunately I don't know how to avoid it. Please let me know what you think. Reviewers: howard.hinnant, mclow.lists Subscribers: howard.hinnant, bbannier, cfe-commits Differential Revision: https://reviews.llvm.org/D20786 ------------------------------------------------------------------------ llvm-svn: 276212
2016-07-18Don't use pthread initializers in constexpr constructors. Patch by elram. ↵Marshall Clow1-5/+14
Reviewed at https://reviews.llvm.org/D21637. llvm-svn: 275819
2016-07-18Change a couple ifdefs from '#if __cplusplus >= 2011xxx' to '#ifndef ↵Marshall Clow3-9/+9
_LIBCPP_CXX03_LANG'. No functionality change. llvm-svn: 275787
2016-07-18Remove locale tests that depend on enviroment variables.Eric Fiselier1-17/+0
Constructing a std::locale object from an empty string selects the language from the current environment variables. If the environment variables name a locale that doesn't exist, or isn't installed, then the construction of facets using that locale may throw. This patch removes tests that use 'std::locale l("")'. The optimal solution would be to manually set the environment variables in the test. Unfortunately there is no portable way to do this. llvm-svn: 275772
2016-07-18[libcxx][filesystem] Remove setgid from parent before testing permissionsJonas Hahnfeld1-0/+3
man page for mkdir says: "If the parent directory has the set-group-ID bit set, then so will the newly created directory." Differential Revision: https://reviews.llvm.org/D22265 llvm-svn: 275760
2016-07-18Rework libatomic handling in CMake and LIT.Eric Fiselier5-3/+9
This patch updates the way libc++ handles checking for libatomic, in part to prepare for https://reviews.llvm.org/D22073. Changes: * 'LIBCXX_HAS_ATOMIC_LIB' is now set whenever libatomic is available even libc++ doesn't need to manually link it. * 'LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB' is now used to detect when libatomic needs to be manually linked. * 'LIBCXX_HAS_ATOMIC_LIB' now adds 'libatomic' as a available feature in the test suite. llvm-svn: 275759
2016-07-18Improve ABI tests for std::pair.Eric Fiselier2-5/+152
llvm-svn: 275757
2016-07-18Add checkpoint diagnostics to help diagnose buildbot failures.Eric Fiselier2-2/+11
llvm-svn: 275754
2016-07-18Prevent failures by marking Clock::is_steady tests as UNSUPPORTED: asan.Eric Fiselier3-0/+12
llvm-svn: 275753
2016-07-18Add includes in test. Patch from STL@microsoft.comEric Fiselier1-0/+4
llvm-svn: 275751
2016-07-18Upgrade arcconfig to use httpsEric Fiselier1-1/+1
llvm-svn: 275750
2016-07-18Rename and rework `_LIBCPP_TRIVIAL_PAIR_COPY_CTOR`. Move FreeBSD ↵Eric Fiselier3-24/+82
configuration in-tree. This patch does the following: * It renames `_LIBCPP_TRIVIAL_PAIR_COPY_CTOR` to `_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR`. * It automatically enables this option on FreeBSD in ABI V1, since that's the current ABI FreeBSD ships. * It cleans up the handling of this option in `std::pair`. I would like the sign off from the FreeBSD maintainers. They will no longer need to keep their `__config` changes downstream. I'm still hoping to come up with a better way to maintain the ABI without needing these constructors. Reviewed in https://reviews.llvm.org/D21329 llvm-svn: 275749
2016-07-18Suppress warning in make_from_tuple tests.Eric Fiselier1-0/+4
llvm-svn: 275748
2016-07-18Implement C++17 tuple bits. Including apply and make_from_tuple.Eric Fiselier9-2/+1205
This patch upgrades <tuple> to be C++17 compliant by implementing: * tuple_size_v: This was forgotten when implementing the other _v traits. * std::apply: This was added via LFTS v1 in p0220r1. * std::make_from_tuple: This was added in p0209r2. llvm-svn: 275745
2016-07-17Check for unconstrained hash equality before constrained hash equality.Eric Fiselier1-2/+3
This patch implements a simple optimization in __hash_table::find. When iterating the found bucket we only constrain the bucket elements hash if it doesn't already match the unconstrained hash of the specified key. This prevent the performance of an expensive modulo operation. Since the bucket element almost always matches the key, especially when the load factor is low, this optimization has large performance impacts. For a unordered_set<int> of random integers this patch improves the performance of 'find(...)' by 40%. llvm-svn: 275734
2016-07-17Fix std::experimental::optional tests. Patch from Casey Carter.Eric Fiselier5-13/+9
llvm-svn: 275732
2016-07-13Constuct a sentry object in istream::readsome, and handle failures ↵Marshall Clow1-11/+28
appropriately. Fixes PR#28217. llvm-svn: 275280
2016-07-12Add more tests for LWG#2582. No code changes needed, just tests.Marshall Clow26-20/+48
llvm-svn: 275211
2016-07-12libc++: name anonymous structsJF Bastien1-9/+9
As discussed in http://reviews.llvm.org/D22073 llvm-svn: 275210
2016-07-12Add tests for the meta.unary.props that do not require a complete type. This ↵Marshall Clow4-0/+14
is part of LWG#2582 llvm-svn: 275184
2016-07-12mark issue #2422 as complete; this was just a wording clarificationMarshall Clow1-1/+1
llvm-svn: 275177
2016-07-12mark issue #2181 as complete; this was just a wording clarificationMarshall Clow1-1/+1
llvm-svn: 275176
2016-07-12Add option to disable __deallocate #warningSaleem Abdulrasool3-0/+10
From r229162: Visual Studio's SAL extension uses a macro named __deallocate. This macro is used pervasively Using -Werror when building for Windows can force the use of -Wno-#warnings specifically because of this __deallocate #warning. Instead of forcing builds to disable all #warnings, this option allows libc++ to be built without this particular warning, while leaving other #warnings enabled. Patch by Dave Lee! llvm-svn: 275172
2016-07-12Put the status in the right columnMarshall Clow1-1/+1
llvm-svn: 275171
2016-07-12Mark P0067 as 'postponed', because it will be revised before the next meetingMarshall Clow1-2/+2
llvm-svn: 275170
2016-07-11Don't compute modulus of hash if it is smaller than the bucket count.Eric Fiselier1-5/+4
This cleans up a previous optimization attempt in hash, and results in additional performance improvements over that previous attempt. Additionally this new optimization does not hinder the power of 2 bucket count optimization. llvm-svn: 275114
2016-07-11Always use the allocator to construct/destruct elements of a deque/vector. ↵Marshall Clow6-6/+125
Fixes PR#28412. Thanks to Jonathan Wakely for the report. llvm-svn: 275105
2016-07-11Allow is_swappable to SFINAE on deleted/ambiguous swap functionsEric Fiselier2-4/+30
llvm-svn: 275094
2016-07-11Hide some internal symbols for memory resource.Eric Fiselier1-0/+5
llvm-svn: 275089
2016-07-08Fix typo in #ifdef; leave tests commented out b/c gcc 4.8 harks on them.Marshall Clow1-2/+2
llvm-svn: 274882
2016-07-08Implement LWG685 (which is from C++11!). Fixes PR#28421. Note: this ↵Marshall Clow1-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
2016-07-08[libc++] Check hash before calling __hash_table key_eq functionKwasi Mensah1-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
2016-07-06Revert r274605 due to bot failure: ↵Manman Ren1-7/+7
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/244/ llvm-svn: 274651
2016-07-06Fix typo in #ifdef, and re-enable tests now that the green-dragon bots are ↵Marshall Clow1-7/+7
no more llvm-svn: 274605
2016-07-02Add unordered_map::insert benchmark test and rename fileEric Fiselier2-29/+44
llvm-svn: 274424
2016-07-02Improve performance of unordered_set<uint32_t>::find by 45%. Add benchmarks.Eric Fiselier2-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
2016-07-02Handle std::get<T>(...) for std::tuple<>Eric Fiselier2-0/+8
llvm-svn: 274422
2016-07-02Remove workarounds for C++17 inline variable ABI break. It has been fixed in ↵Eric Fiselier2-11/+0
clang. llvm-svn: 274419
2016-07-02Rewrite std::get<Type>(...) helper using constexpr functions.Eric Fiselier6-120/+63
llvm-svn: 274418
2016-07-02Cleanup SFINAE in tuple, and add tests for reference assignmentEric Fiselier3-30/+48
llvm-svn: 274414
2016-07-02Make tuple_constructible and family lazy again.Eric Fiselier2-3/+111
llvm-svn: 274413
2016-07-01Add another workaround for C++17 inline variable ABI breakage.Eric Fiselier1-1/+4
llvm-svn: 274408
2016-07-01Remove accidental change committed in r274403.Eric Fiselier1-1/+1
llvm-svn: 274407
2016-07-01Turn off ASAN's odr-violation diagnostics for now. See PR28391Eric Fiselier1-0/+3
llvm-svn: 274404
2016-07-01Work around ABI break caused by C++17 inline variables.Eric Fiselier1-1/+8
llvm-svn: 274403