summaryrefslogtreecommitdiffstats
path: root/libcxx/src/experimental/filesystem
Commit message (Collapse)AuthorAgeFilesLines
...
* experimental: tolerate the existence of a `__deref` macroSaleem Abdulrasool2017-01-301-2/+2
| | | | | | | | Microsoft's SAL has a `__deref` macro which results in a compilation failure when building the filesystem module on Windows. Rename the member function internally to avoid the conflict. llvm-svn: 293449
* experimental: remove dead functionSaleem Abdulrasool2017-01-291-13/+0
| | | | | | | This template was defined inline, within the TU only and had no uses across the entire repository. Remove the dead code. NFC. llvm-svn: 293445
* Revert "[libcxx] Never use <cassert> within libc++"Eric Fiselier2017-01-241-0/+4
| | | | | | | | This reverts commit r292883. Unfortunately <string_view> uses _LIBCPP_ASSERT in a way which is not compatible with the C++11 dylib build. I'll investigate more tomorrow. llvm-svn: 292923
* [libcxx] Never use <cassert> within libc++Eric Fiselier2017-01-241-4/+0
| | | | | | | | | | | | | | | | | Summary: It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead. Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS` off by default, because the standard library should not be aborting user programs unless explicitly asked to. Reviewers: mclow.lists, compnerd, smeenai Reviewed By: mclow.lists Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D29063 llvm-svn: 292883
* Make variant's index part of the hash valueEric Fiselier2016-12-021-9/+4
| | | | llvm-svn: 288554
* Improve performance of constructing filesystem::path from strings.Eric Fiselier2016-10-301-8/+1
| | | | | | | | | | | | | This patch fixes a performance bug when constructing or appending to a path from a string or c-string. Previously we called 'push_back' to append every single character. This caused multiple re-allocation and copies when at most one reallocation is necessary. The new behavior is to simply call `string::append` so it can correctly handle reallocation. For large strings this change is a ~4x improvement. This also makes our path faster to construct than libstdc++'s. llvm-svn: 285530
* Rewrite std::filesystem::path iterators and parserEric Fiselier2016-10-301-237/+290
| | | | | | | | | | | | | | | | | | | | | | This patch entirely rewrites the parsing logic for paths. Unlike the previous implementation this one stores information about the current state; For example if we are in a trailing separator or a root separator. This avoids the need for extra lookahead (and extra work) when incrementing or decrementing an iterator. Roughly this gives us a 15% speedup over the previous implementation. Unfortunately this implementation is still a lot slower than libstdc++'s. Because libstdc++ pre-parses and splits the path upon construction their iterators are trivial to increment/decrement. This makes libc++ lazy parsing 100x slower than libstdc++. However the pre-parsing libstdc++ causes a ton of extra and unneeded allocations when constructing the string. For example `path("/foo/bar/")` would require at least 5 allocations with libstdc++ whereas libc++ uses only one. The non-allocating behavior is much preferable when you consider filesystem usages like 'exists("/foo/bar/")'. Even then libc++'s path seems to be twice as slow to simply construct compared to libstdc++. More investigation is needed about this. llvm-svn: 285526
* Fix Clang 3.6 build errorEric Fiselier2016-10-281-1/+1
| | | | llvm-svn: 285445
* Implement LWG 2712 and update other issues statusEric Fiselier2016-10-161-0/+6
| | | | llvm-svn: 284318
* Implement LWG 2681 and 2682Eric Fiselier2016-10-161-0/+3
| | | | llvm-svn: 284316
* Implement LWG 2672.Eric Fiselier2016-10-151-5/+17
| | | | llvm-svn: 284314
* Implement modified LWG 2665Eric Fiselier2016-10-151-0/+10
| | | | llvm-svn: 284313
* Fix LWG2683 - filesystem::copy() should always clear the user-provided ↵Eric Fiselier2016-10-111-6/+2
| | | | | | error_code llvm-svn: 283951
* Workaround missing C++14 constexpr semantics in filesystemEric Fiselier2016-10-101-5/+12
| | | | llvm-svn: 283714
* Remove use of int128_t inside the filesystem implementationEric Fiselier2016-10-101-30/+118
| | | | llvm-svn: 283712
* Partially revert overflow checking in last_write_timeEric Fiselier2016-09-291-5/+7
| | | | llvm-svn: 282660
* Improve 'last_write_time(...)' accuracy and detect overflow errors.Eric Fiselier2016-09-281-5/+35
| | | | | | | | | | | | | | | | | The ::stat struct on Linux, FreeBSD, and OS X provides the access and modification times as an instance of 'timespec', which has a nanosecond resolution. The 'st_mtime' and 'st_atime' members simply reference the 'tv_sec' value of the timespec struct. This patch changes 'last_write_time(...)' so that it extracts both the seconds and nanoseconds values of the last modification time, providing a more accurate implementation of 'last_write_time(...)'. Additionally this patch fixes a possible signed integer overflow bug. The 'file_time_type' type cannot represent all possible values returned by the filesystem. Attempting to construct a 'file_time_type' from one of these values is undefined behavior. This patch avoids that UB by detecting possible overflows before the conversion. llvm-svn: 282634
* Fix possible division by zeroEric Fiselier2016-09-271-1/+1
| | | | llvm-svn: 282468
* Followon to r279744. Find the other exception types and make __throw_XXX ↵Marshall Clow2016-08-252-3/+3
| | | | | | routines (and call them). Remove the generic __libcpp_throw routine, since no one uses it anymore. llvm-svn: 279763
* Implement P0392r0. Integrate filesystem::path and string_view.Eric Fiselier2016-07-231-45/+46
| | | | llvm-svn: 276511
* Remove workarounds for C++17 inline variable ABI break. It has been fixed in ↵Eric Fiselier2016-07-021-4/+0
| | | | | | clang. llvm-svn: 274419
* Add another workaround for C++17 inline variable ABI breakage.Eric Fiselier2016-07-011-1/+4
| | | | llvm-svn: 274408
* Cleanup filesystem::permissions ever more.Eric Fiselier2016-06-221-20/+15
| | | | llvm-svn: 273392
* Avoid unnecessary stat call in filesystem::permissions implementation.Eric Fiselier2016-06-221-1/+2
| | | | llvm-svn: 273391
* Implement LWG issue 2720. Replace perms::resolve_symlinks with ↵Eric Fiselier2016-06-211-2/+6
| | | | | | | | | | | | | | | perms::symlink_nofollow. This changes how filesystem::permissions(p, perms) handles symlinks. Previously symlinks were not resolved by default instead only getting resolved when "perms::resolve_symlinks" was used. After this change symlinks are resolved by default and perms::symlink_nofollow must be given to change this. This issue has not yet been moved to Ready status, and I will revert if it doesn't get moved at the current meeting. However I feel confident that it will and it's nice to have implementations when moving issues. llvm-svn: 273328
* Fix bugs in last_write_time implementation.Eric Fiselier2016-06-191-17/+56
| | | | | | | | | | | | | | | * Fix passing a negative number as either tv_usec or tv_nsec. When file_time_type is negative and has a non-zero sub-second value we subtract 1 from tv_sec and make the sub-second duration positive. * Detect and report when 'file_time_type' cannot be represented by time_t. This happens when using large/small file_time_type values with a 32 bit time_t. There is more work to be done in the implementation. It should start to use stat's st_mtim or st_mtimeval if it's provided as an extension. That way we can provide a better resolution. llvm-svn: 273103
* Remove Apple specific guard for utimensat. Use !defined(UTIME_OMIT) instead.Eric Fiselier2016-06-181-5/+4
| | | | | | | As pointed out by @majnemer this is a better way to detect utimensat on all platforms. The Apple specific guard is unneeded. llvm-svn: 273093
* Use utimes instead of utimensat when !defined(UTIME_OMIT). Fixes build for ↵Eric Fiselier2016-06-181-1/+3
| | | | | | older GLIBC versions llvm-svn: 273088
* Add additional tests in an attempt to diagnose ARM test failures.Eric Fiselier2016-06-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Currently 4 tests are failing on the ARM buildbot. To try and diagnose each of the failures this patch does the following: 1) path.itr/iterator.pass.cpp * Temporarily print iteration sequence to see where its failing. 2) path.native.obs/string_alloc.pass.cpp * Remove test that ::new is not called when constructing a short string that requires a conversion. Since during the conversion global locale objects might be constructed. 3) fs.op.funcs/space.pass.cpp * Explicitly use uintmax_t in the implementation of space, hopefully preventing possible overflows. * Add additional tests that check for overflow is the calculation of the space_info values. * Add additional tests for the values returned from statfvs. 4) fs.op.funcs/last_write_time.pass.cpp * No changes made yet. llvm-svn: 273075
* Fix bugs in recursive_directory_iterator::increment(ec) implementation and ↵Eric Fiselier2016-06-171-9/+6
| | | | | | | | | | | | | | | tests. r273060 didn't completely fix the issues in recursive_directory_iterator and the tests. This patch follows up with more fixes * Fix bug where recursive_directory_iterator::increment(ec) did not reset the error code if no failure occurred. * Fix bad assertion in the recursive_directory_iterator::increment(ec) test that would only fire for certain iteration orders. llvm-svn: 273070
* Fix bugs in recursive_directory_iterator implementation and tests.Eric Fiselier2016-06-171-0/+3
| | | | | | | | | | | There are two fixes in this patch: * Fix bug where the constructor of recursive_directory_iterator did not reset the error code if no failure occurred. * Fix tests were dependent on the iteration order of the test directories. llvm-svn: 273060
* Add Filesystem TS -- CompleteEric Fiselier2016-06-173-0/+1402
Add the completed std::experimental::filesystem implementation and tests. The implementation supports C++11 or newer. The TS is built as part of 'libc++experimental.a'. Users of the TS need to manually link this library. Building and testing the TS can be disabled using the CMake option '-DLIBCXX_ENABLE_FILESYSTEM=OFF'. Currently 'libc++experimental.a' is not installed by default. To turn on the installation of the library use '-DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON'. llvm-svn: 273034
OpenPOWER on IntegriCloud