TTobias HietaBump version to 19.1.7
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[libc++] Add missing include to three_way_comp_ref_type.h We were using a _LIBCPP_ASSERT_FOO macro without including <__assert>. rdar://134425695 (cherry picked from commit 0df78123fdaed39d5135c2e4f4628f515e6d549d) | 1 年前 | |
[libc++] Increase atomic_ref's required alignment for small types (#99654) This patch increases the alignment requirement for std::atomic_ref such that we can guarantee lockfree operations more often. Specifically, we require types that are 1, 2, 4, 8, or 16 bytes in size to be aligned to at least their size to be used with std::atomic_ref. This is the case for most types, however a notable exception is long long on x86, which is 8 bytes in length but has an alignment of 4. As a result of this patch, one has to be more careful about the alignment of objects used with std::atomic_ref. Failure to provide a properly-aligned object to std::atomic_ref is a precondition violation and is technically UB. On the flipside, this allows us to provide an atomic_ref that is actually lockfree more often, which is an important QOI property. More information in the discussion at https://github.com/llvm/llvm-project/pull/99570#issuecomment-2237668661. Co-authored-by: Louis Dionne <ldionne.2@gmail.com> (cherry picked from commit 59ca618e3b7aec8c32e24d781bae436dc99b2727) | 1 年前 | |
[libc++][bit] Improves rotate functions. (#98032) Investigating #96612 shows our implementation was different from the Standard and could cause UB. Testing the codegen showed quite a bit of assembly generated for these functions. The functions have been written differently which allows Clang to optimize the code to use simple CPU rotate instructions. Fixes: https://github.com/llvm/llvm-project/issues/96612 | 1 年前 | |
[libc++][NFC] Replace _NOEXCEPT and _LIBCPP_CONSTEXPR macros with the keywords in C++11 code (#96387) | 2 年前 | |
[libc++][TZDB] Implements zoned_time formatters. (#98347) Implements parts of: - P0355 Extending to chrono Calendars and Time Zones - P1361 Integration of chrono with text formatting - P2372 Fixing locale handling in chrono formatters | 1 年前 | |
[libc++] Restore __synth_three_way lambda (#90398) Restore __synth_three_way lambda to match the Standard. GH-57222 is done, restoring the Standard wording implementation should be possible. https://github.com/llvm/llvm-project/blob/df28d4412c1d21b0e18896c92ac77d2fac7729f1/libcxx/include/__compare/synth_three_way.h#L28 According to comment https://github.com/llvm/llvm-project/issues/59513#issuecomment-2068338762, GH-59513 is not a blocker. Co-authored-by: Hristo Hristov <zingam@outlook.com> | 2 年前 | |
[libc++][ranges] remove __workaround_52970 (#85683) ## Abstract This pull request removes the __workaround_52970 concept. This concept is a workaround for a bug described in #52970, which causes the compiler to trigger ADL on a pointer to an incomplete type in an SFINAE context. This bug is fixed in Clang 14. ## Reference - [[clang] Don't typo-fix an expression in a SFINAE context](https://reviews.llvm.org/D117603) - [[libc++] [ranges] ADL-proof the [range.access] CPOs.](https://reviews.llvm.org/D116239) | 2 年前 | |
[libc++] Split the monolithic __threading_support header (#79654) The <__threading_support> header is a huge beast and it's really difficult to navigate. I find myself struggling to find what I want every time I have to open it, and I've been considering splitting it up for years for that reason. This patch aims not to contain any functional change. The various implementations of the threading base are simply moved to separate headers and then the individual headers are simplified in mechanical ways. For example, we used to have redundant declarations of all the functions at the top of __threading_support, and those are removed since they are not needed anymore. The various #ifdefs are also simplified and removed when they become unnecessary. Finally, this patch adds documentation for the API we expect from any threading implementation. | 2 年前 | |
[libc++][hardening] Use bounded iterators in std::vector and std::string (#78929) ~~NB: This PR depends on #78876. Ignore the first commit when reviewing, and don't merge it until #78876 is resolved. When/if #78876 lands, I'll clean this up.~~ This partially restores parity with the old, since removed debug build. We now can re-enable a bunch of the disabled tests. Some things of note: - bounded_iter's converting constructor has never worked. It needs a friend declaration to access the other bound_iter instantiation's private fields. - The old debug iterators also checked that callers did not try to compare iterators from different objects. bounded_iter does not currently do this, so I've left those disabled. However, I think we probably should add those. See https://github.com/llvm/llvm-project/issues/78771#issuecomment-1902999181 - The std::vector iterators are bounded up to capacity, not size. This makes for a weaker safety check. This is because the STL promises not to invalidate iterators when appending up to the capacity. Since we cannot retroactively update all the iterators on push_back(), I've instead sized it to the capacity. This is not as good, but at least will stop the iterator from going off the end of the buffer. There was also no test for this, so I've added one in the std directory. - std::string has two ambiguities to deal with. First, I opted not to size it against the capacity. https://eel.is/c++draft/string.require#4 says iterators are invalidated on an non-const operation. Second, whether the iterator can reach the NUL terminator. The previous debug tests and the special-case in https://eel.is/c++draft/string.access#2 suggest no. If either of these causes widespread problems, I figure we can revisit. - resize_and_overwrite.pass.cpp assumed std::string's iterator supported s.begin().base(), but I see no promise of this in the standard. GCC also doesn't support this. I fixed the test to use std::to_address. - alignof.compile.pass.cpp's pointer isn't enough of a real pointer. (It needs to satisfy NullablePointer, LegacyRandomAccessIterator, and LegacyContiguousIterator.) __bounded_iter seems to instantiate enough to notice. I've added a few more bits to satisfy it. Fixes #78805 | 1 年前 | |
[libc++][hardening] Classify assertions related to leaks and syscalls. (#77164) Introduce two new categories: - _LIBCPP_ASSERT_VALID_DEALLOCATION; - _LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL. | 2 年前 | |
[libc++][NFC] Move basic ASan annotation functions into a utility header (#87220) | 2 年前 | |
[libc++] Fix the signatures of std::rethrow_if_nested (#91365) Fixes #54470. See https://eel.is/c++draft/global.functions#2: > A call to a non-member function signature described in [support] > through [thread] and [depr] shall behave as if the implementation > declared no additional non-member function signatures. and https://eel.is/c++draft/global.functions#3: > An implementation shall not declare a non-member function signature > with additional default arguments. | 2 年前 | |
[libc++] restrict the expected conversion constructor not compete against copy constructor (#96101) fixes #92676 So right now clang does not like std::expected<std::any, int> e1; auto e2 = e1; So basically when clang tries to do overload resolution of auto e2 = e1; It finds expected(const expected&); // 1. This is OK expected(const expected<_Up, _OtherErr>&) requires __can_convert; // 2. This needs to check its constraints Then in __can_convert, one of the check is _Not<is_constructible<_Tp, expected<_Up, _OtherErr>&>> which is checking is_constructible<std::any, expected<_Up, _OtherErr>&> Then it looks at std::any's constructor template < class _ValueType, class _Tp = decay_t<_ValueType>, class = enable_if_t< !is_same<_Tp, any>::value && !__is_inplace_type<_ValueType>::value && is_copy_constructible<_Tp>::value> > any(_ValueType&& __value); In the above, is_copy_constructible<_Tp> expands to is_copy_constructible<std::expected<std::any, int>> And the above goes back to the original thing we asked : copy the std::expected, which goes to the overload resolution again. expected(const expected&); expected(const expected<_Up, _OtherErr>&) requires __can_convert; So the second overload results in a logical cycle. I am not a language lawyer. We could argue that clang should give up on the second overload which has logical cycle, as the first overload is a perfect match. Anyway, the fix in this patch tries to short-circuiting the second overload's constraint check: that is, if the argument matches exact same expected<T, E>, we give up immediately and let the copy constructor to deal with it | 2 年前 | |
[libc++] Make the __availability header a sub-header of __config (#93083) In essence, this header has always been related to configuration of the library but we didn't want to put it inside <__config> due to complexity reasons. Now that we have sub-headers in <__config>, we can move <__availability> to it and stop including it everywhere since we already obtain the required macros via <__config>. | 2 年前 | |
[libc++][format] LWG4061: Should std::basic_format_context be default-constructible/copyable/movable? (#97251) See [LWG4061](https://cplusplus.github.io/LWG/issue4061) and [P3341R0](https://wg21.link/p3341r0). Effectively reverts commit 36ce0c3b1e581ca310ae7d0cbc6af002cc5d0251. libcxx/test/std/utilities/format/format.functions/bug_81590.compile.pass.cpp has a format function that unexpectedly takes the basic_format_context by value, which is made ill-formed by LWG4061. This PR changes the function to take the context by reference. | 2 年前 | |
[libc++][NFC] Replace _NOEXCEPT and _LIBCPP_CONSTEXPR macros with the keywords in C++11 code (#96387) | 2 年前 | |
[libc++] Make the __availability header a sub-header of __config (#93083) In essence, this header has always been related to configuration of the library but we didn't want to put it inside <__config> due to complexity reasons. Now that we have sub-headers in <__config>, we can move <__availability> to it and stop including it everywhere since we already obtain the required macros via <__config>. | 2 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++][spaceship] Implements X::iterator container requirements. (#99343) This implements the requirements for the container iterator requirements for array, deque, vector, and vector<bool>. Implements: - LWG3352 strong_equality isn't a thing Implements parts of: - P1614R2 The Mothership has Landed Fixes: https://github.com/llvm/llvm-project/issues/62486 | 1 年前 | |
[libc++] Remove dead code from the locale base API and support code (#89070) | 2 年前 | |
[libc++][math] Fix undue overflowing of std::hypot(x,y,z) (#100820) This is in relation to mr #93350. It was merged to main, but reverted because of failing sanitizer builds on PowerPC. The fix includes replacing the hard-coded threshold constants (e.g. __overflow_threshold) for different floating-point sizes by a general computation using std::ldexp. Thus, it should now work for all architectures. This has the drawback of not being constexpr anymore as std::ldexp is not implemented as constexpr (even though the standard mandates it for C++23). Closes #92782 (cherry picked from commit 72825fde03aab3ce9eba2635b872144d1fb6b6b2) | 1 年前 | |
[libc++] P2389R2: dextents Index Type Parameter (#97393) This patch implements P2389R2, which was adopted at the St. Louis meeting. It builds upon previous enhancements from P2299R3, which introduced deduction guides and the dextents alias template. | 2 年前 | |
[libc++] Use a different smart ptr type alias (#102089) The _SP type is used by some C libraries and this alias could conflict with it. (cherry picked from commit 7951673d408ee64744d0b924a49db78e8243d876) | 1 年前 | |
[libc++] Make the __availability header a sub-header of __config (#93083) In essence, this header has always been related to configuration of the library but we didn't want to put it inside <__config> due to complexity reasons. Now that we have sub-headers in <__config>, we can move <__availability> to it and stop including it everywhere since we already obtain the required macros via <__config>. | 2 年前 | |
[libc++] Make std::lock_guard available with _LIBCPP_HAS_NO_THREADS (#98717) This change makes std::lock_guard available when _LIBCPP_HAS_NO_THREADS is set. This class is generic and doesn't require threading support, and is regularly used even in environments where threading isn't available like embedded. fixes #89891 --------- Co-authored-by: Louis Dionne <ldionne.2@gmail.com> | 2 年前 | |
| 2 年前 | ||
[libc++] Enable modernize-use-equals-delete (#93293) Differential Revision: https://reviews.llvm.org/D121213 | 2 年前 | |
[libc++] Remove unnecessary #ifdef guards around PSTL implementation details (#95268) We want the PSTL implementation details to be available regardless of the Standard mode or whether the experimental PSTL is enabled. This patch guards the inclusion of the PSTL to the top-level headers that define the public API in __numeric and __algorithm. | 2 年前 | |
[libc++][NFC] Replace _NOEXCEPT and _LIBCPP_CONSTEXPR macros with the keywords in C++11 code (#96387) | 2 年前 | |
[libc++][ranges] LWG3618: Unnecessary iter_move for transform_view::iterator (#91809) ## Introduction This patch implements LWG3618: Unnecessary iter_move for transform_view::iterator. transform_view's iterator currently specifies a customization point for iter_move. This customization point does the same thing that the default implementation would do, but its sole purpose is to ensure the appropriate conditional noexcept specification. ## Reference - [[range.transform.iterator]](https://eel.is/c++draft/range.transform.iterator) - [LWG3618](https://cplusplus.github.io/LWG/issue3618) | 1 年前 | |
[libc++] Make the __availability header a sub-header of __config (#93083) In essence, this header has always been related to configuration of the library but we didn't want to put it inside <__config> due to complexity reasons. Now that we have sub-headers in <__config>, we can move <__availability> to it and stop including it everywhere since we already obtain the required macros via <__config>. | 2 年前 | |
[libc++][NFC] Merge identical char_traits functions into a base class (#97700) | 2 年前 | |
[libc++] Remove dead code from the locale base API and support code (#89070) | 2 年前 | |
[libc++] Undeprecate POSIX STREAM macros. (#88296) LWG3869 Deprecate std::errc constants related to UNIX STREAMS deprecates the POSIX macros ENODATA, ENOSR, ENOSTR, and ETIME. These were deprecated in libc++ in https://github.com/llvm/llvm-project/pull/80542. Based on the post commit feedback the macro are no longer deprecated. Instead libc++ leaves the deprecation to the provider of errno.h. --------- Co-authored-by: Hristo Hristov <zingam@outlook.com> Co-authored-by: Louis Dionne <ldionne.2@gmail.com> | 2 年前 | |
[libc++] Enable modernize-use-equals-delete (#93293) Differential Revision: https://reviews.llvm.org/D121213 | 2 年前 | |
[libc++] Clean up some now dead code with the upgrade to GCC 14 (#97746) | 2 年前 | |
| 1 年前 | ||
[libc++] Make std::pair trivially copyable if its members are (#89652) This makes std::pair trivially copyable if its members are and we have a way to do so. We need either C++20 with requires clauses or support for __attribute__((enable_if)). Only Clang has support for this attribute, so it's effectively clang or C++20. Co-authored-by: Christopher Di Bella <cjdb@google.com> | 1 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++][NFC] Replace _NOEXCEPT and _LIBCPP_CONSTEXPR macros with the keywords in C++11 code (#96387) | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++][math] Mathematical Special Functions: Hermite Polynomial (#89982) Implementing the Hermite polynomials which are part of C++17's mathematical special functions. The goal is to get early feedback which will make implementing the other functions easier. Integration of functions in chunks (e.g. std::hermite at first, then std::laguerre, etc.) might make sense as well (also see note on boost.math below). I started out from this abandoned merge request: https://reviews.llvm.org/D58876 . The C++23 standard defines them in-terms of /* floating-point type */ arguments. I have not looked into that. Note, there is still an ongoing discussion on discourse whether importing boost.math is an option. | 1 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++][spaceship] Implements X::iterator container requirements. (#99343) This implements the requirements for the container iterator requirements for array, deque, vector, and vector<bool>. Implements: - LWG3352 strong_equality isn't a thing Implements parts of: - P1614R2 The Mothership has Landed Fixes: https://github.com/llvm/llvm-project/issues/62486 | 1 年前 | |
Bump version to 19.1.7 | 1 年前 | |
| 2 年前 | ||
[libc++] Refactor<__type_traits/is_swappable.h> (#86822) This changes the is_swappable implementation to use variable templates first and basing the class templates on that. This avoids instantiating them when the _v versions are used, which are generally less resource intensive. | 2 年前 | |
[libc++] Mark more types as trivially relocatable (#89724) Co-authored-by: Louis Dionne <ldionne.2@gmail.com> | 2 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++] Remove _LIBCPP_DISABLE_NODISCARD_EXTENSIONS and refactor the tests (#87094) This also adds a few tests that were missing. | 2 年前 | |
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++] Remove experimental pmr headers now shipped in mainline (#73172) Several experimental headers around std::pmr have been slated for removal for a while now. This patch actually performs the removal and cleanups from the code base. | 2 年前 | |
[libc++] cuchar redeclares ::mbstate_t when it's in its own clang module When cuchar is compiled independently on platforms that don't have <uchar.h>, it doesn't get a declaration of mbstate_t, and so makes an empty declaration for ::mbstate_t. That conflicts with the declarations in __mbstate_t.h and cwchar since both of those headers do get mbstate_t before making ::mbstate_t. Change __mbstate_t.h to just get the underlying declaration for mbstate_t and not make a declaration for ::mbstate_t. Include __mbstate_t.h in uchar.h and wchar.h when their next headers aren't available so that at least mbstate_t gets defined. Add __std_mbstate_t.h to declare ::mbstate_t for headers that need that when cuchar or cwchar aren't available (because either _LIBCPP_HAS_NO_WIDE_CHARACTERS or _LIBCPP_CXX03_LANG). Reviewed By: ldionne, Mordante, #libc, philnik Differential Revision: https://reviews.llvm.org/D148542 | 3 年前 | |
[libc++] Refactor<__type_traits/is_swappable.h> (#86822) This changes the is_swappable implementation to use variable templates first and basing the class templates on that. This avoids instantiating them when the _v versions are used, which are generally less resource intensive. | 2 年前 | |
Fixing conflicting macro definitions between curses.h and the standard library. POSIX allows certain macros to exist with generic names (i.e. refresh(), move(), and erase()) to exist in curses.h which conflict with functions found in std::filesystem, among others. This patch undefs the macros in question and adds them to LIBCPP_PUSH_MACROS and LIBCPP_POP_MACROS. Reviewed By: #libc, philnik, ldionne Differential Revision: https://reviews.llvm.org/D147356 | 3 年前 | |
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++][ranges] P1223R5: find_last (#99312) Implements [P1223R5][] completely. Includes an implementation of find_last, find_last_if, and find_last_if_not. [P1223R5]: https://wg21.link/p1223r5 | 2 年前 | |
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++] Restore __synth_three_way lambda (#90398) Restore __synth_three_way lambda to match the Standard. GH-57222 is done, restoring the Standard wording implementation should be possible. https://github.com/llvm/llvm-project/blob/df28d4412c1d21b0e18896c92ac77d2fac7729f1/libcxx/include/__compare/synth_three_way.h#L28 According to comment https://github.com/llvm/llvm-project/issues/59513#issuecomment-2068338762, GH-59513 is not a blocker. Co-authored-by: Hristo Hristov <zingam@outlook.com> | 2 年前 | |
| 2 年前 | ||
[libc++] Handle _LIBCPP_HAS_NO_{THREADS,LOCALIZATION} consistently with other carve-outs (#98319) Previously, we would issue an #error when using a header that requires threading support or localization support in a configuration where that is disabled. This is unlike what we do for all the other carve outs like no-filesystem, no-wide-characters or no-random-device. Instead of issuing an #error, we normally just remove the problematic parts of the header. This patch makes the handling of no-localization and no-threads consistent with the other carve-outs. I dislike the fact that users won't get an explicit error message when trying to use e.g. ios in a build that doesn't support localization, but I think it is better to handle things consistently. Note that besides the consistency argument, the #error approach doesn't really work anyways since it would break down if we moved towards assuming the C locale only in the no-localization mode. | 2 年前 | |
[libc++][RFC] Only include what is required by-version in the umbrella headers (#83740) This is a relatively low cost way of reducing the include sizes in older language modes compared to the effect. For example, in C++14 mode the include time of <algorithm> is reduced from 198ms to 127ms. | 2 年前 | |
| 2 年前 | ||
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Undeprecate POSIX STREAM macros. (#88296) LWG3869 Deprecate std::errc constants related to UNIX STREAMS deprecates the POSIX macros ENODATA, ENOSR, ENOSTR, and ETIME. These were deprecated in libc++ in https://github.com/llvm/llvm-project/pull/80542. Based on the post commit feedback the macro are no longer deprecated. Instead libc++ leaves the deprecation to the provider of errno.h. --------- Co-authored-by: Hristo Hristov <zingam@outlook.com> Co-authored-by: Louis Dionne <ldionne.2@gmail.com> | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++][RFC] Only include what is required by-version in the umbrella headers (#83740) This is a relatively low cost way of reducing the include sizes in older language modes compared to the effect. For example, in C++14 mode the include time of <algorithm> is reduced from 198ms to 127ms. | 2 年前 | |
Guard an include of <ostream> in <chrono> with availability macro (#108429) This fixes a regression introduced in https://github.com/llvm/llvm-project/pull/96035. (cherry picked from commit 127c34948bd54e92ef2ee544e8bc42acecf321ad) | 1 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++][math] Fix undue overflowing of std::hypot(x,y,z) (#100820) This is in relation to mr #93350. It was merged to main, but reverted because of failing sanitizer builds on PowerPC. The fix includes replacing the hard-coded threshold constants (e.g. __overflow_threshold) for different floating-point sizes by a general computation using std::ldexp. Thus, it should now work for all architectures. This has the drawback of not being constexpr anymore as std::ldexp is not implemented as constexpr (even though the standard mandates it for C++23). Closes #92782 (cherry picked from commit 72825fde03aab3ce9eba2635b872144d1fb6b6b2) | 1 年前 | |
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++][RFC] Only include what is required by-version in the umbrella headers (#83740) This is a relatively low cost way of reducing the include sizes in older language modes compared to the effect. For example, in C++14 mode the include time of <algorithm> is reduced from 198ms to 127ms. | 2 年前 | |
| 1 年前 | ||
[libc++] Only include_next C library headers when they exist Some platforms don't provide all C library headers. In practice, libc++ only requires a few C library headers to exist, and only a few functions on those headers. Missing functions that libc++ doesn't need for its own implementation are handled properly by the using_if_exists attribute, however a missing header is currently a hard error when we try to do #include_next. This patch should make libc++ more flexible on platforms that do not provide C headers that libc++ doesn't actually require for its own implementation. The only downside is that it may move some errors from the #include_next point to later in the compilation if we actually try to use something that isn't provided, which could be somewhat confusing. However, these errors should be caught by folks trying to port libc++ over to a new platform (when running the libc++ test suite), not by end users. NOTE: This is a reapplicaton of 226409, which was reverted in 674729813 because it broke the build. The issue has now been fixed with https://reviews.llvm.org/D138062. Differential Revision: https://reviews.llvm.org/D136683 | 3 年前 | |
[libc++][RFC] Only include what is required by-version in the umbrella headers (#83740) This is a relatively low cost way of reducing the include sizes in older language modes compared to the effect. For example, in C++14 mode the include time of <algorithm> is reduced from 198ms to 127ms. | 2 年前 | |
[libc++] Make the __availability header a sub-header of __config (#93083) In essence, this header has always been related to configuration of the library but we didn't want to put it inside <__config> due to complexity reasons. Now that we have sub-headers in <__config>, we can move <__availability> to it and stop including it everywhere since we already obtain the required macros via <__config>. | 2 年前 | |
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Remove _LIBCPP_DISABLE_NODISCARD_EXTENSIONS and refactor the tests (#87094) This also adds a few tests that were missing. | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++][NFC] Replace __apply_cv with __copy_cv or __copy_cvref (#90867) __apply_cv_t and __copy_cvref_t are very closely related. They are in fact identical except that __copy_cvref_t handles rvalue references properly. Some uses don't actually require handling of references, so they are replaced with __copy_cv_t. | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++][spaceship] Implements X::iterator container requirements. (#99343) This implements the requirements for the container iterator requirements for array, deque, vector, and vector<bool>. Implements: - LWG3352 strong_equality isn't a thing Implements parts of: - P1614R2 The Mothership has Landed Fixes: https://github.com/llvm/llvm-project/issues/62486 | 1 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Simplify the implementation of remove_reference (#85207) GCC 13 introduced the type trait __remove_reference. We can simplify the implementation of remove_reference a bit by using it. | 2 年前 | |
| 2 年前 | ||
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
| 2 年前 | ||
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libcxx] don't #include <cwchar> if wide chars aren't enabled (#99911) Pull request #96032 unconditionall adds the cwchar include in the format umbrella header. However support for wchar_t can be disabled in the build system (LIBCXX_ENABLE_WIDE_CHARACTERS). This patch guards against inclusion of cwchar in format by checking the _LIBCPP_HAS_NO_WIDE_CHARACTERS define. For clarity I've also merged the include header section that cwchar was in with the one above as they were both guarded by the same #if logic. (cherry picked from commit ec56790c3b27df4fa1513594ca9a74fd8ad5bf7f) | 1 年前 | |
| 2 年前 | ||
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
| 2 年前 | ||
[libc++] Handle _LIBCPP_HAS_NO_{THREADS,LOCALIZATION} consistently with other carve-outs (#98319) Previously, we would issue an #error when using a header that requires threading support or localization support in a configuration where that is disabled. This is unlike what we do for all the other carve outs like no-filesystem, no-wide-characters or no-random-device. Instead of issuing an #error, we normally just remove the problematic parts of the header. This patch makes the handling of no-localization and no-threads consistent with the other carve-outs. I dislike the fact that users won't get an explicit error message when trying to use e.g. ios in a build that doesn't support localization, but I think it is better to handle things consistently. Note that besides the consistency argument, the #error approach doesn't really work anyways since it would break down if we moved towards assuming the C locale only in the no-localization mode. | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] basic_ios<wchar_t> cannot store fill character WCHAR_MAX (#89305) libcxx std::basic_ios uses WEOF to indicate the fill value is uninitialized. On some platforms (e.g AIX and zOS in 64-bit mode) wchar_t is 4 bytes unsigned and wint_t is also 4 bytes which means WEOF cannot be distinguished from WCHAR_MAX by std::char_traits<wchar_t>::eq_int_type(), meaning this valid character value cannot be stored on affected platforms (as the implementation triggers reinitialization to widen(’ ’)). This patch introduces a new helper class _FillHelper uses a boolean variable to indicate whether the fill character has been initialized, which is used by default in libcxx ABI version 2. The patch does not affect ABI version 1 except for targets AIX in 32- and 64-bit and z/OS in 64-bit (so that the layout of the implementation is compatible with the current IBM system provided libc++) This is a continuation of Phabricator patch [D124555](https://reviews.llvm.org/D124555). This patch uses a modified version of the [approach](https://reviews.llvm.org/D124555#3566746) suggested by @ldionne . --------- Co-authored-by: Louis Dionne <ldionne.2@gmail.com> Co-authored-by: David Tenty <daltenty.dev@gmail.com> | 2 年前 | |
[libc++] Enable modernize-use-equals-delete (#93293) Differential Revision: https://reviews.llvm.org/D121213 | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Enable modernize-use-equals-delete (#93293) Differential Revision: https://reviews.llvm.org/D121213 | 2 年前 | |
| 2 年前 | ||
[libc++] Handle _LIBCPP_HAS_NO_{THREADS,LOCALIZATION} consistently with other carve-outs (#98319) Previously, we would issue an #error when using a header that requires threading support or localization support in a configuration where that is disabled. This is unlike what we do for all the other carve outs like no-filesystem, no-wide-characters or no-random-device. Instead of issuing an #error, we normally just remove the problematic parts of the header. This patch makes the handling of no-localization and no-threads consistent with the other carve-outs. I dislike the fact that users won't get an explicit error message when trying to use e.g. ios in a build that doesn't support localization, but I think it is better to handle things consistently. Note that besides the consistency argument, the #error approach doesn't really work anyways since it would break down if we moved towards assuming the C locale only in the no-localization mode. | 2 年前 | |
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++] Restore __synth_three_way lambda (#90398) Restore __synth_three_way lambda to match the Standard. GH-57222 is done, restoring the Standard wording implementation should be possible. https://github.com/llvm/llvm-project/blob/df28d4412c1d21b0e18896c92ac77d2fac7729f1/libcxx/include/__compare/synth_three_way.h#L28 According to comment https://github.com/llvm/llvm-project/issues/59513#issuecomment-2068338762, GH-59513 is not a blocker. Co-authored-by: Hristo Hristov <zingam@outlook.com> | 2 年前 | |
[libc++] Add missing xlocale.h include on Apple and FreeBSD (#99689) The <locale> header uses strtoll_l and friends which are defined in <xlocale.h> on these platforms. While this works via transitive includes when modules are disabled, this doesn't work anymore if the platforms are modularized properly. (cherry picked from commit a55df237375e98cfc2520d5eb1a23b302ef02ba0) | 1 年前 | |
[libc++] Handle _LIBCPP_HAS_NO_{THREADS,LOCALIZATION} consistently with other carve-outs (#98319) Previously, we would issue an #error when using a header that requires threading support or localization support in a configuration where that is disabled. This is unlike what we do for all the other carve outs like no-filesystem, no-wide-characters or no-random-device. Instead of issuing an #error, we normally just remove the problematic parts of the header. This patch makes the handling of no-localization and no-threads consistent with the other carve-outs. I dislike the fact that users won't get an explicit error message when trying to use e.g. ios in a build that doesn't support localization, but I think it is better to handle things consistently. Note that besides the consistency argument, the #error approach doesn't really work anyways since it would break down if we moved towards assuming the C locale only in the no-localization mode. | 2 年前 | |
[libc++] Restore __synth_three_way lambda (#90398) Restore __synth_three_way lambda to match the Standard. GH-57222 is done, restoring the Standard wording implementation should be possible. https://github.com/llvm/llvm-project/blob/df28d4412c1d21b0e18896c92ac77d2fac7729f1/libcxx/include/__compare/synth_three_way.h#L28 According to comment https://github.com/llvm/llvm-project/issues/59513#issuecomment-2068338762, GH-59513 is not a blocker. Co-authored-by: Hristo Hristov <zingam@outlook.com> | 2 年前 | |
[libc++] Remove _LIBCPP_DISABLE_NODISCARD_EXTENSIONS and refactor the tests (#87094) This also adds a few tests that were missing. | 2 年前 | |
| 2 年前 | ||
[libc++] Makes `unique_ptr operator*() noexcept. (#98047) This implements - LWG2762 unique_ptr operator*() should be noexcept. Differential Revision: https://reviews.llvm.org/D128214 | 1 年前 | |
| 2 年前 | ||
[libc++][math] Mathematical Special Functions: Hermite Polynomial (#89982) Implementing the Hermite polynomials which are part of C++17's mathematical special functions. The goal is to get early feedback which will make implementing the other functions easier. Integration of functions in chunks (e.g. std::hermite at first, then std::laguerre, etc.) might make sense as well (also see note on boost.math below). I started out from this abandoned merge request: https://reviews.llvm.org/D58876 . The C++23 standard defines them in-terms of /* floating-point type */ arguments. I have not looked into that. Note, there is still an ongoing discussion on discourse whether importing boost.math is an option. | 1 年前 | |
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++][NFC] Replace _NOEXCEPT and _LIBCPP_CONSTEXPR macros with the keywords in C++11 code (#96387) | 2 年前 | |
| 2 年前 | ||
| 2 年前 | ||
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
Revert "Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (#98547)" This reverts commit ce4aada6e2135e29839f672a6599db628b53295d and a follow-up patch 8ef26f1289bf069ccc0d6383f2f4c0116a1206c1. This new warning can not be fully suppressed by the -Wno-missing-dependent-template-keyword flag, this gives developer no time to do the cleanup in a large codebase, see https://github.com/llvm/llvm-project/pull/98547#issuecomment-2228250884 | 2 年前 | |
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++] Handle _LIBCPP_HAS_NO_{THREADS,LOCALIZATION} consistently with other carve-outs (#98319) Previously, we would issue an #error when using a header that requires threading support or localization support in a configuration where that is disabled. This is unlike what we do for all the other carve outs like no-filesystem, no-wide-characters or no-random-device. Instead of issuing an #error, we normally just remove the problematic parts of the header. This patch makes the handling of no-localization and no-threads consistent with the other carve-outs. I dislike the fact that users won't get an explicit error message when trying to use e.g. ios in a build that doesn't support localization, but I think it is better to handle things consistently. Note that besides the consistency argument, the #error approach doesn't really work anyways since it would break down if we moved towards assuming the C locale only in the no-localization mode. | 2 年前 | |
[libc++] Restore __synth_three_way lambda (#90398) Restore __synth_three_way lambda to match the Standard. GH-57222 is done, restoring the Standard wording implementation should be possible. https://github.com/llvm/llvm-project/blob/df28d4412c1d21b0e18896c92ac77d2fac7729f1/libcxx/include/__compare/synth_three_way.h#L28 According to comment https://github.com/llvm/llvm-project/issues/59513#issuecomment-2068338762, GH-59513 is not a blocker. Co-authored-by: Hristo Hristov <zingam@outlook.com> | 2 年前 | |
[libc++] Handle _LIBCPP_HAS_NO_{THREADS,LOCALIZATION} consistently with other carve-outs (#98319) Previously, we would issue an #error when using a header that requires threading support or localization support in a configuration where that is disabled. This is unlike what we do for all the other carve outs like no-filesystem, no-wide-characters or no-random-device. Instead of issuing an #error, we normally just remove the problematic parts of the header. This patch makes the handling of no-localization and no-threads consistent with the other carve-outs. I dislike the fact that users won't get an explicit error message when trying to use e.g. ios in a build that doesn't support localization, but I think it is better to handle things consistently. Note that besides the consistency argument, the #error approach doesn't really work anyways since it would break down if we moved towards assuming the C locale only in the no-localization mode. | 2 年前 | |
[libc++] Update <source_location> and msvc_stdlib_force_include.h (#74266) This makes libc++'s <filesystem> tests compatible with MSVC's STL. In msvc_stdlib_force_include.h, we need to define 3 more macros: - _CRT_DECLARE_NONSTDC_NAMES activates the POSIX names of getcwd etc. As the comment explains, we need this because we test with Clang -fno-ms-compatibility, which defines __STDC__ to 1, which causes the UCRT headers to disable the POSIX names by default. - Then we need _CRT_NONSTDC_NO_WARNINGS to avoid emitting deprecation warnings about the POSIX names. - Finally, we need NOMINMAX to seal away the ancient evil. These macros are documented in https://learn.microsoft.com/en-us/cpp/c-runtime-library/compatibility?view=msvc-170. As a drive-by change, the patch adds a "simulated" macro for __has_feature(hwaddress_sanitizer). It also clang-formats all of msvc_stdlib_force_include.h and removes guards for __has_builtin(__builtin_source_location) in <source_location>, since those are not needed anymore. | 2 年前 | |
[libc++] Fix rejects-valid in std::span copy construction (#104500) Trying to copy-construct a std::span from another std::span holding an incomplete type would fail as we evaluate the SFINAE for the range-based constructor. The problem was that we checked for __is_std_span after checking for the range being a contiguous_range, which hard-errored because of arithmetic on a pointer to incomplete type. As a drive-by, refactor the whole test and format it. Fixes #104496 (cherry picked from commit 99696b35bc8a0054e0b0c1a26e8dd5049fa8c41b) | 1 年前 | |
[libc++] Make the __availability header a sub-header of __config (#93083) In essence, this header has always been related to configuration of the library but we didn't want to put it inside <__config> due to complexity reasons. Now that we have sub-headers in <__config>, we can move <__availability> to it and stop including it everywhere since we already obtain the required macros via <__config>. | 2 年前 | |
[libc++][NFC] Replace _NOEXCEPT and _LIBCPP_CONSTEXPR macros with the keywords in C++11 code (#96387) | 2 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
| 2 年前 | ||
[NFC][libc++] Fixes comment indention. The output on eel.is has similar oddities, so I expect this was copy pasted. | 2 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++] Remove _LIBCPP_DISABLE_NODISCARD_EXTENSIONS and refactor the tests (#87094) This also adds a few tests that were missing. | 2 年前 | |
| 2 年前 | ||
[libc++][NFC] Remove unnecessary parens in static_asserts (#95605) These were required a long time ago due to static_assert not actually being available in C++03. Now static_assert is simply mapped to _Static_assert in C++03, making the additional parens unnecessary. | 2 年前 | |
| 1 年前 | ||
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
| 2 年前 | ||
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++] Granularize <ostream> (#85537) This also includes <__ostream/basic_ostream.h> in <sstream> now, reducing the include time of <complex> from 819ms to 603ms. | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++] Only include_next C library headers when they exist Some platforms don't provide all C library headers. In practice, libc++ only requires a few C library headers to exist, and only a few functions on those headers. Missing functions that libc++ doesn't need for its own implementation are handled properly by the using_if_exists attribute, however a missing header is currently a hard error when we try to do #include_next. This patch should make libc++ more flexible on platforms that do not provide C headers that libc++ doesn't actually require for its own implementation. The only downside is that it may move some errors from the #include_next point to later in the compilation if we actually try to use something that isn't provided, which could be somewhat confusing. However, these errors should be caught by folks trying to port libc++ over to a new platform (when running the libc++ test suite), not by end users. NOTE: This is a reapplicaton of 226409, which was reverted in 674729813 because it broke the build. The issue has now been fixed with https://reviews.llvm.org/D138062. Differential Revision: https://reviews.llvm.org/D136683 | 3 年前 | |
[libc++] Handle _LIBCPP_HAS_NO_{THREADS,LOCALIZATION} consistently with other carve-outs (#98319) Previously, we would issue an #error when using a header that requires threading support or localization support in a configuration where that is disabled. This is unlike what we do for all the other carve outs like no-filesystem, no-wide-characters or no-random-device. Instead of issuing an #error, we normally just remove the problematic parts of the header. This patch makes the handling of no-localization and no-threads consistent with the other carve-outs. I dislike the fact that users won't get an explicit error message when trying to use e.g. ios in a build that doesn't support localization, but I think it is better to handle things consistently. Note that besides the consistency argument, the #error approach doesn't really work anyways since it would break down if we moved towards assuming the C locale only in the no-localization mode. | 2 年前 | |
[libc++][tuple][utility] P2968R2: Make std::ignore a first-class object (#97401) Implements: https://wg21.link/P2968R2 References: - https://eel.is/c++draft/tuple.general - https://eel.is/c++draft/tuple.syn - https://eel.is/c++draft/tuple.creation - https://github.com/cplusplus/draft/milestone/31 - https://github.com/cplusplus/draft/pull/7109 - https://github.com/cplusplus/papers/issues/1640 - https://cplusplus.github.io/LWG/issue2933 - https://cplusplus.github.io/LWG/issue3978 --------- Co-authored-by: Hristo Hristov <zingam@outlook.com> | 2 年前 | |
[libc++] Merge is_scoped_enum.h into is_enum.h (#99458) | 2 年前 | |
[libc++] Clean up includes of <__assert> (#80091) Originally, we used __libcpp_verbose_abort to handle assertion failures. That function was declared from all public headers. Since we don't use that mechanism anymore, we don't need to declare __libcpp_verbose_abort from all public headers, and we can clean up a lot of unnecessary includes. This patch also moves the definition of the various assertion categories to the <__assert> header, since we now rely on regular IWYU for these assertion macros. rdar://105510916 | 2 年前 | |
[libc++][libc++abi] Minor follow-up changes after ptrauth upstreaming (#87481) This patch applies the comments provided on #84573. This is done as a separate PR to avoid merge conflicts with downstreams that already had ptrauth support. (cherry picked from commit e64e745e8fb802ffb06259b1a5ba3db713a17087) | 1 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++] Move allocator assertion into allocator_traits (#94750) There is code duplication in all containers that static_assert the allocator matches the allocator requirements in the spec. This check can be moved into a more centralised place. | 2 年前 | |
[libc++] Move allocator assertion into allocator_traits (#94750) There is code duplication in all containers that static_assert the allocator matches the allocator requirements in the spec. This check can be moved into a more centralised place. | 2 年前 | |
| 2 年前 | ||
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++][NFC] Run clang-format on libcxx/include again (#95874) As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again. We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once. | 2 年前 | |
[libc++][hardening] Use bounded iterators in std::vector and std::string (#78929) ~~NB: This PR depends on #78876. Ignore the first commit when reviewing, and don't merge it until #78876 is resolved. When/if #78876 lands, I'll clean this up.~~ This partially restores parity with the old, since removed debug build. We now can re-enable a bunch of the disabled tests. Some things of note: - bounded_iter's converting constructor has never worked. It needs a friend declaration to access the other bound_iter instantiation's private fields. - The old debug iterators also checked that callers did not try to compare iterators from different objects. bounded_iter does not currently do this, so I've left those disabled. However, I think we probably should add those. See https://github.com/llvm/llvm-project/issues/78771#issuecomment-1902999181 - The std::vector iterators are bounded up to capacity, not size. This makes for a weaker safety check. This is because the STL promises not to invalidate iterators when appending up to the capacity. Since we cannot retroactively update all the iterators on push_back(), I've instead sized it to the capacity. This is not as good, but at least will stop the iterator from going off the end of the buffer. There was also no test for this, so I've added one in the std directory. - std::string has two ambiguities to deal with. First, I opted not to size it against the capacity. https://eel.is/c++draft/string.require#4 says iterators are invalidated on an non-const operation. Second, whether the iterator can reach the NUL terminator. The previous debug tests and the special-case in https://eel.is/c++draft/string.access#2 suggest no. If either of these causes widespread problems, I figure we can revisit. - resize_and_overwrite.pass.cpp assumed std::string's iterator supported s.begin().base(), but I see no promise of this in the standard. GCC also doesn't support this. I fixed the test to use std::to_address. - alignof.compile.pass.cpp's pointer isn't enough of a real pointer. (It needs to satisfy NullablePointer, LegacyRandomAccessIterator, and LegacyContiguousIterator.) __bounded_iter seems to instantiate enough to notice. I've added a few more bits to satisfy it. Fixes #78805 | 1 年前 | |
[libc++] Adjust the version of __cpp_lib_ranges in C++20 mode This is a (very partial) cherry-pick of #101715 to fix this oversight in the LLVM 19 release. | 1 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 | |
[libc++] Format the code base (#74334) This patch runs clang-format on all of libcxx/include and libcxx/src, in accordance with the RFC discussed at [1]. Follow-up patches will format the benchmarks, the test suite and remaining parts of the code. I'm splitting this one into its own patch so the diff is a bit easier to review. This patch was generated with: find libcxx/include libcxx/src -type f \ | grep -v 'module.modulemap.in' \ | grep -v 'CMakeLists.txt' \ | grep -v 'README.txt' \ | grep -v 'libcxx.imp' \ | grep -v '__config_site.in' \ | xargs clang-format -i A Git merge driver is available in libcxx/utils/clang-format-merge-driver.sh to help resolve merge and rebase issues across these formatting changes. [1]: https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all | 2 年前 |