summaryrefslogtreecommitdiff
path: root/libcxx/include/__memory/temporary_buffer.h
AgeCommit message (Collapse)Author
2024-10-31[libc++] Granularize <cstddef> includes (#108696)Nikolas Klauser
2024-09-16[libc++] Remove get_temporary_buffer and return_temporary_buffer (#100914)A. Jiang
Works towards P0619R4 / #99985. The use of `std::get_temporary_buffer` and `std::return_temporary_buffer` are replaced with `unique_ptr`-based RAII buffer holder. Escape hatches: - `_LIBCPP_ENABLE_CXX20_REMOVED_TEMPORARY_BUFFER` restores `std::get_temporary_buffer` and `std::return_temporary_buffer`. Drive-by changes: - In `<syncstream>`, states that `get_temporary_buffer` is now removed, because `<syncstream>` is added in C++20.
2024-09-12[libc++][NFC] Use [[__nodiscard__]] unconditionally (#80454)Nikolas Klauser
`__has_cpp_attribute(__nodiscard__)` is always true now, so we might as well replace `_LIBCPP_NODISCARD`. It's one less macro that can result in bad diagnostics.
2024-04-22[libc++] Remove _LIBCPP_DISABLE_NODISCARD_EXTENSIONS and refactor the tests ↵Nikolas Klauser
(#87094) This also adds a few tests that were missing.
2024-02-02[libc++][NFC] Remove <__type_traits/alignment_of.h> includeNikolas Klauser
2023-12-18[libc++] Format the code base (#74334)Louis Dionne
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
2023-12-05[libc++] Replace uses of _VSTD:: by std:: (#74331)Louis Dionne
As part of the upcoming clang-formatting of libc++, this patch performs the long desired removal of the _VSTD macro. See https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all for the clang-format proposal.
2023-12-04[libc++] Rename _LIBCPP_INLINE_VISIBILITY to _LIBCPP_HIDE_FROM_ABI (#74095)Louis Dionne
In preparation for running clang-format on the whole code base, we are also removing mentions of the legacy _LIBCPP_INLINE_VISIBILITY macro in favor of the newer _LIBCPP_HIDE_FROM_ABI. We're still leaving the definition of _LIBCPP_INLINE_VISIBILITY to avoid creating needless breakage in case some older patches are checked-in with mentions of the old macro. After we branch for LLVM 18, we can do another pass to clean up remaining uses of the macro that might have gotten introduced by mistake (if any) and remove the macro itself at the same time. This is just a minor convenience to smooth out the transition as much as possible. See https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all for the clang-format proposal.
2023-10-31[libc++] Remove alignment_of uses (#70591)philnik777
There is no reason to use `alignment_of<T>` instead of `alignof(T)` or `_LIBCPP_ALIGNOF(T)`. It only makes the code more verbose and results in slightly worse compile times.
2023-06-30[libc++] Revert __uninitialized_buffer changesLouis Dionne
This patch reverts the following commits: 015cd317eaed28a923d14a33c9d6739012a688be (add missing HIDE_FROM_ABI) 420a204d52205f1277a8d5df3dbafac6082e02e2 (add _LIBCPP_NO_CFI) 31eeba3f7c0e2ef4a21c07da9326a4ae1a8de7e2 (add __uninitialized_buffer) It also reverts a small part of b935ab8e747cf52ff12471879460206a9f433eea which is required to make the stable_partition.pass.cpp test pass on GCC. Some issues were pointed out in https://reviews.llvm.org/D152208 and in https://reviews.llvm.org/D154017, so I am reverting this patch until we have time to weigh the various solutions and get consensus on the design of the API. Differential Revision: https://reviews.llvm.org/D154161
2023-06-16[libc++] Introduce __make_uninitialized_buffer and use it instead of ↵Nikolas Klauser
get_temporary_buffer This will also be used in some PSTL backends. Reviewed By: ldionne, #libc, Mordante Spies: arichardson, mstorsjo, Mordante, sstefan1, jplehr, libcxx-commits Differential Revision: https://reviews.llvm.org/D152208
2022-08-17Revert "[libcxx] Resolve warnings for Wshift-sign-overflow"Dominic Chen
This reverts commit 774c39313e83e8087776246c186593ea0c751fd5.
2022-08-17[libcxx] Resolve warnings for Wshift-sign-overflowDominic Chen
These warning were identified while debugging modules with Wsystem-headers. Differential Revision: https://reviews.llvm.org/D131999
2022-08-13[libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABINikolas Klauser
Reviewed By: ldionne, Mordante, var-const, huixie90, #libc Spies: jloser, libcxx-commits, arichardson, miyuki Differential Revision: https://reviews.llvm.org/D129968
2022-07-24[libc++] Granularize some more type_traitsNikolas Klauser
Reviewed By: ldionne, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D128948
2022-06-21[libc++] Implement P0174R2 (Deprecating Vestigial Library Parts in C++17)Nikolas Klauser
Reviewed By: ldionne, Mordante, #libc Spies: jwakely, libcxx-commits Differential Revision: https://reviews.llvm.org/D127387
2022-03-01[libc++] Revert "Protect users from relying on detail headers" & related changesLouis Dionne
This commit reverts 5aaefa51 (and also partly 7f285f48e77 and b6d75682f9, which were related to the original commit). As landed, 5aaefa51 had unintended consequences on some downstream bots and didn't have proper coverage upstream due to a few subtle things. Implementing this is something we should do in libc++, however we'll first need to address a few issues listed in https://reviews.llvm.org/D106124#3349710. Differential Revision: https://reviews.llvm.org/D120683
2022-02-26[libcxx][modules] protects users from relying on detail headersChristopher Di Bella
libc++ has started splicing standard library headers into much more fine-grained content for maintainability. It's very likely that outdated and naive tooling (some of which is outside of LLVM's scope) will suggest users include things such as <__ranges/access.h> instead of <ranges>, and Hyrum's law suggests that users will eventually begin to rely on this without the help of tooling. As such, this commit intends to protect users from themselves, by making it a hard error for anyone outside of the standard library to include libc++ detail headers. Differential Revision: https://reviews.llvm.org/D106124
2022-02-04[libc++] Replace includes of <utility> with specific detail headersArthur O'Dwyer
Basically a rebase of D104980; most of that patch had already happened via gradual drive-by changes, but this finishes it up. Don't touch the inclusions from `<__functional_base>`, `<__hash_table>`, or `<__locale>`; those could be removed if we propagated the inclusions up to the includers of those files, but there are lots of those includers. `<algorithm>`, `<functional>`, and `<memory>` already include `<utility>` at the top level. `<iterator>` did not, so I've added it there. Differential Revision: https://reviews.llvm.org/D119020
2022-02-04[libc++] Normalize all our '#pragma GCC system_header', and regression-test.Arthur O'Dwyer
Now we'll notice if a header forgets to include this magic phrase. Differential Revision: https://reviews.llvm.org/D118800
2021-08-27[libc++][NFC] Remove useless _LIBCPP_PUSH_MACROSLouis Dionne
Only files that actually use min/max are required to do this dance. Differential Revision: https://reviews.llvm.org/D108778
2021-06-19[libcxx] Move all algorithms into their own headersLouis Dionne
This is a fairly mechanical change, it just moves each algorithm into its own header. This is intended to be a NFC. This commit re-applies 7ed7d4ccb899, which was reverted in 692d7166f771 because the Modules build got broken. The modules build has now been fixed, so we're re-committing this. Differential Revision: https://reviews.llvm.org/D103583 Attribution note ---------------- I'm only committing this. This commit is a mix of D103583, D103330 and D104171 authored by: Co-authored-by: Christopher Di Bella <cjdb@google.com> Co-authored-by: zoecarver <z.zoelec2@gmail.com>
2021-06-07Revert "[libcxx][gardening] Move all algorithms into their own headers."Petr Hosek
This reverts commit 7ed7d4ccb8991e2b5b95334b508f8cec2faee737 as it uncovered a Clang bug PR50592.
2021-06-04[libcxx][gardening] Move all algorithms into their own headers.zoecarver
This is a fairly mechanical change, it just moves each algorithm into its own header. This is a NFC. Note: during this change, I burned down all the includes, so this follows "include only and exactly what you use." Differential Revision: https://reviews.llvm.org/D103583
2021-04-20[libc++] NFC: Normalize `#endif //` comment indentationLouis Dionne
2021-04-12[libc++] Split std::get_temporary_buffer out of <memory>Louis Dionne
Differential Revision: https://reviews.llvm.org/D100216