Commit Graph

5906 Commits

Author SHA1 Message Date
Eric Fiselier
2d8b51bed3 Fix missing __muloti4 function with UBSAN
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369483 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 00:16:33 +00:00
Eric Fiselier
41cdb89ec7 Attempt to fix MSAN failures in benchmarks
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369482 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 00:14:48 +00:00
Nico Weber
28db4445e2 libcxx: Rename .hpp files in libcxx/test/support to .h
LLVM uses .h as its extension for header files.

Files renamed using:

    for f in libcxx/test/support/*.hpp; do git mv $f ${f%.hpp}.h; done

References to the files updated using:

    for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
        a=$(basename $f);
        echo $a;
        rg -l $a libcxx | xargs sed -i '' "s/$a/${a%.hpp}.h/";
    done

HPP include guards updated manually using:

    for f in $(git diff master | grep 'rename from' | cut -f 3 -d ' '); do
      echo ${f%.hpp}.h ;
    done | xargs mvim

Differential Revision: https://reviews.llvm.org/D66104

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369481 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-21 00:14:12 +00:00
Marshall Clow
4dde9ccef5 Add a missing _VSTD:: before a call to merge. Fixes PR43034. Checked the rest of 'algorithm' looking for unqualified calls. Didn't find any.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369463 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 22:23:35 +00:00
Marshall Clow
b9f7426583 Fix a couple of unguarded operator, calls in algorithm. Fixes PR#43063. Updated all the heap tests to check this.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369448 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 21:31:51 +00:00
Zoe Carver
e44fcf8346 [libc++] Fix std::abs tests
On systems where sizeof(long) == sizeof(int)
the current tests failed. This commit updates
those tests to work on all systems.
std::abs has specific long specializations
which can be used instead.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369437 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 20:44:59 +00:00
Louis Dionne
76dbc2cb72 [libc++] Avoid implicit conversion warning in a <random> test
By stashing the computation of `E::max() - E::min()` in a variable, we
avoid the warning introduced in r367497. Note that we use `auto` to
avoid having to deduce the type of the computation, which is not a
problem since Clang provides `auto` as an extension even in C++03 (and
we disable warnings related to using C++11 extensions in the test suite).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369429 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 19:28:26 +00:00
Eric Fiselier
61563aa43f fix buildbot start script to no longer hang
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369428 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 19:06:23 +00:00
Louis Dionne
4a3529492c [libc++] Implement LWG 3199
Summary:
The resolution of LWG 3199 makes sure that input-streaming into an empty bitset
does not set the failbit on the input stream.

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D65105

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369422 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 18:21:06 +00:00
Louis Dionne
460deb67be [libc++] Precise XFAIL for AppleClang 11
This test doesn't fail on all patch levels of AppleClang 11

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369420 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 18:05:06 +00:00
Eric Fiselier
3b71d7ba1f bump lld version used by buildbots
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369416 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 17:43:00 +00:00
Zoe Carver
3eb5fd97e1 [libc++] fix test for unsigned char
On some systems char is unsigned.
If that is the case, we will now
test signed char twice in std::abs.
NFC. Fixes the build bots.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369413 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 17:09:00 +00:00
Louis Dionne
534d2b1146 [libc++] Disable <chrono> ""d and ""y literal tests on AppleClang 10.0.0
In r368882, I enabled those tests for all AppleClang's above version 9.
However, it turns out that the feature is only supported starting with
AppleClang 10.0.1, not AppleClang 10.0.0. This commit fixes that hole.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369409 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 16:45:27 +00:00
Louis Dionne
969fd81491 [libc++] Populate a lit feature including the compiler patch level
If the compiler is (for example) AppleClang 10.0.1, we would previously
populate the following lit features:

    apple-clang
    apple-clang-10
    apple-clang-10.0

This patch additionally populates a feature called 'apple-clang-10.0.1',
which allows more precise enabling/disabling of tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369406 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 16:41:38 +00:00
Marshall Clow
e746afcf01 Fix availability of __thread_id on builds with external threading. Reviewed as https://reviews.llvm.org/D66480
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369399 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 16:16:23 +00:00
Zoe Carver
8ed9ff748f [libc++] std::abs should not return double
Implement LWG Issue 2735 by adding std::abs
tests for several types and checking their
return value. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369394 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 15:43:25 +00:00
Louis Dionne
f6e8515214 [libc++] Explicitly cast in generate_canonical
A new clang warning introduced in r367497 was complaining about
the change in value.

Thanks to Brian Cain for the patch.
Differential Revision: https://reviews.llvm.org/D66422

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369393 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 15:39:20 +00:00
Mikhail Maltsev
381f2497df [libcxx] Fix build breakage on mips
Fixes https://bugs.llvm.org/show_bug.cgi?id=43011 caused by
https://reviews.llvm.org/D63284.

Committing as obvious.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369364 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-20 10:19:55 +00:00
Louis Dionne
66130ef70f Provide a meaningful diagnostic when LLVM_PATH doesn't point to a directory
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369312 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 23:51:26 +00:00
Louis Dionne
c4fdc11d3a [libc++] Add XFAIL for is_base_of test on AppleClang 11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369280 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 17:29:42 +00:00
Zoe Carver
41b71cbb05 [libc++] reverts commit a5f5aad568bb7a91ceee47641f3076ac339ef8c7.
The commit being reverted caused segfaults when building
with libc++ and GCC (and possibly other configurations).

Differential Revision: https://reviews.llvm.org/D62868

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@369270 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-19 15:47:16 +00:00
Marshall Clow
52ba46bf85 Fix thread comparison by making sure we never pass our special 'not a thread' value to the underlying implementation. Fixes PR#42918.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368916 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 20:54:56 +00:00
Louis Dionne
5e6dc8fc98 [libc++] Mark <chrono> test as unsupported on AppleClang 9
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368914 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 20:27:56 +00:00
Louis Dionne
6dbf2b76ac [libc++] Mark std::tuple CTAD test as failing on AppleClang 9
Like CTAD for std::unordered_set, AppleClang 9's support for CTAD is
insufficient. I suspect the corresponding LLVM Clang is broken too,
but we don't seem to have testers using that Clang.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368911 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 20:17:18 +00:00
Zoe Carver
2e9bd4cf8c This commit removes std::shared_ptr::make_shared and std::shared_ptr::allocate_shared as they are not part of the standard. This commit also adds the helper function "__create_with_cntrl_block" which std::allocate_shared and std::make_shared have been updated to use.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368885 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 17:19:25 +00:00
Louis Dionne
c31d5a4ef3 [libc++] Enable <chrono> ""d and ""y literals for AppleClang 10 and up
AppleClang supports those literals starting in version 10.0.1.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368882 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 17:04:31 +00:00
Louis Dionne
757c2e9bf3 [libc++] Do not define _LIBCPP_CLANG_VER for non-LLVM Clang
In r292833, we started defining _LIBCPP_CLANG_VER to 0 for Apple Clang.
The result is that AppleClang is detected as being a very old version
of LLVM Clang (version 0), which is obviously incorrect.

I believe this was added so that we don't have to check whether
_LIBCPP_CLANG_VER is defined prior to comparing it with a number
(which can trigger a warning). This commit also fixes the two
places that use the macro correspondingly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368880 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 17:01:08 +00:00
Marshall Clow
734e77fb2b Rework recursive_timed_mutex so that it uses __thread_id instead of using the lower-level __libcpp_thread_id. This is prep for fixing PR42918. Reviewed as https://reviews.llvm.org/D65895
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368867 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-14 16:21:27 +00:00
Louis Dionne
72109f5b3e [libc++] Mark two <chrono> tests as unsupported on AppleClang 11
The operator""y and operator""d will eventually be supported by
AppleClang, but no released version supports them at the moment.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368749 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 21:34:49 +00:00
Louis Dionne
9feb945a66 [libc++] Always build with -fvisibility=hidden
Summary:
This avoids symbols being accidentally exported from the dylib when they
shouldn't. The next step is to use a pragma to apply hidden visibility
to all declarations (unless otherwise specified), which will allow us
to drop the per-declaration hidden visibility attributes we currently
have.

This also has the nice side effect of making sure the dylib exports the
same symbols regardless of the optimization level.

PR38138

Reviewers: EricWF, mclow.lists

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D62868

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368703 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 15:02:53 +00:00
Louis Dionne
e1c08e781c [libc++] Fix incorrect UNSUPPORTED annotation
The test was marked as UNSUPPORTED for clang-6 and clang-6, instead of
clang-6 and clang-7.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368666 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 11:25:16 +00:00
Louis Dionne
22eff1a94a [libc++] Use [[nodiscard]] for lock_guard, as an extension
Summary:
D64914 added support for applying [[nodiscard]] to constructors. This
commit uses that capability to flag incorrect uses of std::lock_guard
where one forgets to actually create a variable for the lock_guard.

rdar://45790820

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits, Quuxplusone, lebedev.ri

Tags: #libc

Differential Revision: https://reviews.llvm.org/D65900

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368664 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 11:12:28 +00:00
Louis Dionne
77764d9c0b [libc++] Implement CTAD for std::tuple
Summary:
We were using implicit deduction guides instead of explicit ones,
however the implicit ones don't do work anymore when changing the
constructors.

This commit adds the actual guides specified in the Standard to make
libc++ (1) closer to the Standard and (2) more resistent to changes
in std::tuple's constructors.

Reviewers: Quuxplusone

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D65225

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368599 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 18:30:31 +00:00
Eric Fiselier
6cebf7c36f Improve codegen for deque.
This patch rewrites a few loops in deque and split_buffer to better
optimize the codegen. For constructors like
`deque<unsigned char> d(500000, 0);` this patch results in a 2x speedup.

The patch improves the codegen  in roughly three ways:

1. Changes do { ... } while (...) loops into more typical for loops.
  The optimizer can reason about normal looking loops better.

2. Split the iteration over a range into (A) iteration over the blocks,
then (B) iteration within the block. This nested structure helps LLVM
lower the inner loop to `memset`.

3. Do fewer things each iteration. Some of these loops were incrementing
  or changing 4-5 variables every loop (in addition to the
  construction). Previously most loops would increment the end pointer,
  the size, and decrement the count of remaining items to construct.
  Now we only increment a single pointer for most iterations.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368547 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-12 07:51:05 +00:00
Louis Dionne
60739846ba [libc++] Fix environment variable passing in libc++'s SSHExecutor lit utility
Summary:
Quote the value of environment variables when passing them to the SSH
client in SSHExecutor in libc++'s lit utilities. Without the quotes,
an environment variable like FOO="buzz bar" gets passed incorrectly
like this, ssh env FOO=buzz bar, which causes bar to be treated as a
command to run, not part of the environment variable value.

We ran into this when using SSHExecutor to do bringup of our CUDA
libcu++ port on an embedded aarch64 system.

Patch by Bryce Adelstein Lelbach.

Differential Revision: https://reviews.llvm.org/D65960

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368317 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-08 17:33:35 +00:00
Marshall Clow
a6ac321f01 Implement hh_mm_ss from P1466R3. Reviewed as https://reviews.llvm.org/D65365.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368299 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-08 14:36:07 +00:00
Louis Dionne
1ec0feb111 [pstl] Add a __pstl_config_site header to record the CMake configuration
This commit adds a __pstl_config_site header that contains the value of
macros specified at CMake configuration time. It works similarly to
libc++'s __config_site header, except we always include it as a separate
file instead of concatenating it to the main configuration header.

It is necessary to thread the includes for that header into libc++'s
lit configuration, otherwise we'd be requiring an installation step
prior to running the test suite.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368284 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-08 12:43:04 +00:00
Louis Dionne
16560f681c Revert "[libc++] Take 3: Do not cleverly link against libc++abi just because it happens to be there"
This also reverts "[libc++] Remove temporary hack for D63883".
Clearly, I don't understand how the Linux build bots are configured.

Differential Revision: https://reviews.llvm.org/D63883

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368238 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-08 00:28:06 +00:00
Louis Dionne
c9fa99a44a [libc++] Remove temporary hack for D63883
This should fix the build bots, who now specify explicitly that they're
building against libc++abi.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368216 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 21:51:01 +00:00
Louis Dionne
24d7d907f2 [libc++] Take 3: Do not cleverly link against libc++abi just because it happens to be there
Summary:
Otherwise, when libcxxabi is not an enabled project in the monorepo, we
get a link error because we try to link against non-existent cxxabi_shared.

More generally, we shouldn't change the behavior of the build based on
implicit things like whether a file happens to be at a specific path or
not.

This is a re-application of r365222 that had been reverted in r365233
and then r365359 because it broke the build bots. The build bots
should now specify explicitly what ABI library they want to use
(libc++abi), so this commit should now be OK to merge. It takes a while
for build bots to pick up configuration changes, which is why this failed
the last time around.

Differential Revision: https://reviews.llvm.org/D63883

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368213 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-07 21:36:03 +00:00
Louis Dionne
af16e881aa [pstl][libc++] Provide uglified header names for interface headers
For the few (currently four) headers that make up the PSTL's interface
to other Standard Libraries, provide a stable uglified header file that
can be included by those Standard Libraries.

We can then more easily change the internal organization of the PSTL
without having to change the integration with Standard Libraries.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368088 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 21:11:24 +00:00
Louis Dionne
2858f4dd65 [libc++] Use the monorepo for the back-deployment testing scripts
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368077 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 20:01:28 +00:00
Louis Dionne
f233fe0b2f [libc++] Use the monorepo in the macos-trunk CI script
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@368051 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-06 15:28:34 +00:00
Louis Dionne
69b3c29338 [libc++] Accept any non-zero return for .fail.cpp tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367930 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 21:26:50 +00:00
Louis Dionne
56c0bbff3a [libc++] Take 2: Integrate the PSTL into libc++
Summary:
This commit allows specifying LIBCXX_ENABLE_PARALLEL_ALGORITHMS when
configuring libc++ in CMake. When that option is enabled, libc++ will
assume that the PSTL can be found somewhere on the CMake module path,
and it will provide the C++17 parallel algorithms based on the PSTL
(that is assumed to be available).

The commit also adds support for running the PSTL tests as part of
the libc++ test suite.

The first attempt to commit this failed because it exposed a bug in the
tests for modules. Now that this has been fixed, it should be safe to
commit this.

Reviewers: EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits, mclow.lists, EricWF

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60480

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367903 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-05 18:29:14 +00:00
Eric Fiselier
8279a1399e Revert "Suppress -Wctad-maybe-unsupported on types w/o deduction guides."
Some modules builds are issuing buggy diagnostics. The cause of which is
TBD.

This reverts commit r@367770.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367777 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-04 07:13:43 +00:00
Eric Fiselier
de267ad1f1 Suppress -Wctad-maybe-unsupported on types w/o deduction guides.
There are a handful of standard library types that are intended
to support CTAD but don't need any explicit deduction guides to
do so.

This patch adds a dummy deduction guide to those types to suppress
-Wctad-maybe-unsupported (which gets emitted in user code).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367770 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-03 23:54:29 +00:00
Eric Fiselier
f8066d40c8 Revert accidental change to __member_pointer_traits_imp.
A previous patch accidentally made the primary template
an incomplete type. This broke some C++03 constructs.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367762 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-03 19:03:22 +00:00
Eric Fiselier
871b040ee3 Simplify <type_traits> implementations.
This patch rewrites a number of old meta-function implementations
that assumed const/volatile could not be safely applied to all types.
This is no longer the case, though for some types (Ex function types),
the const qualifier can be ignored.

The largest improvement in this patch is the reduction of is_function.
Thanks to Matt Calabrese for the improved implementation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367749 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-03 05:01:34 +00:00
Eric Fiselier
3e9af5ac6a Add benchmarks to test the cost of allocator
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367722 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-02 21:13:38 +00:00