Commit Graph

168 Commits

Author SHA1 Message Date
Thomas A
a574ade231 Downgrading libcxx to llvmorg-13.0.1
It turns out that llvmorg-14.0.6 might be too new for dyld (the vector base class no longer exist in that release).
2022-06-26 13:05:32 -07:00
Thomas A
e3bbeb7fdc Update libcxx source to llvmorg-14.0.6 2022-06-26 09:13:52 -07:00
David Zarzycki
b0651b603e [libcxx] Do not implicitly #include assert.h
Users should only get the assert() macros if they explicitly include
them.

Found after switching from the GNU C++ stdlib to the LLVM C++ stdlib.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@372963 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 11:12:29 +00:00
Louis Dionne
4211451486 [libcxx] Slightly improved policy for handling experimental features
Summary:
Following the discussion on the libcxx-dev mailing list
(http://lists.llvm.org/pipermail/libcxx-dev/2019-May/000358.html),
this implements the new policy for handling experimental features and
their deprecation. We basically add a deprecation warning for
std::experimental::filesystem, and we remove a bunch of <experimental/*>
headers that were now empty.

Reviewers: mclow.lists, EricWF

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

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@363072 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 14:48:40 +00:00
Marshall Clow
cac04cde5e Implement LWG 2960: nonesuch is insufficiently useless
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359526 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-30 00:54:38 +00:00
Eric Fiselier
6049636175 Fix visibility for coroutine types on Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358551 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 04:31:46 +00:00
Brian Gesiak
2c4b419ec4 Revert "[coroutines] Add std::experimental::task<T> type"
This revision is causing build and test failures, such as
http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-armv8-linux/builds/648/steps/test.libcxx/logs/stdio,
so I'll revert it.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357023 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 19:50:46 +00:00
Brian Gesiak
e83c41a26a [coroutines] Add std::experimental::task<T> type
Summary:
Adds the coroutine `std::experimental::task<T>` type described in proposal P1056R0.
See https://wg21.link/P1056R0.

This implementation allows customization of the allocator used to allocate the
coroutine frame by passing std::allocator_arg as the first argument, followed by
the allocator to use.

This supports co_awaiting the same task multiple times. The second and
subsequent times it returns a reference to the already-computed value.

This diff also adds some implementations of other utilities that have potential for
standardization as helpers within the test/... area:
- `sync_wait(awaitable)` - See P1171R0
- `manual_reset_event`

Move the definition of the __aligned_allocation_size helper function
from <experimental/memory_resource> to <experimental/__memory>
so it can be more widely used without pulling in memory_resource.

Outstanding work:
- Use C++14 keywords directly rather than macro versions
  eg. use `noexcept` instead of `_NOEXCEPT`).
- Add support for overaligned coroutine frames.
  This may need wording in the Coroutines TS to support passing the extra `std::align_val_t`.
- Eliminate use of `if constexpr` if we want it to compile under C++14.

Patch by @lewissbaker (Lewis Baker).



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357010 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 17:46:06 +00:00
Louis Dionne
9a0df177ae [libc++] Remove visibility-related warnings with Clang 8
The attributes were placed incorrectly -- they need to be after the
"struct" keyword, not before.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355006 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 17:33:25 +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
Chandler Carruth
4abbf7dac3 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

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@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Eric Fiselier
272871b658 Move internal usages of alignof/__alignof to use _LIBCPP_ALIGNOF.
Summary:
Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See  llvm.org/PR39713

This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used.

This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement.

I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. 

Reviewers: ldionne, EricWF

Reviewed By: ldionne, EricWF

Subscribers: jyknight, christof, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351289 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 01:51:12 +00:00
Eric Fiselier
6420803549 Fix PR39749 - Headers containing just #error harm __has_include.
This patch changes <experimental/foo> to use #warning instead of
is harmful to common feature detection idioms.

We should also consider only emitting the warning when __DEPRECATED is
defined, like we do in the <ext/foo> headers. Users may want to specify
"-Werror=-W#warnings" while still ignoring the libc++ warnings.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@350485 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-06 00:37:31 +00:00
Eric Fiselier
e3e576ae50 Revert "Move internal usages of alignof/__alignof to use _LIBCPP_ALIGNOF. "
This reverts commit 087f065cb0.

The tests were failing on 32 bit builds, and I don't have time
to clean them up right now. I'll recommit tomorrow with fixed tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347816 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 22:24:19 +00:00
Eric Fiselier
087f065cb0 Move internal usages of alignof/__alignof to use _LIBCPP_ALIGNOF.
Summary:
Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See  llvm.org/PR39713

This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used.

This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement.

I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. 

Reviewers: ldionne, EricWF

Reviewed By: EricWF

Subscribers: christof, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347787 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 18:16:02 +00:00
Louis Dionne
581671fd26 [libcxx] Remove dynarray
Summary:
std::dynarray had been proposed for C++14, but it was pulled out from C++14
and there are no plans to standardize it anymore.

Reviewers: mclow.lists, EricWF

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

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@347783 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 18:02:00 +00:00
Eric Fiselier
e09f85bbe5 Implement sized deallocation for std::allocator and friends.
Summary:
C++14 sized deallocation is disabled by default due to ABI concerns. However, when a user manually enables it then libc++ should take advantage of it since sized deallocation can provide a significant performance win depending on the underlying malloc implementation. (Note that libc++'s definitions of sized delete don't do anything special yet, but users are free to provide their own).

This patch updates __libcpp_deallocate to selectively call sized operator delete when it's available. `__libcpp_deallocate_unsized` should be used when the size of the allocation is unknown.

On Apple this patch makes no attempt to determine if the sized operator delete is unavailable, only that the language feature is enabled. This could cause a compile error when using `std::allocator`, but the same compile error would occur whenever the user calls `new`, so I don't think it's a problem.

Reviewers: ldionne, mclow.lists

Reviewed By: ldionne

Subscribers: rsmith, ckennelly, libcxx-commits, christof

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345281 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-25 17:21:30 +00:00
Eric Christopher
92d87364ff Revert "Fix use of __libcpp_deallocate in dynarray"
This reverts commit r345234 as it depended on the sized deallocation commit.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345240 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-25 06:43:56 +00:00
Eric Fiselier
d03e037f46 Fix use of __libcpp_deallocate in dynarray
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@345234 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-25 02:36:31 +00:00
Tim Shen
154f393a5c Re-apply "[libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to."
...with proper guarding #ifdefs for unsupported C++11.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338318 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 22:27:38 +00:00
Tim Shen
b6244cf5af Revert "[libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to."
This reverts commit r338309.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338316 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 22:21:22 +00:00
Tim Shen
373299533a [libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to.
Summary:
This patch adds a new macro _LIBCPP_HAS_NO_VECTOR_EXTENSION for detecting
whether a vector extension (\_\_attribute\_\_((vector_size(num_bytes)))) is
available.

On the top of that, this patch implements the following API:
* all constructors
* operator[]
* copy_from
* copy_to

It also defines simd_abi::native to use vector extension, if available.
In GCC and Clang, certain values with vector extension are passed by registers,
instead of memory.

Based on D41148.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits, MaskRay, lichray, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338309 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 21:23:13 +00:00
Eric Fiselier
a0866c5fb5 Implement <filesystem>
This patch implements the <filesystem> header and uses that
to provide <experimental/filesystem>.

Unlike other standard headers, the symbols needed for <filesystem>
have not yet been placed in libc++.so. Instead they live in the
new libc++fs.a library. Users of filesystem are required to link this
library. (Also note that libc++experimental no longer contains the
definition of <experimental/filesystem>, which now requires linking libc++fs).

The reason for keeping <filesystem> out of the dylib for now is that
it's still somewhat experimental, and the possibility of requiring an
ABI breaking change is very real. In the future the symbols will likely
be moved into the dylib, or the dylib will be made to link libc++fs automagically).

Note that moving the symbols out of libc++experimental may break user builds
until they update to -lc++fs. This should be OK, because the experimental
library provides no stability guarantees. However, I plan on looking into
ways we can force libc++experimental to automagically link libc++fs.

In order to use a single implementation and set of tests for <filesystem>, it
has been placed in a special `__fs` namespace. This namespace is inline in
C++17 onward, but not before that. As such implementation is available
in C++11 onward, but no filesystem namespace is present "directly", and
as such name conflicts shouldn't occur in C++11 or C++14.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338093 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 03:07:09 +00:00
Eric Fiselier
81872e95bf [libc++] Use __int128_t to represent file_time_type.
Summary:
The ``file_time_type`` time point is used to represent the write times for files.
Its job is to act as part of a C++ wrapper for less ideal system interfaces. The
underlying filesystem uses the ``timespec`` struct for the same purpose.

However, the initial implementation of ``file_time_type`` could not represent
either the range or resolution of ``timespec``, making it unsuitable. Fixing
this requires an implementation which uses more than 64 bits to store the
time point.

I primarily considered two solutions: Using ``__int128_t`` and using a
arithmetic emulation of ``timespec``. Each has its pros and cons, and both
come with more than one complication.

However, after a lot of consideration, I decided on using `__int128_t`. This patch implements that change.

Please see the [FileTimeType Design Document](http://libcxx.llvm.org/docs/DesignDocs/FileTimeType.html) for more information.

Reviewers: mclow.lists, ldionne, joerg, arthur.j.odwyer, EricWF

Reviewed By: EricWF

Subscribers: christof, K-ballo, cfe-commits, BillyONeal

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337960 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-25 20:51:49 +00:00
Eric Fiselier
2493db4b26 Make <experimental/filesystem> explicitly require C++11.
Previously the <experimental/filesystem> didn't guard its
contents in any dialect. However, the implementation implicitly
requires at least C++11, and the tests have always been marked
unsupported in C++03. This patch puts a header guard around the
contents to avoid exposing them before C++11.

Additionally, it replaces all of the usages of _NOEXCEPT or
_LIBCPP_CONSTEXPR with the keyword directly, since we can
expect the compiler to implement those by now.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337884 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-25 03:41:31 +00:00
Eric Fiselier
0fbaa11dd3 Ensure path::iterator and PathParser share the same enumeration values.
To avoid exposing implementation details, path::iterator and PathParser
both implicitly used the same set of values to represent the state,
but they were defined twice. This could have lead to a mismatch
occuring.

This patch moves all of the parser state values into the filesystem
header and changes PathParser to use those value to avoid this.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337883 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-25 03:31:48 +00:00
Eric Fiselier
2c1163593f Recommit "Use possibly cached directory entry values when performing recursive directory iteration."
The initial patch didn't correctly handle systems when the dirent struct
didn't provide the d_type member. Specifically it set the cache to the incorrect state,
and claimed it was partially populated.

The updated version of this change correctly handles setting up the
cache when the file type is not known (aka file_type::none).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337765 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 22:40:41 +00:00
Eric Fiselier
0ddb77a467 Implement filesystem_error::what() and improve reporting.
This patch implements the `what()` for filesystem errors. The message
includes the 'what_arg', any paths that were specified, and the
error code message.

Additionally this patch refactors how errors are created, making it easier
to report them correctly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337664 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 02:00:52 +00:00
Eric Fiselier
77c9cf44e3 Fix two test failures in <experimental/filesystem>
First, <experimental/filesystem> didn't correctly guard
against min/max macros. This adds the proper push/pop macro guards.

Second, an internal time helper had been renamed but the test for
it hadn't been updated. This patch updates those tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337520 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 01:51:48 +00:00
Eric Fiselier
0f8ee948c3 Use _LIBCPP_UNREACHABLE to convince GCC that non-void functions actually always return
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337519 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 01:44:33 +00:00
Eric Fiselier
e274f439c6 [libc++] Implement Directory Entry Caching -- Sort of.
Summary:
This patch implements directory_entry caching *almost* as specified in P0317r1. However, I explicitly chose to deviate from the standard as I'll explain below.

The approach I decided to take is a fully caching one. When `refresh()` is called, the cache is populated by calls to `stat` and `lstat` as needed.
During directory iteration the cache is only populated with the `file_type` as reported by `readdir`.
The cache can be in the following states:

* `_Empty`: There is nothing in the cache (likely due to an error)
* `_IterSymlink`: Created by directory iteration when we walk onto a symlink only the symlink file type is known.
* `_IterNonSymlink`: Created by directory iteration when we walk onto a non-symlink. Both the regular file type and symlink file type are known.
* `_RefreshSymlink` and `_RefreshNonSymlink`: A full cache created by `refresh()`.  This case includes dead symlinks.
* `_RefreshSymlinkUnresolved`: A partial cache created by refresh when we fail to resolve the file pointed to by a symlink (likely due to permissions). Symlink attributes are cached, but attributes about the linked entity are not.

As mentioned, this implementation purposefully deviates from the standard. According to some readings of the specification, and the Windows filesystem implementation, the constructors and modifiers which don't pass an `error_code` must throw when the `directory_entry` points to a entity which doesn't exist. or when attribute resolution fails for another reason. 

@BillyONeal  has proposed a more reasonable set of requirements, where modifiers other than refresh ignore errors. This is the behavior libc++ currently implements, with the expectation some form of the new language will be accepted into the standard.

Some additional semantics which differ from the Windows implementation:

1. `refresh` will not throw when the entry doesn't exist. In this case we can still meet the functions specification, so we don't treat it as an error.
2. We don't clear the path name when a constructor fails via refresh (this will hopefully be changed in the standard as well).

It should be noted that libstdc++'s current implementation has the same behavior as libc++, except for point (2).

If the changes to the specification don't get accepted, we'll be able to make the changes later.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0317r1.html

Reviewers: mclow.lists, gromer, ldionne, aaron.ballman

Subscribers: BillyONeal, christof, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337516 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 01:22:32 +00:00
Louis Dionne
54238057d6 [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY
Summary:
We never actually mean to always inline a function -- all the uses of
the macro I could find are actually attempts to control the visibility
of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which
is actually always defined the same.

This change is orthogonal to the decision of what we're actually going
to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by
having one canonical way of doing things.

Note that this commit had originally been applied in r336369 and then
reverted in r336382 because of unforeseen problems. Both of these problems
have now been fixed.

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, erikvanderpoel

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336866 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-11 23:14:33 +00:00
Louis Dionne
bb716549f1 [libc++] Declare noop_coroutine() with _LIBCPP_INLINE_VISIBILITY
Summary:
It was defined with the right visibility, but declared without any visibility.
This function was left out of a prior revision that did the same to several
functions in <compare> (r336665) because the compiler I used didn't support
coroutines. This reinforces the need for automated checks -- there might
still be several cases of this throughout the library.

Reviewers: EricWF

Subscribers: modocache, christof, dexonsmith, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336709 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-10 17:38:30 +00:00
Louis Dionne
4e7ffcaae6 Revert "[libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY"
This reverts commit r336369. The commit had two problems:
1. __pbump was marked as _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY instead of
   _LIBCPP_INLINE_VISIBILITY, which lead to two symbols being added in the
   dylib and the check-cxx-abilist failing.

2. The LLDB tests started failing because they undefine
   `_LIBCPP_INLINE_VISIBILITY`. I need to figure out why they do that and
   fix the tests before we can go forward with this change.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336382 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 18:41:50 +00:00
Louis Dionne
79aa4f32d0 [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITY
Summary:
We never actually mean to always inline a function -- all the uses of
the macro I could find are actually attempts to control the visibility
of symbols. This is better described by _LIBCPP_INLINE_VISIBILITY, which
is actually always defined the same.

This change is orthogonal to the decision of what we're actually going
to do with _LIBCPP_INLINE_VISIBILITY -- it just simplifies things by
having one canonical way of doing things.

Reviewers: EricWF

Subscribers: christof, llvm-commits, dexonsmith, erikvanderpoel, mclow.lists

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@336369 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-05 16:49:38 +00:00
Eric Fiselier
00e59b46f0 Remove unused code from __functional_base. NFC.
Patch from Arthur O'Dwyer.

`__user_alloc_construct_impl` is used by <experimental/memory_resource>, but
this `__user_alloc_construct` is never used.

Also, `<experimental/memory_resource>` doesn't need a full definition of
`std::tuple`; just the forward declaration in `<__tuple>` will suffice.

Reviewed as https://reviews.llvm.org/D46806

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334069 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-06 06:42:27 +00:00
Eric Fiselier
40a29e79c2 LWG 2969 "polymorphic_allocator::construct() shouldn't pass resource()"
Patch from Arthur O'Dwyer.

In the TS, `uses_allocator` construction for `pair` tried to use an allocator
type of `memory_resource*`, which is incorrect because `memory_resource*` is
not an allocator type. LWG 2969 fixed it to use `polymorphic_allocator` as the
allocator type instead.

https://wg21.link/lwg2969

(D47090 included this in `<memory_resource>`; at Eric's request, I've split
this out into its own patch applied to the existing
`<experimental/memory_resource>` instead.)

Reviewed as https://reviews.llvm.org/D47109


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333384 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-29 00:08:47 +00:00
David Bolvansky
9887da8229 Allow copy elision in path concatenation
Summary:
Just port of libstdc++'s fix to libc++ fs: e6ac4004fe

Author of fix: Jonathan Wakely

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF

Subscribers: smeenai, christof, cfe-commits, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@331910 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 18:57:17 +00:00
Tim Shen
52cd8e497a Re-commit r330627 "[libcxx] implement <experimental/simd> declarations based on P0214R7."
There are 3 changes:
* Renamed genertor.pass.cpp to generator.pass.cpp
* Removed nothing_to_do.pass.cpp
* Mark GCC 4.9 as UNSUPPORTED for the test files that have negative
  narrowing conversion SFINAE test (see GCC PR63723).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330655 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23 21:54:06 +00:00
Tim Shen
3d3af7d26a Revert "[libcxx] implement <experimental/simd> declarations based on P0214R7."
This reverts commit r330627.

This causes several bots to freak out.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330636 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23 19:56:20 +00:00
Tim Shen
ac2a43df0f [libcxx] implement <experimental/simd> declarations based on P0214R7.
Summary:
The patch includes all declarations, and also implements the following features:
* ABI.
* narrowing-conversion related SFIANE, including simd<> ctors and (static_)simd_cast.

Reviewers: mclow.lists, EricWF

Subscribers: lichray, sanjoy, MaskRay, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@330627 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-23 18:47:07 +00:00
Gor Nishanov
b431c5a9ec [coroutines] libcxx, noop_coroutine, make bots even more happy
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329245 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-05 00:18:37 +00:00
Gor Nishanov
827c4ff600 [coroutines] Allow compilation under c++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329239 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 22:51:57 +00:00
Gor Nishanov
81e07a9315 [coroutines] Add noop_coroutine to <experimental/coroutine>
A recent addition to Coroutines TS (https://wg21.link/p0913) adds a pre-defined
coroutine noop_coroutine that does nothing.

This patch implements require library types in <experimental/coroutine>

Related clang and llvm patches:

https://reviews.llvm.org/D45114
https://reviews.llvm.org/D45120

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329237 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 22:18:03 +00:00
Eric Fiselier
e96d6a1fb7 Implement P0430R2 - File system library on non-POSIX systems.
This patch implements P0430R2, who's largest change is adding the path::format
enumeration for supporting path format conversions in path constructors.

However, since libc++'s filesystem only really supports POSIX like systems,
there are no real changes needed. This patch simply adds the format enum
and then ignores it when it's passed to constructors.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329031 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02 23:35:24 +00:00
Eric Fiselier
1e34c76d33 Implement filesystem NB comments, relative paths, and related issues.
This is a fairly large patch that implements all of the filesystem NB comments
and the relative paths changes (ex. adding weakly_canonical). These issues
and papers are all interrelated so their implementation couldn't be split up
nicely.

This patch upgrades <experimental/filesystem> to match the C++17 spec and not
the published experimental TS spec. Some of the changes in this patch are both
API and ABI breaking, however libc++ makes no guarantee about stability for
experimental implementations.

The major changes in this patch are:

* Implement NB comments for filesystem (P0492R2), including:
  * Implement `perm_options` enum as part of NB comments, and update the
    `permissions` function to match.
  * Implement changes to `remove_filename` and `replace_filename`
  * Implement changes to `path::stem()` and `path::extension()` which support
    splitting examples like `.profile`.
  * Change path iteration to return an empty path instead of '.' for trailing
    separators.
  * Change `operator/=` to handle absolute paths on the RHS.
  * Change `absolute` to no longer accept a current path argument.

* Implement relative paths according to NB comments (P0219r1)

* Combine `path.cpp` and `operations.cpp` since some path functions require
  access to the operations internals, and some fs operations require access
  to the path parser.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329028 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02 23:03:41 +00:00
Eric Fiselier
f2c93738b8 Implement filesystem::perm_options specified in NB comments.
The NB comments for filesystem changed permissions and added
a new enum `perm_options` which control how the permissions
are applied.

This implements than NB resolution

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328476 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 06:23:55 +00:00
Eric Fiselier
f4f3025362 Fix dynarray test failures after changing __libcpp_allocate/deallocate
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328182 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 05:44:48 +00:00
Marshall Clow
46b8a51b49 Implement LWG#2518 - Non-member swap for propagate_const should call member swap
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@327005 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 15:01:50 +00:00
Marshall Clow
b8cb776511 While implementing P0777 - preventing unnecessary decay, I found some non-public uses of decay that could be replaced by __uncvref. NFC intented
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324895 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-12 15:41:25 +00:00