aboutsummaryrefslogtreecommitdiff
path: root/libcxx
AgeCommit message (Collapse)AuthorFilesLines
2022-09-20[libc++][test] Adds format string helper.Mark de Wever3-58/+110
Update the formatter day tests to the new style. Other test will be done separately. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D134031
2022-09-20[libc++][chrono] Removes format include.Mark de Wever3-3/+1
Switch to the new granular format_functions header. Since the chrono's format dependency in C++20 hasn't been in a release it's save to remove it. Depends on D133665 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D133796
2022-09-20[libc++][format] Granularizes the format header.Mark de Wever5-627/+676
Moves the last pieces of code to its own header. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D133665
2022-09-20[llvm] Remove libcxx, libcxxabi and libunwind from supported ↵Louis Dionne3-32/+2
LLVM_ENABLE_PROJECTS This is a breaking change. If you were passing one of those three runtimes in LLVM_ENABLE_PROJECTS, you need to start passing them in LLVM_ENABLE_RUNTIMES instead. The runtimes in LLVM_ENABLE_RUNTIMES will start being built using the "bootstrapping build" instead, which means that they will be built using the just-built Clang. This is usually what you wanted anyway. If you were using LLVM_ENABLE_PROJECTS=all with the explicit goal of building these three runtimes, you can now use LLVM_ENABLE_RUNTIMES=all and these runtimes will be built using the bootstrapping build. Differential Revision: https://reviews.llvm.org/D132480
2022-09-20[libc++] Remove MSVC codeNikolas Klauser8-210/+2
It's been one and a half months now and nobody said anything, so I guess this code can be removed. Reviewed By: ldionne, #libc Spies: Mordante, libcxx-commits, mgorny, mstorsjo Differential Revision: https://reviews.llvm.org/D132943
2022-09-20[libc++][NFC] Refactor enable_ifs in vectorNikolas Klauser1-145/+89
Using the `enable_if_t<..., int> = 0` style has the benefit that it works in all cases and makes function declarations easier to read because the function arguments and return type and SFINAE are separated. Unifying the style also makes it easier for people not super familiar with SFINAE to make sense of the code. Reviewed By: Mordante, var-const, #libc, huixie90 Spies: huixie90, libcxx-commits Differential Revision: https://reviews.llvm.org/D131868
2022-09-19[libc++] Document the format of _LIBCPP_VERSIONLouis Dionne1-0/+3
Differential Revision: https://reviews.llvm.org/D134187
2022-09-19[libc++] Always query the compiler to find whether a type is always lockfreeLouis Dionne4-43/+26
In https://llvm.org/D56913, we added an emulation for the __atomic_always_lock_free compiler builtin when compiling in Freestanding mode. However, the emulation did (and could not) give exactly the same answer as the compiler builtin, which led to a potential ABI break for e.g. enum classes. After speaking to the original author of D56913, we agree that the correct behavior is to instead always use the compiler builtin, since that provides a more accurate answer, and __atomic_always_lock_free is a purely front-end builtin which doesn't require any runtime support. Furthermore, it is available regardless of the Standard mode (see https://godbolt.org/z/cazf3ssYY). However, this patch does constitute an ABI break. As shown by https://godbolt.org/z/1eoex6zdK: - In LLVM <= 11.0.1, an atomic<enum class with 1 byte> would not contain a lock byte. - In LLVM >= 12.0.0, an atomic<enum class with 1 byte> would contain a lock byte. This patch breaks the ABI again to bring it back to 1 byte, which seems like the correct thing to do. Fixes #57440 Differential Revision: https://reviews.llvm.org/D133377
2022-09-18[libc++] Avoid including <tuple> in compressed_pair.hNikolas Klauser39-46/+39
compressed_pair is widely used in the library, but most of the uses don't use the tuple parts. To avoid including <tuple> everywhere, use the forward declaration instead in compressed_pair.h Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D133331
2022-09-17[libc++][NFC] Inline the string constructorsNikolas Klauser1-215/+127
This removes a lot of boilerplate code. Reviewed By: ldionne, #libc Spies: EricWF, libcxx-commits Differential Revision: https://reviews.llvm.org/D128081
2022-09-17[libc++] Add test to ensure that type trait aliases in dependent return ↵Nikolas Klauser1-0/+168
types can be mangled Reviewed By: ldionne, #libc Spies: libcxx-commits, jeroen.dobbelaere Differential Revision: https://reviews.llvm.org/D133196
2022-09-16[libc++][lit][AIX] Enable test case last_write_time.pass.cpp for AIXXing Xue1-3/+13
Summary: This patch enables libc++ LIT test case last_write_time.pass.cpp for AIX. Because system call utimensat() of AIX which is used in the libc++ implementation of last_write_time() does not accept the times parameter with a negative tv_sec or tv_nsec field, testing of setting file time to before epoch time is excluded for AIX. Reviewed by: ldionne, libc++ Differential Revision: https://reviews.llvm.org/D133124
2022-09-16[SystemZ][z/OS] define REMOVE_ALL_USE_DIRECTORY_ITERATOR (libc++)Muiez Ahmed1-1/+1
This patch fixes the z/OS build by using the first implementation of __remove_all since we don't have access to the openat() family of POSIX functions. Differential Revision: https://reviews.llvm.org/D132948
2022-09-16[libc++] Shows the detailed compiler version info.Mark de Wever1-0/+2
The libc++ pre-commit CI uses Clang nightly builds. Currently it's not possible to determine the exact version used since CMake doesn't show this information by default. Instead use the --version flag to get this information. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D133122
2022-09-16[NFC][libc++][test] Uses public functions.Mark de Wever12-17/+34
Replaces std::__format_context_create with the public wrapper test_format_context_create. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D133781
2022-09-16NFC: remove accidental inclusion of libcxx test changesMatheus Izvekov1-0/+904
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
2022-09-16[clang] template / auto deduction deduces common sugarMatheus Izvekov1-904/+0
After upgrading the type deduction machinery to retain type sugar in D110216, we were left with a situation where there is no general well behaved mechanism in Clang to unify the type sugar of multiple deductions of the same type parameter. So we ended up making an arbitrary choice: keep the sugar of the first deduction, ignore subsequent ones. In general, we already had this problem, but in a smaller scale. The result of the conditional operator and many other binary ops could benefit from such a mechanism. This patch implements such a type sugar unification mechanism. The basics: This patch introduces a `getCommonSugaredType(QualType X, QualType Y)` method to ASTContext which implements this functionality, and uses it for unifying the results of type deduction and return type deduction. This will return the most derived type sugar which occurs in both X and Y. Example: Suppose we have these types: ``` using Animal = int; using Cat = Animal; using Dog = Animal; using Tom = Cat; using Spike = Dog; using Tyke = Dog; ``` For `X = Tom, Y = Spike`, this will result in `Animal`. For `X = Spike, Y = Tyke`, this will result in `Dog`. How it works: We take two types, X and Y, which we wish to unify as input. These types must have the same (qualified or unqualified) canonical type. We dive down fast through top-level type sugar nodes, to the underlying canonical node. If these canonical nodes differ, we build a common one out of the two, unifying any sugar they had. Note that this might involve a recursive call to unify any children of those. We then return that canonical node, handling any qualifiers. If they don't differ, we walk up the list of sugar type nodes we dived through, finding the last identical pair, and returning that as the result, again handling qualifiers. Note that this patch will not unify sugar nodes if they are not identical already. We will simply strip off top-level sugar nodes that differ between X and Y. This sugar node unification will instead be implemented in a subsequent patch. This patch also implements a few users of this mechanism: * Template argument deduction. * Auto deduction, for functions returning auto / decltype(auto), with special handling for initializer_list as well. Further users will be implemented in a subsequent patch. Signed-off-by: Matheus Izvekov <mizvekov@gmail.com> Differential Revision: https://reviews.llvm.org/D111283
2022-09-16[libcxx] Use interface library for libcxx-abi-sharedNikita Popov1-17/+19
The libc++.so linker script generation uses the IMPORTED_LIBNAME target property on libcxx-abi-shared. However, libcxx-abi-shared is not an interface library and as such cannot have an IMPORTED_LIBNAME target property. Convert libcxx-abi-shared into an imported interface library and use IMPORTED_LIBNAME in place of IMPORTED_LOCATION. This makes linker script generation work correctly with system-libcxxabi. I believe this fixes the issue that D131037 was intended to fix. Differential Revision: https://reviews.llvm.org/D133566
2022-09-15Fix std::fpos pretty printer on muslColin Cross2-10/+15
The mbstate_t field in std::fpos is an opaque type provied by libc, and musl's implementation does not match the one used by glibc. Change StdFposPrinter to verify its assumptions about the layout of mbstate_t, and leave out the state printing if it doesn't match. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D132983
2022-09-15[libc++] Clean up `_LIBCPP_HAS_NO_PLATFORM_WAIT` macroJoe Loser1-19/+4
As the comment suggests, `_LIBCPP_HAS_NO_PLATFORM_WAIT` is not documented or defined anywhere internally in the build system. It's a direct define in terms of `_LIBCPP_HAS_NO_THREADS`. So, remove `_LIBCPP_HAS_NO_PLATFORM_WAIT` and use `_LIBCPP_HAS_NO_THREADS` instead to control the desired behavior. Differential Revision: https://reviews.llvm.org/D132715
2022-09-12[libc++] Add LLDB data formatters dependencies to the CI imageLouis Dionne1-0/+3
This will be required in order to add a CI job running the LLDB data formatters.
2022-09-11[libc++] Workaround the absence of the __GLIBC_USE macro in glibc versions ↵Tom Honermann1-1/+1
prior to 2.25. This change correct a configuration check that relies on the glibc __GLIBC_USE macro being defined. Previously, the function-like macro was expanded without ensuring it was actually defined. This resulted in compilation failures for glibc versions prior to 2.25 (the glibc version in which the macro was added). Differential Revision: https://reviews.llvm.org/D130946
2022-09-11[libc++][random] Removes transitive includes.Mark de Wever56-18/+133
It seems these includes are still provided by the sub headers, so it only removes the duplicates. There is no change in the list of includes, but the change affects the modular build. By not having the includes in the top-level header the module map has changed. This uncovers missing includes in the tests and missing exports in the module map. This causes the huge amount of changes in the patch. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D133252
2022-09-11[libc++][doc] Updates format status page.Mark de Wever1-1/+1
2022-09-10[libc++][cuchar] Declare std::c8rtomb and std::mbrtoc8 in <cuchar> if available.Tom Honermann10-3/+71
This change implements the C library dependent portions of P0482R6 (char8_t: A type for UTF-8 characters and strings (Revision 6)) by declaring std::c8rtomb() and std::mbrtoc8() in the <cuchar> header when implementations are provided by the C library as specified by WG14 N2653 (char8_t: A type for UTF-8 characters and strings (Revision 1)) as adopted for C23. A _LIBCPP_HAS_NO_C8RTOMB_MBRTOC8 macro is defined by the libc++ __config header unless it is known that the C library provides these functions in the current compilation mode. This macro is used for testing purposes and may be of use to libc++ users. At present, the only C library known to implement these functions is GNU libc as of its 2.36 release. Reviewed By: ldionne Differential Revision: https://reviews.llvm.org/D130946
2022-09-10[libc++] Bump _LIBCPP_STD_VER to the next expected C++ versionNikolas Klauser1-1/+2
We've decided to use `_LIBCPP_STD_VER >= xy` while discussing to change the constexpr macros, so let's finally bump the version macro to match that. Reviewed By: ldionne, Mordante, huixie90, #libc, avogelsgesang Spies: avogelsgesang, libcxx-commits Differential Revision: https://reviews.llvm.org/D133323
2022-09-08[libc++] Fix compilation error on platforms that don't implement std::tmLouis Dionne4-9/+10
Instead of mentioning tm directly in the definition of __convert_to_tm, take it as a template argument. As a fly-by also fix incorrect Lit feature (should have been no-localization instead of libcpp-has-no-localization). Differential Revision: https://reviews.llvm.org/D133490
2022-09-08[libc++] Removes Clang 13 support.Mark de Wever6-22/+4
Reviewed By: #libc, ldionne, jloser Differential Revision: https://reviews.llvm.org/D133435
2022-09-07[libc++] Fixes CI.Mark de Wever1-2/+0
It seems merging the changes in transitive macros and recent commits conflicted.
2022-09-07[libc++][locale] Removes an transitive include.Mark de Wever15-15/+2
Removes <cstdarg> transitive include from <locale> in C++23. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D133254
2022-09-07[libc++][chrono] Implements formatter day.Mark de Wever20-31/+1371
This implements the enabled specializaton template<class charT> struct formatter<chrono::day, charT>; and template<class charT, class traits> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const day& d); Implements: - LWG 3241 chrono-spec grammar ambiguity in §[time.format] Partially implements: - P1361 Integration of chrono with text formatting Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D128577
2022-09-07[libc++][format] Updates feature-test macros.Mark de Wever5-20/+22
During the discussion on the SG-10 mailinglist regarding the format feature-test macros voted in during the last plenary it turns out libc++ can't mark the format feature-test macro as implemented. According to https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#__cpp_lib_format the not yet implemented paper P1361R2 Integration of chrono with text formatting affects the feature test macro. Note that P1361R2 doesn't mention the feature-test macro nor is there an LWG-issue to address the issue. The reporter of the issue didn't recall where this requirement exactly has been decided. Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D133271
2022-09-06[test][libcxx] Mark ubsan test as UNSUPPORTEDVitaly Buka1-1/+4
It inconsistently fails on bots.
2022-09-06[clang] Implement setting crash_diagnostics_dir through env variableMatheus Izvekov1-0/+2
This implements setting the equivalent of `-fcrash-diagnostics-dir` through the environment variable `CLANG_CRASH_DIAGNOSTICS_DIR`. If present, the flag still takes precedence. This helps integration with test frameworks and pipelines. With this feature, we change the libcxx bootstrapping build pipeline to produce clang crash reproducers as artifacts. Signed-off-by: Matheus Izvekov <mizvekov@gmail.com> Differential Revision: https://reviews.llvm.org/D133082
2022-09-06[libc++] Avoid instantiating type_trait classesNikolas Klauser106-307/+376
Use `using` aliases to avoid instantiating lots of types Reviewed By: ldionne, #libc Spies: libcxx-commits, miyuki Differential Revision: https://reviews.llvm.org/D132785
2022-09-05[libc++] Granularize __tupleNikolas Klauser28-569/+907
Reviewed By: ldionne, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D133081
2022-09-05[libc++] Enable rvalue overloads for pair in C++03Nikolas Klauser5-39/+18
We require rvalue support anyways, so let's use it. Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D133013
2022-09-05[libc++] Granularize the rest of memoryNikolas Klauser179-354/+589
Reviewed By: ldionne, #libc Spies: vitalybuka, paulkirth, libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D132790
2022-09-03[libc++] Implement P2273R3 (`constexpr` `unique_ptr`)Igor Zhukov53-1132/+1658
Reviewed By: mordante, #libc Differential Revision: https://reviews.llvm.org/D131315
2022-09-03[NFC][libc++] Uses the new way to mark Standard includes.Mark de Wever1-3/+5
2022-09-03[NFC][libc++][format] Removes unused code.Mark de Wever1-16/+6
The code was for backwards compatibility with code no longer present in format.
2022-09-03[NFC][libc++] Removes GCC-11 support.Mark de Wever8-16/+0
GCC-11 isn't supported in libc++ so remove UNSUPPORTED directives.
2022-09-03[libc++] Fixes generated output CI job.Mark de Wever1-13/+13
It seems there was another file with the same issue, which didn't show up initially.
2022-09-03[NFC][libc++] Moves transitive includes location.Mark de Wever41-233/+233
As discussed in D132284 they will be moved to the end. Reviewed By: #libc, Mordante Differential Revision: https://reviews.llvm.org/D133212
2022-09-03[libc++] Fixes generated output CI job.Mark de Wever1-111/+111
2022-09-02Revert "[libc++] Granularize the rest of memory"Vitaly Buka113-571/+183
Breaks buildbots. This reverts commit 30adaa730c4768b5eb06719c808b2884fcf53cf3.
2022-09-03[libc++] Implement P2445R1 (`std::forward_like`)Igor Zhukov14-1/+235
Co-authored-by: A. Jiang <de34@live.cn> Reviewed By: philnik, huixie90, #libc Differential Revision: https://reviews.llvm.org/D132327
2022-09-02[libc++][NFC] Copy the whole union instead of a member; also remove __zero()Nikolas Klauser1-21/+15
This doesn't affect code-gen Reviewed By: ldionne, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D132951
2022-09-02[libc++] Granularize the rest of memoryNikolas Klauser113-183/+571
Reviewed By: ldionne, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D132790
2022-09-02[libc++] Remove noexcept specifier from operator""sNikolas Klauser2-1/+24
For some reason `operator""s(const char8_t*, size_t)` was marked `noexcept`. Remove it and add regression tests. Reviewed By: ldionne, huixie90, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D132340