summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Use possibly cached directory entry values when performing recursive ↵Eric Fiselier2018-07-231-2/+2
| | | | | | directory iteration. llvm-svn: 337669
* [CMake] Support statically linking dependencies only to shared or static libraryPetr Hosek2018-07-233-6/+14
| | | | | | | | | | | | | | Currently it's possible to select whether to statically link unwinder or the C++ ABI library, but this option applies to both the shared and static library. However, in some scenarios it may be desirable to only statically link unwinder and C++ ABI library into static C++ library since for shared C++ library we can rely on dynamic linking and linker scripts. This change enables selectively enabling or disabling statically linking only to shared or static library. Differential Revision: https://reviews.llvm.org/D49502 llvm-svn: 337668
* Fix use of C++14 syntax in C++11 filesystem tests.Eric Fiselier2018-07-231-3/+5
| | | | llvm-svn: 337666
* Work around various GCC 4.9 build errorsEric Fiselier2018-07-232-9/+14
| | | | llvm-svn: 337665
* Implement filesystem_error::what() and improve reporting.Eric Fiselier2018-07-2315-444/+716
| | | | | | | | | | | 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. llvm-svn: 337664
* Workaround bug in GCC trunk.Eric Fiselier2018-07-221-4/+4
| | | | | | | | | | For some reason GCC ToT is failing to deduce the auto type for a static data member from its initializer in some cases. Though I'm sure the bug will be short lived, there is a trivial workaround for it. So we might as well get the bot passing again. llvm-svn: 337661
* Harden copy_file even more.Eric Fiselier2018-07-221-5/+7
| | | | | | | | | | | This patch removes the O_CREAT open flag when we first attempt to open the destination file but we expect it to already exist. This theoretically avoids the possibility that it was removed between when we first stat'ed it, and when we attempt to open it. llvm-svn: 337659
* fix test failures with older clang versionsEric Fiselier2018-07-225-4/+36
| | | | llvm-svn: 337658
* Implement a better copy_file.Eric Fiselier2018-07-226-324/+666
| | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 337649
* [CMake] Install C++ ABI headers into the right locationPetr Hosek2018-07-201-10/+2
| | | | | | | | | | | This is a follow-up to r335809 and r337118. While libc++ headers are now installed into the right location in both standard as well as multiarch runtimes layout, turned out C++ ABI headers are still installed into the old location in the latter case. This change addresses that. Differential Revision: https://reviews.llvm.org/D49584 llvm-svn: 337630
* adjust incorrect commentEric Fiselier2018-07-201-1/+2
| | | | llvm-svn: 337532
* Fix two test failures in <experimental/filesystem>Eric Fiselier2018-07-202-1/+6
| | | | | | | | | | 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. llvm-svn: 337520
* Use _LIBCPP_UNREACHABLE to convince GCC that non-void functions actually ↵Eric Fiselier2018-07-202-2/+10
| | | | | | always return llvm-svn: 337519
* cleanup test assertion inside libraryEric Fiselier2018-07-201-6/+0
| | | | llvm-svn: 337517
* [libc++] Implement Directory Entry Caching -- Sort of.Eric Fiselier2018-07-2027-464/+3111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 337516
* [libc++] Allow running ABI list tests with different ABI versionsLouis Dionne2018-07-194-17/+2425
| | | | | | | | | | | | | | | Summary: Currently, the ABI list test only works for ABI version 1. This commit allows running the ABI list test with ABI version 2. It also adds an ABI list file for ABI v2 on Mac OS X. Reviewers: EricWF Subscribers: mgorny, christof, dexonsmith, llvm-commits, mclow.lists Differential Revision: https://reviews.llvm.org/D49509 llvm-svn: 337477
* Update the synopsis for <chrono> for C++20. No functional change.Marshall Clow2018-07-181-0/+492
| | | | llvm-svn: 337406
* Address "always inline function is not always inlinable" warning with GCC.Eric Fiselier2018-07-171-13/+8
| | | | | | | | | | | | When an always_inline function is used prior to the functions definition, the compiler may not be able to inline it as requested by the attribute. GCC flags the `basic_string(CharT const*)` function as one such example. This patch supresses the warning, and the problem, by moving the definition of the string constructor to the inline declaration. This ensures the body is available when it is first ODR used. llvm-svn: 337235
* Fix PR38160 - init_priority attribute not supported by GCC on Apple.Eric Fiselier2018-07-161-1/+12
| | | | | | | | This patch guards the use of __attribute__((init_priority(101))) within memory_resource.cpp when building with compilers that don't support it. Specifically GCC on Apple platforms, and MSVC. llvm-svn: 337205
* [CMake] Use correct variable as header install prefixPetr Hosek2018-07-151-2/+2
| | | | | | | | | | This variable is already set in CMakeLists.txt but it wasn't used which means that the headers get installed into a wrong location when the per target runtime directory option is being used. Differential Revision: https://reviews.llvm.org/D49345 llvm-svn: 337118
* Mark __equal_to 's operations as constexpr.Marshall Clow2018-07-141-4/+4
| | | | llvm-svn: 337087
* Mark one more __wrap_iter operation as constexpr.Marshall Clow2018-07-141-1/+2
| | | | llvm-svn: 337085
* wrap _LIBCPP_HAS_NO_CXX14_CONSTEXPR in defined(...)Marshall Clow2018-07-131-1/+1
| | | | llvm-svn: 337028
* Shot in the dark to fix gcc 4.9 / c++11 buildMarshall Clow2018-07-131-3/+3
| | | | llvm-svn: 337027
* Make internal class __wrap_iter constexpr when not using libc++'s debugging ↵Marshall Clow2018-07-133-56/+66
| | | | | | mode. Introduce a new macro _LIBCPP_CONSTEXPR_IF_NODEBUG to mark this. llvm-svn: 337019
* Fix a couple of 'unused variable' warnings in a vector test. NFC.Marshall Clow2018-07-131-0/+4
| | | | llvm-svn: 337016
* Turns out that wide literals U"xxx" and u"xxx" are c++11 and later.Marshall Clow2018-07-121-0/+2
| | | | llvm-svn: 336880
* [libc++] Take 2: Replace uses of _LIBCPP_ALWAYS_INLINE by ↵Louis Dionne2018-07-1130-387/+377
| | | | | | | | | | | | | | | | | | | | | | | | | | _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 llvm-svn: 336866
* Same reversed ifdef happened twice. Test fix only, NFC to the library.Marshall Clow2018-07-111-1/+1
| | | | llvm-svn: 336856
* Fix a test #ifdef that was reversed. NFC to the library.Marshall Clow2018-07-111-1/+1
| | | | llvm-svn: 336855
* [CMake] Set per-runtime library directory suffix in runtimes buildPetr Hosek2018-07-101-1/+1
| | | | | | | | | | | | Do not use LLVM_RUNTIMES_LIBDIR_SUFFIX variable which is an internal variable used by the runtimes build from individual runtimes, instead set per-runtime librarhy directory suffix variable which is necessary for the sanitized runtimes build to install libraries into correct location. Differential Revision: https://reviews.llvm.org/D49121 llvm-svn: 336713
* [libc++] Declare noop_coroutine() with _LIBCPP_INLINE_VISIBILITYLouis Dionne2018-07-101-0/+1
| | | | | | | | | | | | | | | | | 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 llvm-svn: 336709
* Remove BUILD file from google-benchmarkEric Fiselier2018-07-101-65/+0
| | | | llvm-svn: 336666
* [libc++] Declare <compare> operators with the proper visibility attributeLouis Dionne2018-07-101-55/+55
| | | | | | | | | | | | | | | | | | | | | | Summary: Many operators in <compare> were _defined_ with the proper visibility attribute, but they were _declared_ without any. This is not a problem until we change the definition of _LIBCPP_INLINE_VISIBILITY to something that requires the declaration to be decorated. I also marked `strong_equality::operator weak_equality()` as `_LIBCPP_INLINE_VISIBILITY`, since it seems like it had been forgotten. This came up while trying to get rid of `__attribute__((__always_inline__))` in favor of `__attribute__((internal_linkage))`. Reviewers: EricWF, mclow.lists Subscribers: christof, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D49104 llvm-svn: 336665
* Add new string benchmarksEric Fiselier2018-07-101-0/+21
| | | | llvm-svn: 336636
* Update google-benchark to trunkEric Fiselier2018-07-1066-729/+2671
| | | | llvm-svn: 336635
* [test] two small cleanups:Casey Carter2018-07-092-5/+2
| | | | | | | | * Remove unused type from is_assignable.pass.cpp * Don't specialize `common_type<::X<float>>` in common_type.pass.cpp, which violates the requirements of [meta.trans.other]/5 llvm-svn: 336618
* type_traits: aligned_union is NOT the same as __uncvref [NFC]Casey Carter2018-07-081-25/+25
| | | | llvm-svn: 336502
* Revert "[libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by ↵Louis Dionne2018-07-0530-377/+387
| | | | | | | | | | | | | | | _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. llvm-svn: 336382
* Fix HTML blunderMarshall Clow2018-07-051-1/+1
| | | | llvm-svn: 336381
* [libc++] Replace uses of _LIBCPP_ALWAYS_INLINE by _LIBCPP_INLINE_VISIBILITYLouis Dionne2018-07-0530-387/+377
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 336369
* [NFC] Add <initializer_list> to the synopsis of <utility>Louis Dionne2018-07-051-0/+2
| | | | | | | | | | | | | | Summary: It is part of the synopsis in the Standard and <utility> does include it, but it was left out of the synopsis comment. Reviewers: EricWF, mclow.lists Subscribers: christof, llvm-commits Differential Revision: https://reviews.llvm.org/D48611 llvm-svn: 336368
* Remove old workaround that is no longer neededEric Fiselier2018-07-041-3/+0
| | | | llvm-svn: 336297
* [libc++] Install the missing header __errcZhihao Yuan2018-07-031-0/+1
| | | | | | | | | | | | Summary: Omitted from D41347. Reviewers: EricWF Subscribers: mgorny, christof, ldionne, cfe-commits Differential Revision: https://reviews.llvm.org/D48864 llvm-svn: 336165
* [libc++] Lift std::errc into a separated headerZhihao Yuan2018-07-033-187/+220
| | | | | | | | | | | | | | Summary: This is needed to implement `<charconv>`, otherwise `<charconv>` would need to include `<system_error>`, which pulls in `<string>` -- a header which the `<charconv>` proposal intends to keep away from. Reviewers: mclow.lists, EricWF Reviewed By: mclow.lists Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D41347 llvm-svn: 336164
* [Win32] Overload ==, != for locale_t and long longPirama Arumuga Nainar2018-07-021-0/+8
| | | | | | | | | | | | | | | | Summary: _is_chartype_l (needed for isxdigit_l) in MinGW compares locale_t and NULL. NULL is 'long long' for 64-bit, and this results in ambiguous overloads when compiled with Clang. Define a concrete overload for the operators to fix the ambiguity. Reviewers: mstorsjo, EricWF, srhines, danalbert Subscribers: christof, cfe-commits, ldionne Differential Revision: https://reviews.llvm.org/D48749 llvm-svn: 336141
* Implement LWG 2946, 3075 and 3076. Reviewed as https://reviews.llvm.org/D48616Marshall Clow2018-07-0228-148/+755
| | | | llvm-svn: 336132
* Configure ELAST for MinGWPirama Arumuga Nainar2018-06-281-2/+2
| | | | | | | | | | | | | | Summary: Use _LIBCPP_MSVCRT_LIKE while configuring ELAST, so MinGW gets the same configuration as MSVC. Reviewers: compnerd, srhines, danalbert, mstorsjo Subscribers: christof, ldionne, cfe-commits Differential Revision: https://reviews.llvm.org/D48731 llvm-svn: 335916
* [CMake] Rename cxx_headers back to cxx-headers.Ahmed Bougacha2018-06-282-5/+5
| | | | | | | | | | | | | | r334477 renamed the cxx-headers target to cxx_headers, but various pieces sort-of expect the target names to match the component (e.g., LLVM_DISTRIBUTION_COMPONENTS in the various bootstrap caches, which, via some magic foreign to me, seems to expect cxx-headers, install-cxx-headers, and install-cxx-headers-stripped to exist.) Revert back to cxx-headers. Differential Revision: https://reviews.llvm.org/D48701 llvm-svn: 335899
* Support for multiarch runtimes layoutPetr Hosek2018-06-283-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a support for multiarch style runtimes layout, so in addition to the existing layout where runtimes get installed to: lib/clang/$version/lib/$os Clang now allows runtimes to be installed to: lib/clang/$version/$target/lib This also includes libc++, libc++abi and libunwind; today those are assumed to be in Clang library directory built for host, with the new layout it is possible to install libc++, libc++abi and libunwind into the runtime directory built for different targets. The use of new layout is enabled by setting the LLVM_ENABLE_RUNTIME_TARGET_DIR CMake variable and is supported by both projects and runtimes layouts. The runtimes CMake build has been further modified to use the new layout when building runtimes for multiple targets. Differential Revision: https://reviews.llvm.org/D45604 llvm-svn: 335809
OpenPOWER on IntegriCloud