Commit Graph

201 Commits

Author SHA1 Message Date
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
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
b6e011b18b Add include for 'test_macros.h' to all the tests that were missing them. Thanks to Zoe for the (big, but simple) patch. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@362252 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-31 18:35:30 +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
9d4c40d0d2 Fix namespace name conflict with GCC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359023 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 18:23:33 +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
21c042e77e [libc++] Mark several tests as XFAIL on macosx10.7
Those tests fail when linking against a new dylib but running against
macosx10.7. I believe this is caused by a duplicate definition of the
RTTI for exception classes in libc++.dylib and libc++abi.dylib, but
this matter still needs some investigation.

This issue was not caught previously because all the tests always linked
against the same dylib used for running (because LIT made it impossible
to do otherwise before r349171).

rdar://problem/46809586

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354940 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 00:57:57 +00:00
Louis Dionne
98173dc3c4 [libcxx] Make sure all experimental tests are disabled when enable_experimental=False
Summary:
Previously, we'd run some experimental tests even when enable_experimental=False
was used with lit.

Reviewers: EricWF

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

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354725 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-23 11:24:03 +00:00
JF Bastien
e15dd4e32e Support tests in freestanding
Summary:
Freestanding is *weird*. The standard allows it to differ in a bunch of odd
manners from regular C++, and the committee would like to improve that
situation. I'd like to make libc++ behave better with what freestanding should
be, so that it can be a tool we use in improving the standard. To do that we
need to try stuff out, both with "freestanding the language mode" and
"freestanding the library subset".

Let's start with the super basic: run the libc++ tests in freestanding, using
clang as the compiler, and see what works. The easiest hack to do this:

In utils/libcxx/test/config.py add:

  self.cxx.compile_flags += ['-ffreestanding']

Run the tests and they all fail.

Why? Because in freestanding `main` isn't special. This "not special" property
has two effects: main doesn't get mangled, and main isn't allowed to omit its
`return` statement. The first means main gets mangled and the linker can't
create a valid executable for us to test. The second means we spew out warnings
(ew) and the compiler doesn't insert the `return` we omitted, and main just
falls of the end and does whatever undefined behavior (if you're luck, ud2
leading to non-zero return code).

Let's start my work with the basics. This patch changes all libc++ tests to
declare `main` as `int main(int, char**` so it mangles consistently (enabling us
to declare another `extern "C"` main for freestanding which calls the mangled
one), and adds `return 0;` to all places where it was missing. This touches 6124
files, and I apologize.

The former was done with The Magic Of Sed.

The later was done with a (not quite correct but decent) clang tool:

  https://gist.github.com/jfbastien/793819ff360baa845483dde81170feed

This works for most tests, though I did have to adjust a few places when e.g.
the test runs with `-x c`, macros are used for main (such as for the filesystem
tests), etc.

Once this is in we can create a freestanding bot which will prevent further
regressions. After that, we can start the real work of supporting C++
freestanding fairly well in libc++.

<rdar://problem/47754795>

Reviewers: ldionne, mclow.lists, EricWF

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

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353086 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 20:31:13 +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
Eric Fiselier
33cc965bf6 Fix UB in SIMD tests.
One of the SIMD tests attempted to left shift a value by 42, which
is UB when the left hand side is a 32 bit integer type.

This patch adjusts the test to use the value 4 instead of 42.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342820 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-22 20:09:02 +00:00
Tim Shen
379cbeb1a2 [libcxx] fix >> 42 UB in <experimental/simd>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338325 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 23:05:40 +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
cff3d7b202 Correct comment about stat truncating st_mtimespec to seconds
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338000 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-26 03:42:25 +00:00
Eric Fiselier
6655abbc33 Workaround OS X 10.11 behavior where stat truncates st_mtimespec to seconds.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337998 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-26 03:28:48 +00:00
Eric Fiselier
8940394a74 Add print statements to help debugging
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337991 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-26 01:10:50 +00:00
Eric Fiselier
0c29afae93 Remove test which shouldn't have been committed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337971 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-25 21:58:37 +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
8410c8170a Fix bugs in create_directory implementation.
Libc++ was incorrectly reporting an error when the target of create_directory
already exists, but was not a directory. This behavior is not specified
in the most recent standard, which says no error should be reported.

Additionally, libc++ failed to report an error when the attribute directory
path didn't exist or didn't name a directory. This has been fixed as well.

Although it's not clear if we should call status or symlink_status on the
attribute directory. This patch chooses to still call status.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337888 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-25 04:46:32 +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
f581ed2017 Fix accidentally removed test.
When adding the new tests for the filesystem_error::what method,
I incorrectly removed a test case and replaced it with something else.

