Commit Graph

32 Commits

Author SHA1 Message Date
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
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
Louis Dionne
33f76384d0 Revert "[libc++] Integrate the PSTL into libc++"
This reverts r366593, which caused unforeseen breakage on the build bots.
I'm reverting until the problems have been figured out and fixed.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@366603 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-19 18:52:46 +00:00
Louis Dionne
106db235ed [libc++] 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.

Reviewers: rodgert, 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@366593 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-19 17:02:42 +00:00
Marshall Clow
389b4e6d63 Fix the floating point version of midpoint. It wasn't constexpr, among other things. Add more tests. As a drive-by, the LCD implementation had a class named '__abs' which did a 'absolute value to a common-type' conversion. Rename that to be '__ct_abs'.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363714 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-18 18:13:54 +00:00
Louis Dionne
c30e2d9f77 [NFC][libcxx] Remove trailing whitespace
It's incredibly annoying when trying to create diffs

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361981 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-29 16:01:36 +00:00
Marshall Clow
58320bef19 Add additional constraints on midpoint(pointer, pointer). Fixes PR#42037.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@361970 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-29 15:17:55 +00:00
Marshall Clow
2f323247cc Mark private function __sign as constexpr.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@360167 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-07 16:07:24 +00:00
Marshall Clow
321a1f890d Implement midpoint for floating point types. Reviewed as https://reviews.llvm.org/D61014.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359184 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-25 12:11:43 +00:00
Marshall Clow
5310aa3850 Add std::midpoint for integral and poiner types. Described in P0811, reviewed as D59099.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356162 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-14 16:25:55 +00:00
Chandler Carruth
7c3769df62 Update more file headers across all of the LLVM projects in the monorepo
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351648 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 10:56:40 +00:00
Marshall Clow
e3973fd962 Implement the infrastructure for feature-test macros. Very few actual feature test macros, though. Reviewed as: https://reviews.llvm.org/D51955
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342073 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-12 19:41:40 +00:00
Louis Dionne
2580fdbb5a [NFC][libc++] Consistently use spaces to indent
rdar://problem/19988944

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338933 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03 22:36:53 +00:00
Billy Robert O'Neal III
70a8aae298 Fix incorrect handling of move-only types in transform_reduce iter iter iter init, and add test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@321851 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 01:31:57 +00:00
Billy Robert O'Neal III
b68e9c13a0 Automated trailing whitespace removal by VS Code.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@321850 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 01:31:55 +00:00
Marshall Clow
3477ae445a Implement inclusive_scan/transform_inclusive_scan for C++17.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@306083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-23 05:12:42 +00:00
Marshall Clow
0175dfdfdf Implement the non-parallel versions of reduce and transform_reduce for C++17
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 04:48:45 +00:00
Marshall Clow
fb97c4408f Implement the non-parallel versions of exclusive_scan and transform_exclusive_scan. Reviewed as https://reviews.llvm.org/D34038.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305136 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-10 02:22:13 +00:00
Eric Fiselier
018a3d51a4 [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows
Summary:
This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning.
This patch changes libc++ to use `#pragma push_macro`  to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header.

Reviewers: mclow.lists, bcraig, compnerd, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, krytarowski

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304357 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 22:07:49 +00:00
Eric Fiselier
9197008809 Fix GCC 7 test failures.
This patch fixes the test failures and unexpected passes that occur
when testing against GCC 7. Specifically:

* don't mark __gcd as always inline because it's a recursive function. GCC diagnoses this.
* don't XFAIL the aligned allocation tests. GCC 7 supports them but not the -faligned-allocation option.
* Work around gcc.gnu.org/PR78489 in variants constructors.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302488 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09 00:00:00 +00:00
Marshall Clow
ebf66a385f Make lcm/gcd work better in edge cases. Fixes a UBSAN failure.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294779 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 20:49:08 +00:00
Eric Fiselier
34da9b5d09 Add missing include in <numeric>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 00:14:13 +00:00
Marshall Clow
db7fa111ab Fixes for LWG 2598, 2686, 2739, 2742, 2747, and 2759, which were adopted last week in Issaquah
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286858 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 18:22:19 +00:00
Marshall Clow
1c1e91d9a3 Implement LCM and GCD for C++17. Same code as for Library Fundamentals TS.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 14:29:45 +00:00
Eric Fiselier
b991975439 [libcxx] Fix use of operator comma where the types can be user defined
Summary:
An evil user might overload operator comma. Use a void cast to make sure any user overload is not selected.
Modify all the test iterators to define operator comma. 

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5929

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@220706 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-27 19:28:20 +00:00
Howard Hinnant
1c44f51de7 Zhihao Yuan noted that a move assignment operation was missing from std::adjacent_difference. Fixed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189036 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 18:02:34 +00:00
Howard Hinnant
78b6828f14 More windows port work by Ruben Van Boxem
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@142732 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-22 20:59:45 +00:00
Howard Hinnant
08e17472e4 Windows support by Ruben Van Boxem.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@142235 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 20:05:10 +00:00
Howard Hinnant
b64f8b07c1 license change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@119395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 22:09:02 +00:00
Howard Hinnant
ebef7459b2 [numeric.iota]
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@104719 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-26 18:53:44 +00:00
Howard Hinnant
f5256e16df Wiped out some non-ascii characters that snuck into the copyright.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 21:36:01 +00:00
Howard Hinnant
bc8d3f97eb libcxx initial import
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@103490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-11 19:42:16 +00:00