Commit Graph

2831 Commits

Author SHA1 Message Date
Eric Fiselier fb946da259 Add checkpoint diagnostics to help diagnose buildbot failures.
llvm-svn: 275754
2016-07-18 03:00:09 +00:00
Eric Fiselier 03f46fc2ed Prevent failures by marking Clock::is_steady tests as UNSUPPORTED: asan.
llvm-svn: 275753
2016-07-18 02:29:33 +00:00
Eric Fiselier ec0a4c9946 Add includes in test. Patch from STL@microsoft.com
llvm-svn: 275751
2016-07-18 02:05:31 +00:00
Eric Fiselier c45fb90fd4 Upgrade arcconfig to use https
llvm-svn: 275750
2016-07-18 02:02:49 +00:00
Eric Fiselier 35b6413d1b Rename and rework `_LIBCPP_TRIVIAL_PAIR_COPY_CTOR`. Move FreeBSD 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-18 01:58:37 +00:00
Eric Fiselier 1447da3383 Suppress warning in make_from_tuple tests.
llvm-svn: 275748
2016-07-18 01:52:46 +00:00
Eric Fiselier 03e29a2964 Implement C++17 tuple bits. Including apply and make_from_tuple.
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-18 00:35:56 +00:00
Eric Fiselier 6a411472e3 Check for unconstrained hash equality before constrained hash equality.
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-17 22:04:57 +00:00
Eric Fiselier 649da70def Fix std::experimental::optional tests. Patch from Casey Carter.
llvm-svn: 275732
2016-07-17 20:32:30 +00:00
Marshall Clow 9531bbd7c3 Constuct a sentry object in istream::readsome, and handle failures appropriately. Fixes PR#28217.
llvm-svn: 275280
2016-07-13 16:58:48 +00:00
Marshall Clow 10e8bef1d4 Add more tests for LWG#2582. No code changes needed, just tests.
llvm-svn: 275211
2016-07-12 20:15:46 +00:00
JF Bastien 5868e5dde9 libc++: name anonymous structs
As discussed in http://reviews.llvm.org/D22073

