aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx
Commit message (Collapse)AuthorAgeFilesLines
* libc++: fix compiling <locale> with -fmodulesJordan Gordeev2025-05-181-1/+7
| | | | | | | | | | | | | | | | | In /usr/include/c++/v1/__locale_dir/locale_base_api.h, xlocale.h is included without first including stdio.h and stdlib.h, which causes functions like strtoll_l() or sscanf_l() to not be declared. When compiling with -fmodules, locale_base_api.h is processed separately due to a declaration in /usr/include/c++/v1/module.modulemap, and this will cause errors due to the above undeclared symbols. Meanwhile, upstream has substantially reorganized this part of libc++'s headers, so apply a minimalistic workaround: specifically when compiling with -fmodules, add includes of stdio.h and stdlib.h. PR: 286342 MFC after: 1 week
* Merge llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2Dimitry Andric2025-01-161-1/+1
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.7-0-gcd708029e0b2, a.k.a. 19.1.7 release. PR: 280562 MFC after: 3 days
* Merge llvm-project release/19.x llvmorg-19.1.5-0-gab4b5a2db582Dimitry Andric2024-12-061-1/+1
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.5-0-gab4b5a2db582, a.k.a. 19.1.5 release. PR: 280562 MFC after: 3 days
* Merge llvm-project release/19.x llvmorg-19.1.4-0-gaadaa00de76eDimitry Andric2024-11-211-1/+1
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.4-0-gaadaa00de76e, a.k.a. 19.1.4 release. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5Dimitry Andric2024-11-081-1/+1
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5, a.k.a. 19.1.3 release. PR: 280562 MFC after: 1 month
* Fix buildworld with gcc 12 after llvm-19 importDimitry Andric2024-10-251-0/+2
| | | | | | | | | | | | | | | | | | | | | Unfortunately gcc 12's is not yet capable of compiling all of libc++ 19's C++23 code, which results in errors similar to: /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:41:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Iter, _Sent, const _Type&, _Proj)' must be a non-static member function 41 | operator()(_Iter __first, _Sent __last, const _Type& __value, _Proj __proj = {}) { | ^~~~~~~~ /usr/src/freebsd/src/contrib/llvm-project/libcxx/include/__algorithm/ranges_contains.h:48:3: error: 'static constexpr bool std::__1::ranges::__contains::__fn::operator()(_Range&&, const _Type&, _Proj)' must be a non-static member function 48 | operator()(_Range&& __range, const _Type& __value, _Proj __proj = {}) { | ^~~~~~~~ Until we can get rid of gcc 12, work around this by making it compile libc++ in C++20 mode instead. NOTE: The resulting libc++ library will not be C++23 compatible! Please try to avoid shipping it, and use gcc 13 instead, if you must use gcc. PR: 280562 MFC after: 3 days
* Merge llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6Dimitry Andric2024-10-232-3/+6
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.2-0-g7ba7d8e2f7b6, a.k.a. 19.1.2 release. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.1-0-gd401987fe349Dimitry Andric2024-10-232-2/+3
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.1-0-gd401987fe349, a.k.a. 19.1.1 release. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1Dimitry Andric2024-10-231-1/+1
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1, a.k.a. 19.1.0 release. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.0-rc4-0-g0c641568515aDimitry Andric2024-10-232-6/+7
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.0-rc4-0-g0c641568515a. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.0-rc3-0-g437434df21d8Dimitry Andric2024-10-237-75/+66
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.0-rc3-0-g437434df21d8. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1cDimitry Andric2024-10-234-16/+35
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1c. PR: 280562 MFC after: 1 month
* libcxx-compat: revert llvmorg-19-init-4003-g55357160d0e1:Dimitry Andric2024-10-232-13/+13
| | | | | | | | | | | [libc++] Use GCC type traits builtins for remove_cv and remove_cvref (#81386) They have been added recently to GCC without support for mangling. This patch uses them in structs and adds aliases to these structs instead of the builtins directly. PR: 280562 MFC after: 1 month
* libcxx-compat: revert llvmorg-19-init-4504-g937a5396cf3e:Dimitry Andric2024-10-231-0/+6
| | | | | | | [libc++] Remove unused includes from __type_traits/is_convertible.h (#83747) PR: 280562 MFC after: 1 month
* libcxx-compat: revert llvmorg-19-init-5639-ga10aa4485e83:Dimitry Andric2024-10-233-15/+7
| | | | | | | | | | [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. PR: 280562 MFC after: 1 month
* libcxx-compat: revert llvmorg-19-init-8667-g472b612ccbed:Dimitry Andric2024-10-232-1/+2
| | | | | | | [libc++][NFC] Remove unused includes from <__type_traits/remove_cv.h> (#88752) PR: 280562 MFC after: 1 month
* libcxx-compat: revert llvmorg-19-init-17473-g69fecaa1a455:Dimitry Andric2024-10-2310-31/+266
| | | | | | | [libc++] Clean up some now dead code with the upgrade to GCC 14 (#97746) PR: 280562 MFC after: 1 month
* libcxx-compat: revert llvmorg-19-init-17727-g0eebb48fcfbc:Dimitry Andric2024-10-236-13/+68
| | | | | | | | | | [libc++] Merge is_member{,_object,_function}_pointer.h (#98727) The implementations for these traits have been simplified quite a bit, since we have builtins available for them now. PR: 280562 MFC after: 1 month
* libcxx-compat: revert llvmorg-19-init-17728-g30cc12cd818d:Dimitry Andric2024-10-233-5/+11
| | | | | | | [libc++] Simplify the implementation of is_null_pointer a bit (#98728) PR: 280562 MFC after: 1 month
* libcxx-compat: revert llvmorg-19-init-17853-g578c6191eff7:Dimitry Andric2024-10-231-2/+18
| | | | | | | [libc++] Simplify std::is_void (#99033) PR: 280562 MFC after: 1 month
* libcxx-compat: revert llvmorg-19-init-18062-g4dfa75c663e5:Dimitry Andric2024-10-234-10/+38
| | | | | | | [libc++] Merge is_scoped_enum.h into is_enum.h (#99458) PR: 280562 MFC after: 1 month
* libcxx-compat: revert llvmorg-19-init-18063-g561246e90282:Dimitry Andric2024-10-231-1/+1
| | | | | | | [libc++][NFC] Remove wrong #endif comment PR: 280562 MFC after: 1 month
* libcxx cstdlib, cwchar: avoid using long long functions if notDimitry Andric2024-10-232-0/+16
| | | | | | | | supported, even for older compilers that do not support the using_if_exists attribute. PR: 280562 MFC after: 1 month
* libcxx atomic_ref.h: add typename keyword for difference_typeDimitry Andric2024-10-231-2/+2
| | | | | | | declarations, otherwise older clang versions cannot compile this header. PR: 280562 MFC after: 1 month
* libcxx simd_utils.h: only enable _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS forDimitry Andric2024-10-231-1/+1
| | | | | | | clang >= 15, since older versions do not support the required builtins. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2Dimitry Andric2024-10-239-30/+197
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2. PR: 280562 MFC after: 1 month
* Merge llvm-project main llvmorg-19-init-18630-gf2ccf80136a0Dimitry Andric2024-10-23705-17363/+22179
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-19-init-18630-gf2ccf80136a0, the last commit before the upstream release/19.x branch was created. PR: 280562 MFC after: 1 month
* Merge commit cb7a03b41fff from llvm git (by Nikolas Klauser):John Baldwin2024-08-053-1/+9
| | | | | | | | | [libc++] Fix failures with GCC 14 (#92663) Fixes #91831 Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D46003
* Merge commit 382f70a877f0 from llvm-project (by Louis Dionne):Dimitry Andric2024-06-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [libc++][NFC] Rewrite function call on two lines for clarity (#79141) Previously, there was a ternary conditional with a less-than comparison appearing inside a template argument, which was really confusing because of the <...> of the function template. This patch rewrites the same statement on two lines for clarity. Merge commit d129ea8d2fa3 from llvm-project (by Vitaly Buka): [libcxx] Align `__recommend() + 1` by __endian_factor (#90292) This is detected by asan after #83774 Allocation size will be divided by `__endian_factor` before storing. If it's not aligned, we will not be able to recover allocation size to pass into `__alloc_traits::deallocate`. we have code like this ``` auto __allocation = std::__allocate_at_least(__alloc(), __recommend(__sz) + 1); __p = __allocation.ptr; __set_long_cap(__allocation.count); void __set_long_cap(size_type __s) _NOEXCEPT { __r_.first().__l.__cap_ = __s / __endian_factor; __r_.first().__l.__is_long_ = true; } size_type __get_long_cap() const _NOEXCEPT { return __r_.first().__l.__cap_ * __endian_factor; } inline ~basic_string() { __annotate_delete(); if (__is_long()) __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap()); } ``` 1. __recommend() -> even size 2. `std::__allocate_at_least(__alloc(), __recommend(__sz) + 1)` - > not even size 3. ` __set_long_cap() `- > lose one bit of size for __endian_factor == 2 (see `/ __endian_factor`) 4. `__alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap())` -> uses even size (see `__get_long_cap`) This should fix incorrect deallocation sizes for some instances of std::string. Memory profiling or debugging tools like AddressSanitizer, LeakSanitizer or TCMalloc could then complain about the the size passed to a deallocation not matching the size originally passed to the allocation. Reported by: Aliaksei Kandratsenka <alkondratenko@gmail.com> PR: 279560 MFC after: 3 days
* Merge llvm-project release/18.x llvmorg-18.1.6-0-g1118c2e05e67Dimitry Andric2024-05-242-3/+17
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.6-0-g1118c2e05e67. PR: 276104 MFC after: 3 days
* Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9Dimitry Andric2024-05-041-1/+1
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9. PR: 276104 MFC after: 3 days
* Merge llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6Dimitry Andric2024-04-202-20/+11
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6. PR: 276104 MFC after: 3 days
* Revert commit 925a11a5f221 from llvm-project (by Nikolas Klauser):Dimitry Andric2024-04-131-1/+78
| | | | | | | | | | | | | | | | | [libc++] Simplify is_convertible GCC 13 has added __is_convertible(), so we don't need to keep the fallback implementation around. Reviewed By: #libc, Mordante Spies: Mordante, libcxx-commits Differential Revision: https://reviews.llvm.org/D157939 This should allow buildworld with gcc 12 to work again. PR: 276104 MFC after: 1 month
* Merge llvm-project release/18.x llvmorg-18.1.3-0-gc13b7485b879Dimitry Andric2024-04-062-5/+4
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.3-0-gc13b7485b879. PR: 276104 MFC after: 1 month
* Revert commit 6255157d24e2 from llvm-project (by Dimitry Andric):Dimitry Andric2024-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [libc++] Re-enable std::pair trivial copy constructor for FreeBSD >= 14 After many years of using the really old std::pair ABI which did not yet have a trivial copy constructor, FreeBSD 14 and later will finally get rid of it. Only use the old ABI for FreeBSD 13 and earlier. Note: on the FreeBSD side, we will bump our libc++.so version for this, and keep an old compatibility library in a separate package. Differential Revision: https://reviews.llvm.org/D126462 This ABI change can cause crashes when binaries compiled against older libc++ versions are run against binaries compiled against this libc++ version. For example, lang/ldc uses a precompiled bootstrap ldc2 binary that was compiled against the old libc++, but also links against libLLVM-15.so. If libLLVM-15.so is compiled against the new libc++ version, the ABI mismatch results in segfaults or even stack overflows. Note: we can only re-enable the std::pair trivial copy constructors again when the official libc++ ABI version is bumped to 2. PR: 276104 MFC after: 1 month
* Merge llvm-project release/18.x llvmorg-18.1.1-0-gdba2a75e9c7eDimitry Andric2024-04-061-1/+7
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.1-0-gdba2a75e9c7e. PR: 276104 MFC after: 1 month
* Merge llvm-project release/18.x llvmorg-18.1.0-rc2-53-gc7b0a6ecd442Dimitry Andric2024-04-064-17/+114
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-53-gc7b0a6ecd442. PR: 276104 MFC after: 1 month
* Merge llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967Dimitry Andric2024-04-06190-18/+937
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967. PR: 276104 MFC after: 1 month
* [libc++] Rename __bit_reference template parameter to avoid conflictDimitry Andric2024-04-061-5/+5
| | | | | | | | | | | | | | | | | As of 4d20cfcf4eb08217ed37c4d4c38dc395d7a66d26, `__bit_reference` contains a template `__fill_n` with a bool `_FillValue` parameter. Unfortunately there is a relatively widely used piece of scientific software called NetCDF, which exposes a (C) macro `_FillValue` in its public headers. When building the NetCDF C++ bindings, this quickly leads to compilation errors when the macro interferes with the template in `__bit_reference`. Rename the parameter to `_FillVal` to avoid the conflict. PR: 276104 MFC after: 1 month
* Merge llvm-project release/18.x llvmorg-18-init-18361-g22683463740eDimitry Andric2024-04-061-1/+1
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18-init-18361-g22683463740e. PR: 276104 MFC after: 1 month
* Merge llvm-project main llvmorg-18-init-18359-g93248729cfaeDimitry Andric2024-04-0684-836/+2560
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-18359-g93248729cfae, the last commit before the upstream release/18.x branch was created. PR: 276104 MFC after: 1 month
* Redo libc++ customizationsDimitry Andric2024-04-063-9/+5
| | | | | | | | | | * Remove osreldate include because _LIBCPP_HAS_NO_GETS has disappeared * Instead, add direct major __FreeBSD__ check for using ::gets declaration * Mark EINTEGRITY values as FreeBSD customization * Reformat _LIBCPP_TYPE_VISIBILITY_DEFAULT customization PR: 276104 MFC after: 1 month
* Merge llvm-project main llvmorg-18-init-16864-g3b3ee1f53424Dimitry Andric2024-04-065-9/+7
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-16864-g3b3ee1f53424. PR: 276104 MFC after: 1 month
* Merge llvm-project main llvmorg-18-init-16595-g7c00a5be5cdeDimitry Andric2024-04-0649-176/+315
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-16595-g7c00a5be5cde. PR: 276104 MFC after: 1 month
* Add two FreeBSD customizations to libc++Dimitry Andric2024-04-061-1/+4
| | | | | | | | | | | | This is intended to better support ports usage of older clang versions: * Add _LIBCPP_ENABLE_COMPILER_VERSION_CHECKS block around compiler version checks, to avoid any warnings about support. This makes some ports that use -Werror fall over. * When using clang < 15.0, avoid using a type visibility attribute on the std namespace, as older versions of clang do not support this. PR: 276104 MFC after: 1 month
* Tentatively merge https://github.com/llvm/llvm-project/pull/77242Dimitry Andric2024-04-061-0/+4
| | | | | | | | | | | | | | | | | | | | | [libcxx] Re-include <osreldate.h> in __config for FreeBSD In 0a97720d0197 some changes were made to `__config` for assuming that `__BYTE_ORDER__` is always present. However, this deleted a `<osreldate.h>` include for FreeBSD, which is required to get the value of `__FreeBSD_version`, and that is used later in the file to determine whether `_LIBCPP_C_HAS_NO_GETS` needs to be enabled. Include `<osreldate.h>` just after the other includes used for feature detection, to fix this. Note that when FreeBSD 13 is EOLed, this can be removed, as then all supported FreeBSD versions will no longer have `gets()`. PR: 276104 MFC after: 1 month
* Merge llvm-project main llvmorg-18-init-16003-gfc5f51cf5af4Dimitry Andric2024-04-0613-28/+83
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-16003-gfc5f51cf5af4. PR: 276104 MFC after: 1 month
* Merge llvm-project main llvmorg-18-init-15692-g007ed0dccd6aDimitry Andric2024-04-06554-84416/+67558
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-15692-g007ed0dccd6a. PR: 276104 MFC after: 1 month
* Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fbDimitry Andric2024-04-06733-32527/+21490
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-15088-gd14ee76181fb. PR: 276104 MFC after: 1 month
* Merge commit 4a39d0890894 from llvm-project (by Mark Johnston):Dimitry Andric2024-01-291-2/+3
| | | | | | | | | | | | | | | [libc++] Fix filesystem::remove_all() on FreeBSD (#79540) remove_all_impl() opens the target path with O_NOFOLLOW, which fails if the target is a symbolic link. On FreeBSD, rather than returning ELOOP, openat() returns EMLINK. This is unlikely to change for compatibility reasons, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214633 . Thus, check for EMLINK as well. Reported by: markj PR: 276632 MFC after: 3 days