summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Correctly mark the Filesystem status as complete.Eric Fiselier2018-07-271-2/+2
| | | | llvm-svn: 338094
* Implement <filesystem>Eric Fiselier2018-07-27178-3163/+3980
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 338093
* [CMake] Don't generate linker script only when shared library isn't ↵Petr Hosek2018-07-261-2/+2
| | | | | | | | | | | | | statically linked Since r337668, we support statically linking dependencies only to shared or static library. However, that change hasn't updated the check whether to generate a linker script. We shouldn't generate linker script only in the case when we aren't statically linked ABI into the shared library. Differential Revision: https://reviews.llvm.org/D49834 llvm-svn: 338006
* Copy LLVM CMake configuration for CMake Policy CMP0068Eric Fiselier2018-07-261-0/+4
| | | | llvm-svn: 338005
* Be more consistent about which bool value means an error occurredEric Fiselier2018-07-261-6/+6
| | | | llvm-svn: 338002
* Cleanup the last_write_time internalsEric Fiselier2018-07-262-17/+26
| | | | llvm-svn: 338001
* Correct comment about stat truncating st_mtimespec to secondsEric Fiselier2018-07-261-19/+6
| | | | llvm-svn: 338000
* Fix attribute placement WRT extern CEric Fiselier2018-07-261-2/+2
| | | | llvm-svn: 337999
* Workaround OS X 10.11 behavior where stat truncates st_mtimespec to seconds.Eric Fiselier2018-07-261-11/+38
| | | | llvm-svn: 337998
* Add print statements to help debuggingEric Fiselier2018-07-261-11/+21
| | | | llvm-svn: 337991
* [libc++] Add hack to allow ubsan to work w/o compiler-rt (__muloti4 is ↵Eric Fiselier2018-07-261-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | undefined) Summary: Using int128_t with UBSAN causes link errors unless compiler-rt is providing the runtime library. Specifically ubsan generates calls to __muloti4 but libgcc doesn't provide a definition. In order to avoid this, and allow users to continue using sanitized versions of libc++, this patch introduces a hack. It adds a cribbed version of the compiler-rt builtin to the libc++ filesystem sources. I don't think this approach will work in the long run, but it seems OK for now. Also see: https://bugs.llvm.org/show_bug.cgi?id=30643 https://bugs.llvm.org/show_bug.cgi?id=16404 Reviewers: mclow.lists, ldionne, rsmith, jyknight, echristo Reviewed By: echristo Subscribers: dberris, cfe-commits Differential Revision: https://reviews.llvm.org/D49828 llvm-svn: 337990
* [libc++] Follow-up to r337968: use an explicit cast as suggested by EricAlex Lorenz2018-07-251-2/+4
| | | | llvm-svn: 337984
* [CMake] Don't install c++abi headers in standalone libc++ buildPetr Hosek2018-07-253-3/+2
| | | | | | | | | | | This is a refinement on r337833. Previously we were installing two copies of c++abi headers in libc++ build directory, one in include/c++build and another one in include/c++/v1. However, the second copy is unnecessary when building libc++ standalone. Differential Revision: https://reviews.llvm.org/D49752 llvm-svn: 337979
* Work around GCC bug in constexpr functionEric Fiselier2018-07-251-3/+4
| | | | llvm-svn: 337976
* Fix GCC build in C++14 w/o c++14 constexprEric Fiselier2018-07-251-1/+1
| | | | llvm-svn: 337974
* Remove test which shouldn't have been committedEric Fiselier2018-07-251-19/+0
| | | | llvm-svn: 337971
* Fix failing test under C++14Eric Fiselier2018-07-251-2/+2
| | | | llvm-svn: 337970
* [libc++] Follow-up to r337960: specify lambda's return type to avoidAlex Lorenz2018-07-251-1/+1
| | | | | | | | | | | -Wc++11-narrowing warning on Darwin The internal CI produced the following diagnostic: error: non-constant-expression cannot be narrowed from type 'long long' to '__darwin_suseconds_t' (aka 'int') in initializer list [-Wc++11-narrowing] struct ::timeval ConvertedTS[2] = {{TS[0].tv_sec, Convert(TS[0].tv_nsec)}, ^~~~~~~~~~~~~~~~~~~~~~ llvm-svn: 337968
* Make <experimental/filesystem> compile with gcc 4.8.5Eric Fiselier2018-07-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Victor Zverovich. This fixes an error when compiling `<experimental/filesystem>` with gcc 4.8.5: ``` .../libcxx/src/experimental/filesystem/filesystem_common.h:137:34: error: redeclaration ‘T std::experimental::filesystem::v1::detail::{anonymous}::error_value() [with T = bool]’ d iffers in ‘constexpr’ constexpr bool error_value<bool>() { ^ .../libcxx/src/experimental/filesystem/filesystem_common.h:133:3: error: from previous declaration ‘T std::experimental::filesystem::v1::detail::{anonymous}::error_value() [with T = bool]’ T error_value(); ^ ``` Reviewed as https://reviews.llvm.org/D49813 llvm-svn: 337962
* [libc++] Use __int128_t to represent file_time_type.Eric Fiselier2018-07-259-407/+762
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 337960
* [libc++] Factor duplicate code into function templatesLouis Dionne2018-07-251-269/+50
| | | | | | | | | | | | | | | | | | | Summary: The exact same code was replicated 11 times for implementing the basic_istream input operators (those that don't use numeric_limits). The same code was also duplicated twice for implementing the basic_istream input operators that take numeric_limits into account. This commit factors the common code into function templates to avoid the duplication. Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49808 llvm-svn: 337955
* [windows] Fix warning about comparing ints of different signsMartin Storsjo2018-07-251-2/+3
| | | | | | | | | | | | | | This fixes a warning like this: warning: comparison of integers of different signs: 'std::__1::__libcpp_tls_key' (aka 'long') and 'DWORD' (aka 'unsigned long') [-Wsign-compare] if (*__key == FLS_OUT_OF_INDEXES) ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~ Differential Revision: https://reviews.llvm.org/D49782 llvm-svn: 337946
* [NFC] Fix grammatical mistakes in libc++ FileTimeType design docsLouis Dionne2018-07-251-10/+10
| | | | llvm-svn: 337925
* Fix diagnostic test to tolerate Clang diagnosing it as well.Eric Fiselier2018-07-251-0/+5
| | | | | | | | | | | | | | Tuple has tests that ensure we diagnose non-lifetime extended reference bindings inside tuples constructors. As of yesterday, Clang now does this for us. Adjust the test to tolerate the new diagnostics, while still testing that we emit diagnostics of our own. Maybe after this version of Clang has been adopted by most users we should remove our diagnostics; but for now more error detection is better! llvm-svn: 337905
* Fix another typo in the FileTimeType docsEric Fiselier2018-07-251-1/+1
| | | | llvm-svn: 337900
* Fix typos, spelling, and grammar in the FileTimeType design docs.Eric Fiselier2018-07-251-36/+37
| | | | | | I'm sure I'll discover more mistakes as I go on... llvm-svn: 337897
* Fix bugs in create_directory implementation.Eric Fiselier2018-07-254-8/+71
| | | | | | | | | | | | | | 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. llvm-svn: 337888
* Fix missing includes in format_string.hpp helperEric Fiselier2018-07-251-4/+5
| | | | llvm-svn: 337886
* New test support for comparisons. Reviewed as https://reviews.llvm.org/D49773Marshall Clow2018-07-251-0/+175
| | | | llvm-svn: 337885
* Make <experimental/filesystem> explicitly require C++11.Eric Fiselier2018-07-253-166/+173
| | | | | | | | | | | | | | 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. llvm-svn: 337884
* Ensure path::iterator and PathParser share the same enumeration values.Eric Fiselier2018-07-252-20/+28
| | | | | | | | | | | | 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. llvm-svn: 337883
* Add design docs for upcoming file_time_type change.Eric Fiselier2018-07-253-1/+495
| | | | | | | | | | | | | | | | | | In upcoming changes to filesystem I plan to change file_time_type to use __int128_t as its underlying representation, in order to allow it to have a range and resolution at least that of the timespec struct. There was some pushback against this decision, so I drafted a document explaining the problems, potential solutions, and the rational for the decision. However, it's probably easier to let people read the generated HTML rather than the raw restructured text. For this reason I'm commiting the design documents before hand, so they can be available during any subsequent discussion or code review. llvm-svn: 337880
* Mark <span> as completeMarshall Clow2018-07-251-2/+2
| | | | llvm-svn: 337879
* [CMake] Option to control whether shared/static library is installedPetr Hosek2018-07-242-7/+16
| | | | | | | | | | | | | Currently it's only possible to control whether shared or static library build of libc++, libc++abi and libunwind is enabled or disabled and whether to install everything we've built or not. However, it'd be useful to have more fine grained control, e.g. when static libraries are merged together into libc++.a we don't need to install libc++abi.a and libunwind.a. This change adds this option. Differential Revision: https://reviews.llvm.org/D49573 llvm-svn: 337867
* [CMake] Fix the setting of LIBCXX_HEADER_DIR in standalone buildPetr Hosek2018-07-242-7/+10
| | | | | | | | | | | | This is an alternative approach to r337727 which broke the build because libc++ headers were copied into the location outside of directories used by Clang. This change sets LIBCXX_HEADER_DIR to different values depending on whether libc++ is being built as part of LLVM w/ per-target multiarch runtime, LLVM or standalone. Differential Revision: https://reviews.llvm.org/D49711 llvm-svn: 337833
* Stop wrapping __has_include in another macroAlexander Richardson2018-07-242-10/+6
| | | | | | | | | | | | | | Summary: This is not guaranteed to work since the characters after '__has_include(' have special lexing rules that can't possibly be applied when __has_include is generated by a macro. It also breaks the crash reproducers generated by -frewrite-includes (see https://llvm.org/pr37990). Reviewers: EricWF, rsmith, mclow.lists Reviewed By: mclow.lists Differential Revision: https://reviews.llvm.org/D49067 llvm-svn: 337824
* Fix use of incorrect _LIBCXX macro (should be _LIBCPP).Eric Fiselier2018-07-241-1/+1
| | | | llvm-svn: 337817
* Reland "[CMake] Support statically linking dependencies only to shared or ↵Petr Hosek2018-07-243-6/+14
| | | | | | | | static library" This is a reland of commit r337668. llvm-svn: 337814
* fix nesting of namespace and standard-version check. Also include <__config>Marshall Clow2018-07-241-1/+3
| | | | llvm-svn: 337809
* Disable 'suggest braces' warnings for std::array in testsMarshall Clow2018-07-242-0/+7
| | | | llvm-svn: 337808
* Implement <span>. Reviewed as https://reviews.llvm.org/D49338Marshall Clow2018-07-2442-0/+5020
| | | | llvm-svn: 337804
* Revert r337727 as it caused Darwin bot failuresAlex Lorenz2018-07-241-1/+1
| | | | llvm-svn: 337782
* Handle DT_UNKNOWN correctly during directory iteration.Eric Fiselier2018-07-231-1/+4
| | | | | | | | | | Unlike stat and lstat, where unknown really means we know it's something weird, during directory iteration DT_UNKNOWN simply means that the underlying FS doesn't support the dirent::dt_type field. This patch fixes libc++ to correctly set the cache to empty when DT_UNKNOWN is reported. llvm-svn: 337768
* Recommit "Use possibly cached directory entry values when performing ↵Eric Fiselier2018-07-232-5/+14
| | | | | | | | | | | | | 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). llvm-svn: 337765
* Fix accidentally removed test.Eric Fiselier2018-07-231-2/+15
| | | | | | | | | 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 llvm-svn: 337764
* Revert "Use possibly cached directory entry values when performing recursive ↵Eric Fiselier2018-07-231-2/+2
| | | | | | | | directory iteration." This reverts commit 04ce4aef00d3ee508327f6cf7bf1b1d200ab6238. llvm-svn: 337749
* [CMake] Fix the setting of LIBCXX_HEADER_DIRHeejin Ahn2018-07-231-1/+1
| | | | | | | | | | Reviewers: phosek Subscribers: mgorny, christof, ldionne, cfe-commits Differential Revision: https://reviews.llvm.org/D49629 llvm-svn: 337727
* Cleanup unnecessary conversions in filesystem.Eric Fiselier2018-07-231-2/+2
| | | | llvm-svn: 337685
* Cleanup name qualification in the filesystem internals.Eric Fiselier2018-07-233-118/+118
| | | | | | | | In most cases there is no reason why the filesystem internals use the qualifier std:: or _VSTD::. This patch removes the unneeded qualifiers, making the sources files more consistent llvm-svn: 337684
* Revert "[CMake] Support statically linking dependencies only to shared or ↵Petr Hosek2018-07-233-14/+6
| | | | | | | | static library" This reverts commit r337668: broke the cxxabi build when using Make. llvm-svn: 337670
OpenPOWER on IntegriCloud