Commit Graph

5943 Commits

Author SHA1 Message Date
Michał Górny a9b5fff591 [libcxx{,abi}] Emit deplibs only when detected by CMake
This is a followup to 35bc5276ca.  It fixes the dependent libs usage
in libcxx and libcxxabi to link pthread and rt libraries only if CMake
detects them, rather than based on explicit platform blacklist.

Differential Revision: https://reviews.llvm.org/D70888
2019-12-02 22:19:20 +01:00
David Zarzycki 06e5ebf8db
[libcxx] Add -Wno-deprecated-copy to the test config 2019-11-29 09:57:51 +02:00
marshall 703c26f03b Optimize and fix basic_string move assignment operator. Reviewed as https://reviews.llvm.org/D68623. Thanks to mvels for the patch. 2019-11-27 07:13:32 -08:00
Shoaib Meenai d018b556c7 [libcxx] Omit unneeded locale fallbacks on Android 21+
Android API level 21 and above have all these functions available, so we
don't need to include our fallback definitions.

Differential Revision: https://reviews.llvm.org/D69983
2019-11-25 11:06:08 -08:00
Sergej Jaskiewicz 0313075793 [libcxx] Add Sergej Jaskiewicz to CREDITS.txt
Summary: Also, test commit access

Reviewers: EricWF

Subscribers: christof, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D70526
2019-11-21 12:06:10 +03:00
Louis Dionne 9918312682 [libc++] Separate -include and path to the site config file
This apparently breaks weird use cases where the build directory is on
a separate drive. Someone reported that failure to me privately.

I can't remember of a reason for collating the two arguments in the
first place, so I don't think this should break anything.
2019-11-18 16:28:53 -05:00
Dan Albert 19fd9039ca Fix _LIBCPP_HAS_ definitions for Android.
Summary:
Android added quick_exit()/at_quick_exit() in API level 21,
aligned_alloc() in API level 28, and timespec_get() in API level 29,
but has the other C11 features at all API levels (since they're basically
just coming from clang directly).

