llvm-project/libcxx/include
Mark de Wever ffe262a198 [libc++][format] Improve pointer formatters.
This changes the implementation of the formatter. Instead of inheriting
from a specialized parser all formatters will use the same generic
parser. This reduces the binary size.

The new parser contains some additional fields only used in the chrono
formatting. Since this doesn't change the size of the parser the fields
are in the generic parser. The parser is designed to fit in 128-bit,
making it cheap to pass by value.

The new format function is a const member function. This isn't required
by the Standard yet, but it will be after LWG-3636 is accepted.
Additionally P2286 adds a formattable concept which requires the member
function to be const qualified in C++23. This paper is likely to be
accepted in the 2022 July plenary.

This is based on D125606. That commit did the groundwork and did similar
changes for the string formatters.

Depends on D128139.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D128671
2022-06-29 08:39:42 +02:00
..
__algorithm [libc++] Add a few missing min/max macro push/pop 2022-06-27 12:57:39 -04:00
__bit [libc++][NFC] Use concepts in <bit>. 2022-06-13 18:17:48 +02:00
__charconv [libc++] Improve charconv base10 algorithm. 2022-06-21 17:45:40 +02:00
__chrono [NFC][libc++] Modularize chrono's calendar. 2022-04-06 17:47:53 +02:00
__compare [libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI. 2022-03-13 12:32:06 -04:00
__concepts [libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI. 2022-03-13 12:32:06 -04:00
__coroutine [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__filesystem [libc++] Add various missing _LIBCPP_HIDE_FROM_ABI 2022-05-27 13:14:57 -04:00
__format [libc++][format] Improve pointer formatters. 2022-06-29 08:39:42 +02:00
__functional [libc++] Complete the implementation of N4190 2022-06-22 10:13:03 +02:00
__fwd [libc++][ranges] Implement `views::take`. 2022-05-06 14:16:13 -07:00
__ios [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__iterator [libc++][ranges] Finish LWG issues directly related to the One Ranges Proposal. 2022-06-28 12:00:15 -07:00
__memory [libc++] Complete the implementation of N4190 2022-06-22 10:13:03 +02:00
__numeric [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__random [libc++] Replace modulus operations in std::seed_seq::generate with conditional checks. 2022-05-24 10:29:25 +02:00
__ranges [libc++][ranges] Finish LWG issues directly related to the One Ranges Proposal. 2022-06-28 12:00:15 -07:00
__string [libc++] Remove macros for IBM compiler 2022-06-14 09:15:41 -04:00
__support [libcxx] Remove static inline and make use of _LIBCPP_HIDE_FROM_ABI in __support headers 2022-05-07 01:14:33 -04:00
__thread [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__type_traits [libc++] Simplify type_traits and use more builtins 2022-06-26 14:57:20 +02:00
__utility [libc++] Remove macros for IBM compiler 2022-06-14 09:15:41 -04:00
__variant [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
experimental [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
ext [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
CMakeLists.txt [libc++] Use bounded iterators in std::span when the debug mode is enabled 2022-06-27 08:34:45 -04:00
__assert [libc++] Make the Debug mode a configuration-time only option 2022-06-07 16:33:53 -04:00
__availability [libc++] Removes _LIBCPP_AVAILABILITY_TO_CHARS. 2022-06-07 18:59:19 +02:00
__bit_reference [libc++] Fix C++03 with the unstable ABI enabled 2022-04-25 15:17:24 +02:00
__bits [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__bsd_locale_defaults.h [libc++][NFC] Fix include guards and add a missing license header 2022-03-23 13:14:19 -04:00
__bsd_locale_fallbacks.h [libc++][NFC] Fix include guards and add a missing license header 2022-03-23 13:14:19 -04:00
__config [libc++] Use bounded iterators in std::span when the debug mode is enabled 2022-06-27 08:34:45 -04:00
__config_site.in [libc++] Make the Debug mode a configuration-time only option 2022-06-07 16:33:53 -04:00
__debug [libc++] Add a test to pin down the set of transitive public includes 2022-06-23 16:23:34 -04:00
__errc [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
__hash_table [libc++] Granularize <iterator> includes 2022-06-10 22:43:57 +02:00
__locale [libc++] Towards a simpler extern template story in libc++ 2022-06-08 22:05:07 -04:00
__mbstate_t.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
__mutex_base [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__node_handle [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__split_buffer [libc++] Implement P0401R6 (allocate_at_least) 2022-04-09 16:03:45 +02:00
__std_stream [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__threading_support [libc++][NFC] Fix include guards and add a missing license header 2022-03-23 13:14:19 -04:00
__tree [libc++] Removes a GCC bug work-around. 2022-06-13 17:55:43 +02:00
__tuple [libc++] Revert "Protect users from relying on detail headers" & related changes 2022-03-01 08:20:24 -05:00
__undef_macros [libc++] Assume that push_macro and pop_macro are available 2022-05-23 20:47:44 +02:00
algorithm [libc++][ranges] Finish LWG issues directly related to the One Ranges Proposal. 2022-06-28 12:00:15 -07:00
any [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
array [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
atomic [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
barrier [libc++] Remove conditional include 2022-05-25 10:04:54 -04:00
bit [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
bitset [libc++] Complete the implementation of N4190 2022-06-22 10:13:03 +02:00
cassert [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
ccomplex [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cctype [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cerrno [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cfenv [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cfloat [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
charconv [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
chrono [NFC][libc++] Modularize chrono's calendar. 2022-04-06 17:47:53 +02:00
cinttypes [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
ciso646 [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
climits [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
clocale [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cmath [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
codecvt [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
compare [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
complex [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
complex.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
concepts [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
condition_variable [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
coroutine [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
csetjmp [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
csignal [libc++] Fix modules builds when features are removed 2022-06-08 18:48:25 -04:00
cstdarg [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cstdbool [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cstddef [libc++] Use __enable_if_t and is_integral in cstddef 2022-05-29 12:05:02 +02:00
cstdint [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cstdio [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cstdlib [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cstring [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
ctgmath [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
ctime [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
ctype.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
cuchar [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cwchar [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
cwctype [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
deque [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
errno.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
exception [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
execution [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
fenv.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
filesystem [libc++] Mark standard-mandated includes as such 2022-06-17 20:43:33 +02:00
float.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
format [libc++][format] Improve string formatters 2022-06-22 07:40:36 +02:00
forward_list [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
fstream [libc++] Towards a simpler extern template story in libc++ 2022-06-08 22:05:07 -04:00
functional [libc++][ranges] Finish LWG issues directly related to the One Ranges Proposal. 2022-06-28 12:00:15 -07:00
future [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
initializer_list [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
inttypes.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
iomanip [libc++] Granularize __string 2022-06-09 21:04:18 +02:00
ios [libc++] Mark standard-mandated includes as such 2022-06-17 20:43:33 +02:00
iosfwd [libc++] Remove macros for IBM compiler 2022-06-14 09:15:41 -04:00
iostream [libc++] Mark standard-mandated includes as such 2022-06-17 20:43:33 +02:00
istream [libc++] Granularize <iterator> includes 2022-06-10 22:43:57 +02:00
iterator [libc++][ranges] Finish LWG issues directly related to the One Ranges Proposal. 2022-06-28 12:00:15 -07:00
latch [libc++] Make sure that all headers can be included with modules enabled 2022-05-25 03:44:48 -04:00
limits [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
limits.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
list [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
locale [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
locale.h [libc++] Improve error messages for disabled modes 2022-05-20 09:36:55 -04:00
map [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
math.h [libc++][AIX] Use C++ overloads from libc++'s math.h 2022-03-01 15:53:41 -05:00
memory [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
module.modulemap.in [libc++] Use bounded iterators in std::span when the debug mode is enabled 2022-06-27 08:34:45 -04:00
mutex [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
new [libc++] Implement P0154R1 (Hardware inference size) 2022-06-23 01:31:09 +02:00
numbers [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
numeric [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
optional [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
ostream [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
queue [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
random [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
ranges [libc++] add zip_view and views::zip for C++23 2022-04-25 12:22:22 +02:00
ratio [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
regex [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
scoped_allocator [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
semaphore [libc++] Make sure that all headers can be included with modules enabled 2022-05-25 03:44:48 -04:00
set [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
setjmp.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
shared_mutex [libc++] Improve error messages for disabled modes 2022-05-20 09:36:55 -04:00
span [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
sstream [libc++] Towards a simpler extern template story in libc++ 2022-06-08 22:05:07 -04:00
stack [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
stdatomic.h [libc++] Remove overly conservative error in <stdatomic.h> 2022-05-16 15:30:01 -04:00
stdbool.h [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
stddef.h [libc++] Remove the ability to use the std::nullptr_t emulation in C++03 mode 2022-02-07 17:51:05 -05:00
stdexcept [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
stdint.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
stdio.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
stdlib.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
streambuf [libc++] Towards a simpler extern template story in libc++ 2022-06-08 22:05:07 -04:00
string [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
string.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
string_view [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
strstream [libc++][clang-tidy] Enable bugprone-use-after-move and explicitly list all used checks 2022-06-21 20:25:04 +02:00
system_error [libc++] Complete the implementation of N4190 2022-06-22 10:13:03 +02:00
tgmath.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
thread [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
tuple [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
type_traits [libc++] P2321R2 section [tuple.tuple]. Adding C++23 constructors, assignment operators and swaps to `tuple` 2022-06-24 07:12:53 +01:00
typeindex [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
typeinfo [libc++] Ensure that all public C++ headers include <__assert> 2022-03-30 15:05:31 -04:00
uchar.h [libc++] Add missing header <cuchar> 2022-03-07 08:48:50 -05:00
unordered_map [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
unordered_set [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
utility [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
valarray [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
variant [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
vector [libc++] Re-add transitive includes that had been removed since LLVM 14 2022-06-27 22:18:19 -04:00
version [libc++] Implement P0154R1 (Hardware inference size) 2022-06-23 01:31:09 +02:00
wchar.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00
wctype.h [libc++] Normalize all our '#pragma GCC system_header', and regression-test. 2022-02-04 12:27:19 -05:00