aboutsummaryrefslogtreecommitdiff
path: root/libcxx
AgeCommit message (Collapse)AuthorFilesLines
2022-12-15[libc++] Implement P1169R4 (static operator())Nikolas Klauser12-41/+241
Reviewed By: ldionne, huixie90, #libc Spies: EricWF, libcxx-commits, royjacobson Differential Revision: https://reviews.llvm.org/D135016
2022-12-14[NFC][libc++][format] Uses qualified calls.Mark de Wever4-38/+30
Changes all unqualified calls to __throw_format_error to use a qualified call. Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D140038
2022-12-14[libc++] Refactor .compile.fail.cpp tests for std::functionLouis Dionne3-37/+15
Some of those .compile.fail.cpp tests had become incorrect and they were not testing anything. In general, .compile.fail.cpp tests are bad because they make it way too easy to write garbage tests. Indeed, the test could fail to compile due to any reason whatsoever (even a typo) and it would appear to work correctly. Differential Revision: https://reviews.llvm.org/D138731
2022-12-14[libc++] Implement `std::expected` P0323R12Hui Xie125-423/+10419
Implement `std::expected` https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html Added tests Differential Revision: https://reviews.llvm.org/D124516 address comment
2022-12-10[libc++][doc] Fixes a formating issue.Mark de Wever1-1/+1
2022-12-09[libc++][ranges][NFC] Update Ranges status.Konstantin Varlamov1-4/+2
Add a link to an in-progress patch.
2022-12-09[libc++][Android] Disable pbump2gig for AndroidRyan Prichard1-0/+5
Android devices frequently don't have enough memory to run this test. e.g. On the API 33 x86-64 emulator with 2GiB RAM, the test triggers the OOM Killer, the device reboots, and then `adb shell` exits with status 0 and no output. Reviewed By: danalbert, #libc, Mordante Differential Revision: https://reviews.llvm.org/D139502
2022-12-09[libc++][Android] Android/Bionic headers don't work with modules yetRyan Prichard1-0/+3
The current Android headers don't appear to work with modules. We may want to fix them eventually. Reviewed By: #libc, Mordante Differential Revision: https://reviews.llvm.org/D139498
2022-12-09[libc++] Refactor char_traitsNikolas Klauser5-145/+182
This allows us to reuse workarounds for compilers that don't provide the builtins or constexpr support. Reviewed By: ldionne, Mordante, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D139555
2022-12-08[libc++][math.h] Add double overloadsNikolas Klauser1-0/+337
This allows libc++ to work with libcs that don't provide a proper math.h implementation. Reviewed By: ldionne, #libc Spies: aaron.ballman, fhahn, bcain, Izaron, libcxx-commits Differential Revision: https://reviews.llvm.org/D138629
2022-12-08[libc++] Move filter_view::iterator and sentinel out of filter_viewNikolas Klauser1-18/+35
Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D139273
2022-12-08[libc++][NFC] Rename __libcpp_*_or_builtin to __constexpr_*Nikolas Klauser3-87/+87
We normally use the `__libcpp_` prefix to backport functions, but that doesn't really make sense here. The functions are always available. Using `__constexpr_` makes the intended use of the functions clear. Reviewed By: Mordante, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D139521
2022-12-07[libc++] Implement P0339R6 (polymorphic_allocator<> as a vocabulary type)Nikolas Klauser25-53/+397
Reviewed By: ldionne, #libc Spies: LRFLEW, libcxx-commits, arichardson, krytarowski, jdoerfert Differential Revision: https://reviews.llvm.org/D137739
2022-12-07[libc++][format] Adds range-default-formatter.Mark de Wever20-1/+527
This adds an incomplete version where the specializations for the format_kinds are disabled dummy formatters. Implements part of - P2585R0 Improving default container formatting Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D137271
2022-12-06[libc++][Android] Rename user NS to User to avoid conflict with structRyan Prichard4-12/+12
Bionic's sys/user.h declares a "struct user". The header tends to be included, and when it is, it conflicts with "namespace user". Rename user to User. Differential Revision: https://reviews.llvm.org/D139380
2022-12-06[libc++][CI] Upgrades clang-format version used.Mark de Wever2-2/+8
The version used is now determined by Buildkite instead of using the hard-coded version in the Docker image. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D139341
2022-12-06[libc++] Fix memory leaks when throwing inside std::vector constructorsNikolas Klauser3-20/+437
Fixes #58392 Reviewed By: ldionne, #libc Spies: alexfh, hans, joanahalili, dblaikie, libcxx-commits Differential Revision: https://reviews.llvm.org/D138601
2022-12-05Revert "[CMake] Use LLVM_TARGET_TRIPLE in runtimes"Leonard Chan4-7/+7
This reverts commit bec8a372fc0db95852748691c0f4933044026b25. This causes many of these errors to appear when rebuilding runtimes part of fuchsia's toolchain: ld.lld: error: /usr/local/google/home/paulkirth/llvm-upstream/build/lib/x86_64-unknown-linux-gnu/libunwind.a(libunwind.cpp.o) is incompatible with elf64-x86-64 This can be reproduced by making a complete toolchain, saving any source file with no changes, then rerunning ninja distribution.
2022-12-02[libc++][NFC] Fix typo in commentLouis Dionne1-1/+1
2022-12-01[libc++][NFC] Avoid most-vexing parseLouis Dionne1-2/+2
2022-12-01[libc++] Fix 64-bit file creation for Bionic and WindowsRyan Prichard1-19/+38
Bionic didn't add fopen64 until API 24, but there's no meaningful distinction between them with Bionic, so just use fopen instead. On Windows, use _chsize_s instead of _chsize. _chsize uses a 32-bit `long` size argument, while _chsize_s uses __int64 instead. Factor out utils::{off64_t, fopen64, ftruncate64} for use within the create_file function. Reviewed By: ldionne, #libc, mstorsjo Differential Revision: https://reviews.llvm.org/D137132
2022-11-30[libc++][math.h] move #undefs to the top and guard explicitly against MSVCRT ↵Nikolas Klauser1-55/+51
instead Reviewed By: ldionne, #libc Spies: #libc_vendors, EricWF, libcxx-commits Differential Revision: https://reviews.llvm.org/D137502
2022-11-30[libc++][math.h] Use builtins for all the functionsNikolas Klauser1-130/+130
This allows compiling libc++, even when the C library doesn't support floating point math. Reviewed By: ldionne, #libc Spies: daltenty, xingxue, libcxx-commits, michaelplatings Differential Revision: https://reviews.llvm.org/D136393
2022-11-30[libc++] Install llvm-dev in the docker imageNikolas Klauser1-0/+3
This is required to compile custom clang-tidy checks Reviewed By: Mordante, #libc Spies: libcxx-commits, arichardson Differential Revision: https://reviews.llvm.org/D138728
2022-11-29[libc++][ranges][NFC] Revamp the Ranges status pagevarconst10-396/+149
Focus on the not-yet-implemented features: remove most details about the already-implemented C++20 stuff, list out the major C++23 additions. Differential Revision: https://reviews.llvm.org/D136657
2022-11-29[libc++] Add a missing include to `swap_allocator.h`.Konstantin Varlamov1-0/+82
Also add tests for the file. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D135635
2022-11-29[lbc++] Implement the rest of P0600R1 (nodiscard in the library)Nikolas Klauser12-10/+61
Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D137597
2022-11-29[libc++] Don't pass the allocator in substr()Nikolas Klauser2-4/+30
This bug was dicoved when implementing P2438R2. Fixes #57190 Reviewed By: ldionne, Mordante, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D138069
2022-11-29[CMake] Use LLVM_TARGET_TRIPLE in runtimesPetr Hosek4-7/+7
This variable is derived from LLVM_DEFAULT_TARGET_TRIPLE by default, but using a separate variable allows additional normalization to be performed if needed. Differential Revision: https://reviews.llvm.org/D137451
2022-11-28[libc++] Fix incorrect guard against the presence of wide charactersLouis Dionne1-2/+2
TEST_HAS_NO_WIDE_CHARACTERS should only be used in the tests. Differential Revision: https://reviews.llvm.org/D138828
2022-11-28[libc++] Remove CMake workaround for the discontinued Projects buildLouis Dionne1-6/+0
Differential Revision: https://reviews.llvm.org/D138801
2022-11-28[libc++][NFC] Add assertions before calling memmoveLouis Dionne2-2/+4
Since we're checking preconditions for calling memmove, we might as well do that properly. Differential Revision: https://reviews.llvm.org/D138798
2022-11-28[libc++][NFC] Rename include guards under /support/Louis Dionne13-37/+37
For consistency with the rest of the code base.
2022-11-28[libc++][NFC] Remove stray whitespace in string_viewLouis Dionne1-15/+15
2022-11-28[libc++][NFC] Use using declaration instead of typedef in string_viewLouis Dionne1-12/+12
2022-11-25[libc++][NFC] Add missing include to ext/__hashLouis Dionne1-0/+1
Note that we use <stddef.h> instead of <cstddef> because we're using size_t (not std::size_t) and we're outside of namespace std. Differential Revision: https://reviews.llvm.org/D138716
2022-11-25[libc++][NFC] Remove unused includes from poll_with_backoff.hLouis Dionne2-3/+1
Differential Revision: https://reviews.llvm.org/D138687
2022-11-25[libc++][NFC] Consistently use newline between license and include guardLouis Dionne67-0/+67
2022-11-25[libc++] Bump AppleClang compiler requirementLouis Dionne19-38/+4
Per our policy, the latest released AppleClang has been 14 for a while, so libc++ is removing support for AppleClang 13. Our CI bots have been moved to AppleClang 14 a few weeks ago. Differential Revision: https://reviews.llvm.org/D138685
2022-11-25[libc++] Use builtins when redeclaring <string.h> functionsLouis Dionne3-99/+262
When we define the const-correct overloads of <string.h> functions in libc++ itself, use builtins whenever possible. This avoids depending on the presence of these functions in the C library headers. Also, as a fly-by, improve the tests for these functions since we basically didn't check anything but their signature. We could have used the wrong builtin (as long as the signature matched) without ever noticing, which was quite scary. Differential Revision: https://reviews.llvm.org/D138684
2022-11-24[libc++][AIX] Add AIX buildbot ownersDavid Tenty1-0/+4
This adds the AIX (i.e. Power) buildbot owners in the format established by https://reviews.llvm.org/D138445 Reviewed By: ldionne Differential Revision: https://reviews.llvm.org/D138580
2022-11-24[libc++] Keep char_traits<T> for arbitrary T around until LLVM 18Louis Dionne8-220/+169
This is in response to failures seen after landing D138307. Differential Revision: https://reviews.llvm.org/D138596
2022-11-24[libc++] Remove P1908 from the status pageNikolas Klauser1-1/+0
The paper doesn't include anything affecting the library. AFAICT there isn't even anything to do for the compiler, since it just reserved the std attribute namespace. Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D138128
2022-11-24[libc++][clang-tidy] Enable readability-simplify-boolean-exprNikolas Klauser6-11/+11
Reviewed By: ldionne, #libc Spies: Eugene.Zelenko, aheejin, libcxx-commits, xazax.hun Differential Revision: https://reviews.llvm.org/D137804
2022-11-23[libc++][NFC] Fix documentation buildLouis Dionne1-1/+1
2022-11-23[libc++] Remove default definition of std::char_traitsLouis Dionne6-136/+459
This patch removes the base template implementation for std::char_traits. If my reading of http://eel.is/c++draft/char.traits is correct, the Standard mandates that the library provides specializations for several types like char and wchar_t, but not any implementation in the base template. Indeed, such an implementation is bound to be incorrect for most types anyways, since things like `eof()` and `int_type` will definitely have to be customized. Since the base template implementation should not have worked for anyone, this shouldn't be a breaking change (I expect that anyone defining a custom character type today will already have to provide their own specialization of char_traits). However, since we're aware of some users of char_traits for unsigned char and signed char, we're keeping those two specializations around for two releases to give people some time to migrate. Differential Revision: https://reviews.llvm.org/D138307
2022-11-23[libc++] Add missing __has_include checks for C headers not provided by libc++Louis Dionne4-4/+29
This makes the library consistent in how it handles C library headers. For C headers provided by libc++, we unconditionally include <foo.h> from <cfoo>, and then <foo.h> conditionally include_next <foo.h>. For headers not provided by libc++, <cfoo> conditionally includes the system's <foo.h> directly. Differential Revision: https://reviews.llvm.org/D138512
2022-11-23[libc++][NFC] Use if-else chain instead of match, which is a Python 3.10 ↵Louis Dionne1-23/+22
construct
2022-11-23[libc++] Fix __regex_word value when using newlib/picolibcAlex Richardson3-3/+15
The ctype mask for newlib/picolibc is fully saturated, so __regex_word has to overlap with one of the values. This commit uses the same workaround as bionic did (uint16_t for char_class_type inside regex_traits). It should be possible to have libc++ provide the default rune table instead, but that will require a new mechanism to detect newlib inside __config since the header defining the newlib/picolibc macros has not been included yet inside __config. Doing it this way also avoids duplicating the ctype table for newlib, reducing the global data size. Differential Revision: https://reviews.llvm.org/D138195
2022-11-22[libcxx] Add _LIBCPP_NODEBUG to std::conditional related typedfsDavid Blaikie1-4/+9
Looks like std::conditional wasn't included in 14d4869209cc8ff9a53aaa5a59d6409fbc1c5f5d (& maybe other typedefs that should be using this technique either got missed or have regressed since that change was made) This was noticed by a 1.4% clang.dwp regression due to f4fb72e6d4cee1097e6606e66232fe55e793cd86 introducing more instantiations of std::conditional - this change reduces that regression to 0.6% at least. I'm also looking at other instantiations caused by that change that might be able to be addressed - but a quick grep shows ~200 "type" typedefs missing _LIBCPP_NODEBUG, so maybe a systematic application of the typedef might be suitable? Differential Revision: https://reviews.llvm.org/D131082