_LIBCPP_HAS_QUICK_EXIT and _LIBCPP_HAS_TIMESPEC_GET already existed,
so we can reuse them. (And use _LIBCPP_HAS_TIMESPEC_GET in a few more
places where _LIBCPP_HAS_C11_FEATURES has been used as a proxy. This
isn't correct for Android.)

_LIBCPP_HAS_ALIGNED_ALLOC is added, to cover aligned_alloc() (obviously).

Add a missing std:: before aligned_alloc in a cstdlib test, and remove a
couple of !defined(_WIN32)s now that we're explicitly testing
TEST_HAS_ALIGNED_ALLOC rather than TEST_HAS_C11_FEATURES.

Reviewers: danalbert, EricWF, mclow.lists

Reviewed By: danalbert

Subscribers: srhines, christof, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D69929
2019-11-18 12:19:58 -08:00
Dan Albert 626260cfe3 Update the docs for building libc++.
Summary:
Rewrite the in-tree build to be a clearer tl;dr like we have for the
out-of-tree build.

Reviewers: EricWF, mclow.lists, ldionne

Reviewed By: ldionne

Subscribers: dexonsmith, christof, ldionne, enh, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D69917
2019-11-18 12:14:13 -08:00
Eric Fiselier f82dba0192 Rename __is_foo_iterator traits to reflect their Cpp17 nature.
With the upcoming introduction of iterator concepts in ranges,
the meaning of "__is_contiguous_iterator" changes drastically.

Currently we intend it to mean "does it have this iterator category",
but it could now also mean "does it meet the requirements of this
concept", and these can be different.
2019-11-18 01:49:32 -05:00
Eric Fiselier 6624fcba43 [libc++] Add _ITER_CONCEPT and _ITER_TRAITS implementations from C++20
These traits are currently unused because we don't implement ranges.
However, their addition is part of ongoing work to allow libc++
to optimize on user-provided contiguous iterators.
2019-11-16 20:26:35 -05:00
Eric Fiselier 45d048c204 [libc++] Add C++20 contiguous_iterator_tag.
This work is part of an ongoing effort to allow libc++ to
optimize user provided contiguous iterators.
2019-11-16 20:14:44 -05:00
Eric Fiselier 0068c59139 [libc++] Rename __to_raw_pointer to __to_address.
This function has the same behavior as the now-standand std::to_address.
Re-using the name makes the behavior more clear, and in the future it
will allow us to correctly get the raw pointer for user provided pointer
types.
2019-11-16 17:16:09 -05:00
Marek Kurdej 8e34be2f25 [libc++] [chrono] Fix year_month_weekday::ok() implementation.
Reviewers: ldionne, EricWF, mclow.lists

Reviewed By: mclow.lists

Subscribers: christof, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D70282
2019-11-15 18:48:45 +01:00
Ilya Tokar 767eadd782 [libcxx] use __builtin_isnan in std::isnan.
Summary: This allows std::isnan to be fully inlined, instead of generating calls.

Reviewers: EricWF

Reviewed By: EricWF

Subscribers: christof, ldionne

Differential Revision: https://reviews.llvm.org/D69806
2019-11-15 12:29:18 -05:00
Marek Kurdej 76ac1660f7 [libc++] [P0920] [P1661] Update status page. 2019-11-15 00:12:34 +01:00
Louis Dionne 1466335cf4 [libc++][P1872] span should have size_type, not index_type.
Thanks to Marek Kurdej for the patch.

Differential Revision: https://reviews.llvm.org/D70206
2019-11-14 09:07:05 -05:00
Louis Dionne 8b77a3a0f4 [libc++] [P1612] Add missing feature-test macro __cpp_lib_endian.
Thanks to Marek Kurdej for the patch.

Differential Revision: https://reviews.llvm.org/D70221
2019-11-14 08:55:19 -05:00
Marek Kurdej d94f63758a libc++ status page: Fix HTML. 2019-11-13 22:51:29 +01:00
David Zarzycki 1d55c9e59e [libcxx testing] Fix -Wtautological-overlap-compare bug 2019-11-13 10:55:19 +02:00
Michael Park eb8710cb93
[libc++][P0980] Marked member functions move/copy/assign of char_traits constexpr.
Reviewers: ldionne, EricWF, mclow.lists

Reviewed By: ldionne

Subscribers: christof, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D68840
2019-11-11 09:49:48 -08:00
Nick Desaulniers 49fb4a96e0 change LLVM_VERSION_SUFFIX default from svn to git
Summary:
Sayonara SVN!

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Reviewers: tstellar, jyknight, lebedev.ri, smeenai, mgorny, hans, mclow.lists

Reviewed By: mgorny, hans

Subscribers: christof, libcxx-commits, llvm-commits, srhines

Tags: #libc, #llvm

Differential Revision: https://reviews.llvm.org/D70019
2019-11-11 09:10:20 -08:00
Louis Dionne 48b7068bec [libc++] Mark __call_once_proxy as hidden and internal
We effectively never want to export that function, which is an
implementation detail of libc++. This was previously tried in
603715c66b and then reverted in 8335dd314f because it caused
linker warnings. These linker warnings should go away now that we
use internal_linkage instead of always_inline to implement per-TU
insulation.
2019-11-11 10:27:48 -05:00
marshall 2f4fb200b6 libc++ status page: New papers and issues adopted in Belfast 2019-11-11 08:13:05 +00:00
Mark de Wever 27c4eaac8c [libc++] Validate the entire regex is consumed
This change would have warned about the bug found in D62451.
No unit tests since the exception should never throw.

Differential Revision: https://reviews.llvm.org/D62452
2019-11-09 17:01:37 +01:00
Louis Dionne 0ec6a4882e [libc++] Fix potential OOB in poisson_distribution
See details in the original Chromium bug report:
    https://bugs.chromium.org/p/chromium/issues/detail?id=994957
2019-11-07 13:29:40 +00:00
Louis Dionne 83901cbe5e [libc++] Fixed copy/copy_n/copy_backward for compilers that do not support is_constant_evaluated.
Differential Revision: https://reviews.llvm.org/D69940
2019-11-07 12:39:10 +00:00
Louis Dionne e9612e9e85 [libc++] Fix some constexpr tests broken by D68837
This doesn't fix all the issues with D68837
2019-11-07 12:29:17 +00:00
Louis Dionne fd02a46855 [libcxx] Make generate_feature_test_macro_components script compatible with Python 3.
The script is still compatible with Python 2 as well.
Thanks to Marek Kurdej for the patch.

Differential Revision: https://reviews.llvm.org/D69884
2019-11-06 16:45:47 +00:00
Louis Dionne 13c90a5716 [libc++][P0202] Marked algorithms copy/copy_n/copy_if/copy_backward constexpr
Thanks to Michael Park for the patch.

Differential Revision: https://reviews.llvm.org/D68837
2019-11-06 12:02:41 +00:00
Jorg Brown 586952f4ce Optimize std::midpoint for integers
Same idea as the current algorithm, that is, add (half of the difference between a and b) to a.

But we use a different technique for computing the difference: we compute b - a into a pair of integers that are named "sign_bit" and "diff". We have to use a pair because subtracting two 32-bit integers produces a 33-bit result.

Computing half of that is a simple matter of shifting diff right by 1, and adding sign_bit shifted left by 31. llvm knows how to do that with one instruction: shld.

The only tricky part is that if the difference is odd and negative, then shifting it by one isn't the same as dividing it by two - shifting a negative one produces a negative one, for example. So there's one more adjustment: if the sign bit and the low bit of diff are one, we add one.

For a demonstration of the codegen difference, see https://godbolt.org/z/7ar3K9 , which also has a built-in test.

Differential Revision: https://reviews.llvm.org/D69459
2019-11-04 19:00:23 -08:00
Saleem Abdulrasol 5ce2c6d2db build: avoid custom handling for C++ standard
Use the builtin CMake support for specifying the proper flags for the targets to
build at a certain C++ standard.  This avoids unnecessary checks in CMake,
speeding up the configure phase as well as simplifies the logic overall.
2019-11-02 15:07:54 -04:00
Dávid Bolvanský dba8396572 [libcxx] Disable -Wconstant-evaluated for testsuite
Reviewers: EricWF

Subscribers: christof, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D69708
2019-11-01 13:46:47 +01:00
Louis Dionne adadc665f8 [libc++] Add test and remove workaround for PR13592
PR13592 was caused by a problem in how to compiler implemented the
__is_convertible_to intrinsic. That problem, reported as PR13591,
was fixed back in 2012. We don't support such old versions of Clang
anyway, so we don't need the library workaround that had been added
to solve PR13592 (while waiting for the compiler fix).
2019-10-30 15:52:11 -07:00
Louis Dionne 3c9063f5d2 [libc++] Force the ABI namespace to be a reserved identifier
Summary:
When the ABI namespace isn't a reserved identifier, we were issuing a
warning, but this should have been an error since the beginning. This
commit enforces that the ABI namespace is a reserved identifier, and
changes the ABI namespace used by LibFuzzer.

Reviewers: phosek, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, #sanitizers, libcxx-commits, llvm-commits

Tags: #sanitizers, #libc, #llvm

Differential Revision: https://reviews.llvm.org/D69408
2019-10-29 10:55:43 -07:00
David Blaikie e658b3eb97 PR43764: Qualify a couple of calls to forward_as_tuple to be ADL-resilient. 2019-10-28 18:04:41 -07:00
--global a062856bcf [NFC] Comment endif to test commit access 2019-10-28 09:19:08 -07:00
marshall 82b82e39c4 Add all the issues to be voted upon in Belfast 2019-10-26 07:53:15 -07:00
Louis Dionne fd667b860e [libcxx] [test] Run `chmod +x` on executables when testing via SSH
When running libc++ tests on a remote machine via SSH, we can encounter
a 'Permission denied' error.

Fix this with plain old 'chmod +x <executable>'.

Thanks to Sergej Jaskiewicz for the patch.

Differential Revision: https://reviews.llvm.org/D69170
2019-10-25 09:47:46 -07:00
Stephan T. Lavavej 2e4f1e112d [www] Change URLs to HTTPS.
This changes most URLs in llvm's html files to HTTPS. Most changes were
search-and-replace with manual verification; some changes were manual.
For a few URLs, the websites were performing redirects or had changed
their anchors; I fixed those up manually. This consistently uses the
official https://wg21.link redirector. This also strips trailing
whitespace and fixes a couple of typos.

Fixes D69363.

There are a very small number of dead links for which I don't know any
replacements (they are equally dead as HTTP or HTTPS):

https://llvm.org/cmds/llvm2cpp.html
https://llvm.org/devmtg/2010-11/videos/Grosser_Polly-desktop.mp4
https://llvm.org/devmtg/2010-11/videos/Grosser_Polly-mobile.mp4
https://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-desktop.mov
https://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-mobile.mp4
https://llvm.org/perf/db_default/v4/nts/22463
https://polly.llvm.org/documentation/memaccess.html
2019-10-24 13:25:15 -07:00
Stephan T. Lavavej 7c9844b66e [libcxx][NFC] Strip trailing whitespace, fix typo. 2019-10-23 11:49:43 -07:00
Louis Dionne 6b77ebdc91 [NFC] Strip trailing whitespace from libc++ 2019-10-23 11:19:19 -07:00
Casey Carter 689ce81059
[libc++][NFC] Remove excess trailing newlines from most files
Testing git commit access.
2019-10-23 08:08:57 -07:00
Stephan T. Lavavej 437e0e5191 [libcxx][test][NFC] Fix comment typos.
(Testing git commit access.)
2019-10-22 15:22:13 -07:00
Louis Dionne 19e95ab421 [NFC] Strip trailing whitespace in test to test Github committing 2019-10-22 15:03:01 -07:00
Zoe Carver 40c47680eb [libcxx] Remove shared_ptr::make_shared
Summary: This patch removes `shared_ptr::make_shared` as it is not part of the standard. This patch also adds __create_with_cntrl_block, which is a help function that can be used in std::allocate_shared and std::make_shared. This is the third patch (out of 4) from D66178.

    Reviewers: EricWF, mclow.lists, ldionne

    Subscribers: christof, dexonsmith, libcxx-commits

    Tags: #libc

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

llvm-svn: 375504
2019-10-22 15:16:49 +00:00
Louis Dionne 3292facc0a [NFC] Fix typos in CMake comment
llvm-svn: 375469
2019-10-21 23:38:32 +00:00
Dimitry Andric d5367db95c Refine check for `_LIBCPP_C_HAS_NO_GETS` on FreeBSD
Summary:
In D67316 we added `_LIBCPP_C_HAS_NO_GETS` to signal that the C library
does not provide `gets()`, and added a test for FreeBSD 13 or higher,
using the compiler-defined `__FreeBSD__` macro.

Unfortunately this did not work that well for FreeBSD's own CI process,
since the gcc compilers used for some architectures define `__FreeBSD__`
to match the build host, not the target.

Instead, we should use the `__FreeBSD_version` macro from the userland
header `<osreldate.h>`, which is more fine-grained.  See also
<https://reviews.freebsd.org/D22034>.

Reviewers: EricWF, mclow.lists, emaste, ldionne

Reviewed By: emaste, ldionne

Subscribers: dexonsmith, bsdjhb, krytarowski, christof, ldionne, libcxx-commits

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

llvm-svn: 375340
2019-10-19 10:59:23 +00:00
Richard Smith a9727033fb P1152R4: Fix deprecation warnings in libc++ testsuite and in uses of is_invocable that would internally conjure up a deprecated function type.
Summary: The implementation of P1152R4 in Clang has resulted in some deprecation warnings appearing in the libc++ and libc++abi test suite. Fix or suppress these warnings.

Reviewers: mclow.lists, EricWF

Subscribers: christof, ldionne, libcxx-commits

Tags: #libc

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

llvm-svn: 375307
2019-10-19 00:06:00 +00:00
Casey Carter 6f0768f64d [libc++][test] Use <version> to get config on MSVC
...instead of `<ciso646>`.

Also includes some NFC comment changes.

llvm-svn: 374854
2019-10-15 00:22:38 +00:00
Casey Carter fcad66f165 [libc++][test] Portability fix for std::any tests
Ensure that `large_tracked_t` defined in `any_helpers.h` is in fact too large to fit in `std::any`'s small object buffer.

llvm-svn: 374806
2019-10-14 19:05:04 +00:00