llvm-svn: 275210
2016-07-12 20:14:52 +00:00
Marshall Clow 8001ccd06e Add tests for the meta.unary.props that do not require a complete type. This is part of LWG#2582
llvm-svn: 275184
2016-07-12 15:50:53 +00:00
Marshall Clow ced86bf736 mark issue #2422 as complete; this was just a wording clarification
llvm-svn: 275177
2016-07-12 15:29:35 +00:00
Marshall Clow 191cbb2406 mark issue #2181 as complete; this was just a wording clarification
llvm-svn: 275176
2016-07-12 15:15:55 +00:00
Saleem Abdulrasool 6fe307334f Add option to disable __deallocate #warning
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-12 14:39:13 +00:00
Marshall Clow 92aa427bb8 Put the status in the right column
llvm-svn: 275171
2016-07-12 14:38:59 +00:00
Marshall Clow 7658df4bcd Mark P0067 as 'postponed', because it will be revised before the next meeting
llvm-svn: 275170
2016-07-12 14:37:39 +00:00
Eric Fiselier 118cb4180f Don't compute modulus of hash if it is smaller than the bucket count.
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-11 22:02:02 +00:00
Marshall Clow dc3eb83d08 Always use the allocator to construct/destruct elements of a deque/vector. Fixes PR#28412. Thanks to Jonathan Wakely for the report.
llvm-svn: 275105
2016-07-11 21:38:08 +00:00
Eric Fiselier 0774aa96dc Allow is_swappable to SFINAE on deleted/ambiguous swap functions
llvm-svn: 275094
2016-07-11 19:57:13 +00:00
Eric Fiselier faaeaaf0d8 Hide some internal symbols for memory resource.
llvm-svn: 275089
2016-07-11 19:22:09 +00:00
Marshall Clow bc3b1f3b7b Fix typo in #ifdef; leave tests commented out b/c gcc 4.8 harks on them.
llvm-svn: 274882
2016-07-08 16:59:54 +00:00
Marshall Clow 947ce6b59f Implement LWG685 (which is from C++11!). Fixes PR#28421. Note: this (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 16:54:47 +00:00
Kwasi Mensah 318d35a7bc [libc++] Check hash before calling __hash_table key_eq function
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-08 15:34:28 +00:00
Manman Ren 78fa242ec2 Revert r274605 due to bot failure: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/244/
llvm-svn: 274651
2016-07-06 18:24:53 +00:00
Marshall Clow 5c29783bf2 Fix typo in #ifdef, and re-enable tests now that the green-dragon bots are no more
llvm-svn: 274605
2016-07-06 05:28:44 +00:00
Eric Fiselier c835c12f6c Add unordered_map::insert benchmark test and rename file
llvm-svn: 274424
2016-07-02 05:30:54 +00:00
Eric Fiselier f977598bb6 Improve performance of unordered_set<uint32_t>::find by 45%. Add benchmarks.
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-02 05:19:59 +00:00
Eric Fiselier 4f905b8daa Handle std::get<T>(...) for std::tuple<>
llvm-svn: 274422
2016-07-02 03:46:08 +00:00
Eric Fiselier 3a0485427f Remove workarounds for C++17 inline variable ABI break. It has been fixed in clang.
llvm-svn: 274419
2016-07-02 03:21:58 +00:00
Eric Fiselier f447e62e1d Rewrite std::get<Type>(...) helper using constexpr functions.
llvm-svn: 274418
2016-07-02 03:18:30 +00:00
Eric Fiselier 27cdf401ea Cleanup SFINAE in tuple, and add tests for reference assignment
llvm-svn: 274414
2016-07-02 01:25:46 +00:00
Eric Fiselier 7b60958aea Make tuple_constructible and family lazy again.
llvm-svn: 274413
2016-07-02 00:58:17 +00:00
Eric Fiselier fa10f41f3e Add another workaround for C++17 inline variable ABI breakage.
llvm-svn: 274408
2016-07-01 23:41:48 +00:00
Eric Fiselier d3ac6ae7d3 Remove accidental change committed in r274403.
llvm-svn: 274407
2016-07-01 23:31:55 +00:00
Eric Fiselier 58b6e3e3d0 Turn off ASAN's odr-violation diagnostics for now. See PR28391
llvm-svn: 274404
2016-07-01 23:25:47 +00:00
Eric Fiselier d3a1ed814b Work around ABI break caused by C++17 inline variables.
llvm-svn: 274403
2016-07-01 23:22:25 +00:00
Eric Fiselier e2fd8b8db9 Flatten tuple_constructible, tuple_convertible and tuple_assignable.
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
2016-07-01 04:07:39 +00:00
Eric Fiselier 10b9a1bb42 Flatten the tuple_element and __make_tuple_types implementations.
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
2016-07-01 03:54:54 +00:00
Eric Fiselier 9743af6e31 Replace __make_tuple_indices implementation with superior implementation.
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
2016-06-30 22:34:43 +00:00
Marshall Clow 3b8669edbf Fix static assert problem on gcc; remove XFAILs that I put in in r274250
llvm-svn: 274285
2016-06-30 22:05:45 +00:00
Eric Fiselier 19cf6b6c93 Fix C++03 build.
llvm-svn: 274274
2016-06-30 20:46:58 +00:00
Marshall Clow f7aaf31c53 Mark issues 2550, 2551, 2555, 2685, 2698 as complete. These issues are wording clarifications; no code changes required.
llvm-svn: 274255
2016-06-30 18:05:19 +00:00
Marshall Clow 2f63da2887 Mark issues 2667, 2669, 2670, 2671, 2673 as complete. These issues are wording clarifications; no code changes required.
llvm-svn: 274253
2016-06-30 17:59:01 +00:00
Marshall Clow e46c0885ff Implement LWG#2688: 'clamp misses preconditions and has extraneous condition on result'. We already did this, just added tests
llvm-svn: 274252
2016-06-30 17:52:51 +00:00
Marshall Clow bc4618647f Temporarily XFAIL the incomplete type tests for GCC while I figure out why adding a static_assert in r274235 broken them
llvm-svn: 274250
2016-06-30 17:49:36 +00:00
Marshall Clow c8afc869b0 Implement LWG#2684: 'priority_queue lacking comparator typedef'. We already did this, just added tests
llvm-svn: 274243
2016-06-30 16:03:50 +00:00
Marshall Clow 81fce9729c Implement LWG#2596: 'vector::data() should use addressof'
llvm-svn: 274241
2016-06-30 15:50:55 +00:00
Marshall Clow e766a87b01 Implement LWG#2441: 'Exact-width atomic typedefs should be provided'
llvm-svn: 274236
2016-06-30 15:28:38 +00:00