This patch restores that test case

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337764 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-23 22:39:56 +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
1061b65e6e fix test failures with older clang versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337658 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-22 20:50:16 +00:00
Eric Fiselier
70c866bfc1 Implement a better copy_file.
This patch improves both the performance, and the safety of the
copy_file implementation.

The performance improvements are achieved by using sendfile on
Linux and copyfile on OS X when available.

The TOCTOU hardening is achieved by opening the source and
destination files and then using fstat to check their attributes to
see if we can copy them.

Unfortunately for the destination file, there is no way to open
it without accidentally creating it, so we first have to use
stat to determine if it exists, and if we should copy to it.
Then, once we're sure we should try to copy, we open the dest
file and ensure it names the same entity we previously stat'ed.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@337649 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-22 02:00:53 +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
Volodymyr Sapsai
c19d47a81b Mark the test using <experimental/memory_resource> to require c++experimental.
When built against the old libc++ version the test was causing linker error

Undefined symbols for architecture x86_64:
  "std::experimental::fundamentals_v1::pmr::new_delete_resource()", referenced from:
      void test_evil<WidgetV0, WidgetV0>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV0, WidgetV1>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV0, WidgetV2>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV0, WidgetV3>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV1, WidgetV0>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV1, WidgetV1>() in construct_piecewise_pair_evil.pass.cpp.o
      void test_evil<WidgetV1, WidgetV2>() in construct_piecewise_pair_evil.pass.cpp.o
      ...



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334431 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-11 19:42:27 +00:00
JF Bastien
c8846cc964 Filesystem tests: un-confuse write time
Summary:
The filesystem test was confused about access versus write / modification time. The spec says:

  file_time_type last_write_time(const path& p, error_code& ec) noexcept;
  Returns: The time of last data modification of p, determined as if by the value of the POSIX stat structure member st_mtime obtained as if by POSIX stat(). The signature with argument ec returns file_time_type::min() if an error occurs.

The test was looking at st_atime, not st_mtime, when comparing the result from last_write_time. That was probably due to using a pair instead of naming things nicely or using types. I opted to rename things so it's clearer.

This used to cause test bot failures.

<rdar://problem/40648859>

Reviewers: EricWF, mclow.lists, aemerson

Subscribers: christof, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333723 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-01 04:59:48 +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
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
ab465be926 [coroutines] libcxx noop_coroutine. Make bots happier
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329240 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 23:43:50 +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
Jan Korous
75b7f52ace [libcxx][test] Fix fs::proximate tests on platforms where /net exists.
Following Eric's patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329199 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 14:23:51 +00:00
Jan Korous
dd8722ce53 [libcxx][test] Improve assert message
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329194 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-04 13:31:39 +00:00
Eric Fiselier
efbbeb195f Fix fs::proximate tests on platforms where /net exists.
The proximate tests depended on `/net` not being a valid path,
however, on OS X it is.

Correct the tests to handle this.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329038 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-03 01:52:12 +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
245b3a06a1 Fix test case initialization issues in permissions test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328477 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 07:06:25 +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
f1471a367b Make filesystem tests generic between experimental and std versions.
As I move towards implementing std::filesystem, there is a need to
make the existing tests run against both the std and experimental versions.
Additionally, it's helpful to allow running the tests against other
implementations of filesystem.

This patch converts the test to easily target either. First, it
adds a filesystem_include.hpp header which is soley responsible
for selecting and including the correct implementation. Second,
it converts existing tests to use this header instead of including
filesystem directly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328475 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 05:46:57 +00:00
Volodymyr Sapsai
04dd960ff3 [libcxx] Fix last_write_time test for filesystems that don't support very small times.
APFS minimum supported file write time is -2^63 nanoseconds, which doesn't go
as far as `file_time_type::min()` that is equal to -2^63 microseconds on macOS.

This change doesn't affect filesystems that support `file_time_type` range only
for in-memory file time representation but not for on-disk representation. Such
filesystems are considered as `SupportsMinTime`.

rdar://problem/35865151

Reviewers: EricWF, Hahnfeld

Subscribers: jkorous-apple, mclow.lists, cfe-commits, christof

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



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@326383 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-28 23:27:40 +00:00
Marshall Clow
31810d9c0b Remove more of the std::experimental bits that are now in std::. All the _v type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324423 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 23:13:48 +00:00
Marshall Clow
b50d2443d5 Remove <experimental/string_view>; use <string_view> instead. See https://libcxx.llvm.org/TS_deprecation.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324290 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-05 23:43:34 +00:00
Eric Fiselier
4d0f42850b Implement LWG 3014 - Fix more noexcept issues in filesystem.
This patch removes the noexcept declaration from filesystem
operations which require creating temporary paths or
creating a directory iterator. Either of these operations
can throw.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324192 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-04 07:35:36 +00:00