|
Revision tags: llvmorg-21-init, llvmorg-19.1.7 |
|
| #
b9a2658a |
| 21-Dec-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++][C++03] Use `__cxx03/` headers in C++03 mode (#109002)
This patch implements the forwarding to frozen C++03 headers as discussed in https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-
[libc++][C++03] Use `__cxx03/` headers in C++03 mode (#109002)
This patch implements the forwarding to frozen C++03 headers as discussed in https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc. In the RFC, we initially proposed selecting the right headers from the Clang driver, however consensus seemed to steer towards handling this in the library itself. This patch implements that direction.
At a high level, the changes basically amount to making each public header look like this:
``` // inside <vector> #ifdef _LIBCPP_CXX03_LANG # include <__cxx03/vector> #else // normal <vector> content #endif ```
In most cases, public headers are simple umbrella headers so there isn't much code in the #else branch. In other cases, the #else branch contains the actual implementation of the header.
show more ...
|
|
Revision tags: llvmorg-19.1.6 |
|
| #
c166a9c7 |
| 10-Dec-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Add #if 0 block to all the top-level headers (#119234)
Including The frozen C++03 headers results in a lot of formatting changes in the main headers, so this splits these changes into a sep
[libc++] Add #if 0 block to all the top-level headers (#119234)
Including The frozen C++03 headers results in a lot of formatting changes in the main headers, so this splits these changes into a separate commit instead.
This is part of https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc.
show more ...
|
|
Revision tags: llvmorg-19.1.5, llvmorg-19.1.4 |
|
| #
c6f3b7bc |
| 06-Nov-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Refactor the configuration macros to being always defined (#112094)
This is a follow-up to #89178. This updates the `<__config_site>` macros.
|
|
Revision tags: llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2 |
|
| #
f08df56d |
| 30-Jul-2024 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][format] Implements P3107R5 in <format>. (#86713)
This adds the new std::enable_nonlocking_formatter_optimization trait in
<format>. This trait will be used in std::print to implement the
[libc++][format] Implements P3107R5 in <format>. (#86713)
This adds the new std::enable_nonlocking_formatter_optimization trait in
<format>. This trait will be used in std::print to implement the
performance benefits.
Implements parts of
- P3107R5 - Permit an efficient implementation of ``std::print``
show more ...
|
|
Revision tags: llvmorg-19.1.0-rc1 |
|
| #
ec56790c |
| 23-Jul-2024 |
Ties Stuij <ties.stuij@arm.com> |
[libcxx] don't `#include <cwchar>` if wide chars aren't enabled (#99911)
Pull request #96032 unconditionall adds the `cwchar` include in the
`format` umbrella header. However support for wchar_t ca
[libcxx] don't `#include <cwchar>` if wide chars aren't enabled (#99911)
Pull request #96032 unconditionall adds the `cwchar` include in the
`format` umbrella header. However support for wchar_t can be disabled in
the build system (LIBCXX_ENABLE_WIDE_CHARACTERS).
This patch guards against inclusion of `cwchar` in `format` by checking
the `_LIBCPP_HAS_NO_WIDE_CHARACTERS` define.
For clarity I've also merged the include header section that `cwchar`
was in with the one above as they were both guarded by the same `#if`
logic.
show more ...
|
|
Revision tags: llvmorg-20-init |
|
| #
dfddc0c4 |
| 18-Jul-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Include the rest of the detail headers by version in the umbrella headers (#96032)
This is a follow-up to #83740.
|
|
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5 |
|
| #
e3dea5e3 |
| 28-Apr-2024 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][format] Improves escaping performance. (#88533)
The previous patch implemented
- P2713R1 Escaping improvements in std::format
- LWG3965 Incorrect example in [format.string.escaped] p3 for
[libc++][format] Improves escaping performance. (#88533)
The previous patch implemented
- P2713R1 Escaping improvements in std::format
- LWG3965 Incorrect example in [format.string.escaped] p3 for formatting
of combining characters
These changes were correct, but had a size and performance penalty. This
patch improves the size and performance of the previous patch. The
performance is still worse than before since the lookups may require two
property lookups instead of one before implementing the paper. The
changes give a tighter coupling between the Unicode data and the
algorithm. Additional tests are added to notify about changes in future
Unicode updates.
Before
```
-----------------------------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------------------------
BM_ascii_escaped<char> 110704 ns 110696 ns 6206
BM_unicode_escaped<char> 101371 ns 101374 ns 6862
BM_cyrillic_escaped<char> 63329 ns 63327 ns 11013
BM_japanese_escaped<char> 41223 ns 41225 ns 16938
BM_emoji_escaped<char> 111022 ns 111021 ns 6304
BM_ascii_escaped<wchar_t> 112441 ns 112443 ns 6231
BM_unicode_escaped<wchar_t> 102776 ns 102779 ns 6813
BM_cyrillic_escaped<wchar_t> 58977 ns 58975 ns 11868
BM_japanese_escaped<wchar_t> 36885 ns 36886 ns 18975
BM_emoji_escaped<wchar_t> 115885 ns 115881 ns 6051
```
The first change is to manually encode the entire last area and make a
manual exception for the 240 excluded entries. This reduced the table
from 1077 to 729 entries and gave the following benchmark results.
```
-----------------------------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------------------------
BM_ascii_escaped<char> 104777 ns 104776 ns 6550
BM_unicode_escaped<char> 96980 ns 96982 ns 7238
BM_cyrillic_escaped<char> 60254 ns 60251 ns 11670
BM_japanese_escaped<char> 44452 ns 44452 ns 15734
BM_emoji_escaped<char> 104557 ns 104551 ns 6685
BM_ascii_escaped<wchar_t> 107456 ns 107454 ns 6505
BM_unicode_escaped<wchar_t> 96219 ns 96216 ns 7301
BM_cyrillic_escaped<wchar_t> 56921 ns 56904 ns 12288
BM_japanese_escaped<wchar_t> 39530 ns 39529 ns 17492
BM_emoji_escaped<wchar_t> 108494 ns 108496 ns 6408
```
An entry in the table can only contain 2048 code points. For larger
ranges there are multiple entries split in chunks with a maximum size of
2048 entries. To encode the entire Unicode code point range 21 bits are
required. The manual part starts at 0x323B0 this means all entries in
the table fit in 18 bits. This allows to allocate 3 additional bits for
the range. This allows entries to have 16384 elements. This range always
avoids splitting the range in multiple chunks.
This reduces the number of table elements from 729 to 711 and gives the
following benchmark results.
```
-----------------------------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------------------------
BM_ascii_escaped<char> 104289 ns 104289 ns 6619
BM_unicode_escaped<char> 96682 ns 96681 ns 7215
BM_cyrillic_escaped<char> 59673 ns 59673 ns 11732
BM_japanese_escaped<char> 41983 ns 41982 ns 16646
BM_emoji_escaped<char> 104119 ns 104120 ns 6683
BM_ascii_escaped<wchar_t> 104503 ns 104505 ns 6693
BM_unicode_escaped<wchar_t> 93426 ns 93423 ns 7489
BM_cyrillic_escaped<wchar_t> 54858 ns 54859 ns 12742
BM_japanese_escaped<wchar_t> 36385 ns 36384 ns 19259
BM_emoji_escaped<wchar_t> 105608 ns 105610 ns 6592
```
show more ...
|
|
Revision tags: llvmorg-18.1.4, llvmorg-18.1.3 |
|
| #
316634ff |
| 29-Mar-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Remove <queue> and <stack> includes from <format> (#85520)
This reduces the include time of <format> from 691ms to 556ms.
|
|
Revision tags: llvmorg-18.1.2 |
|
| #
5bcb7814 |
| 16-Mar-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++] Remove <locale> includes from <format> (#85478)
This reduces the include time from 767ms to 691ms.
|
| #
08766681 |
| 08-Mar-2024 |
Nikolas Klauser <nikolasklauser@berlin.de> |
[libc++][NFC] Move __format/format_fwd.h to __fwd/format.h (#84336)
|
|
Revision tags: llvmorg-18.1.1 |
|
| #
37dca605 |
| 29-Feb-2024 |
Louis Dionne <ldionne.2@gmail.com> |
[libc++] Clean up includes of <__assert> (#80091)
Originally, we used __libcpp_verbose_abort to handle assertion failures.
That function was declared from all public headers. Since we don't use
th
[libc++] Clean up includes of <__assert> (#80091)
Originally, we used __libcpp_verbose_abort to handle assertion failures.
That function was declared from all public headers. Since we don't use
that mechanism anymore, we don't need to declare __libcpp_verbose_abort
from all public headers, and we can clean up a lot of unnecessary
includes.
This patch also moves the definition of the various assertion categories
to the <__assert> header, since we now rely on regular IWYU for these
assertion macros.
rdar://105510916
show more ...
|
|
Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1 |
|
| #
27e67cdb |
| 29-Jan-2024 |
Hristo Hristov <hristo.goshev.hristov@gmail.com> |
Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (#79032)
Deleted the offending test case.
`libcxx/test/std/utilities/format/format.arguments/format.arg/visit.retur
Reland: [libc++][format] P2637R3: Member visit (std::basic_format_arg) #76449 (#79032)
Deleted the offending test case.
`libcxx/test/std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp`
lines: 134-135:
> test<Context, bool, long>(true, 192812079084L);
test<Context, bool, long>(false, 192812079084L);
Relands: https://github.com/llvm/llvm-project/pull/76449
Reverted in:
https://github.com/llvm/llvm-project/commit/02f95b77515fe18ed1076b94cbb850ea0cf3c77e
---------
Co-authored-by: Zingam <zingam@outlook.com>
show more ...
|
|
Revision tags: llvmorg-19-init |
|
| #
02f95b77 |
| 22-Jan-2024 |
Petr Hosek <phosek@google.com> |
Revert "[libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (#76449)"
This reverts commit 7d9b5aa65b09126031e1c2903605a7d34aea4bc1 since std/utilities/format/format.arguments/format.a
Revert "[libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (#76449)"
This reverts commit 7d9b5aa65b09126031e1c2903605a7d34aea4bc1 since std/utilities/format/format.arguments/format.arg/visit.return_type.pass.cpp is failing on Windows when building with Clang-cl.
show more ...
|
| #
7d9b5aa6 |
| 21-Jan-2024 |
Hristo Hristov <hristo.goshev.hristov@gmail.com> |
[libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (#76449)
Implements parts of: `P2637R3` https://wg21.link/P2637R3
(https://eel.is/c++draft/variant.visit)
Implements:
`basic_f
[libc++][format] P2637R3: Member `visit` (`std::basic_format_arg`) (#76449)
Implements parts of: `P2637R3` https://wg21.link/P2637R3
(https://eel.is/c++draft/variant.visit)
Implements:
`basic_format_arg.visit()`
`basic_format_arg.visit<R>()`
Deprecates:
`std::visit_format_arg()`
The tests are as close as possible to the non-member function tests.
To land after: https://github.com/llvm/llvm-project/pull/76447,
https://github.com/llvm/llvm-project/pull/76268
---------
Co-authored-by: Zingam <zingam@outlook.com>
show more ...
|
| #
e3f154d8 |
| 09-Dec-2023 |
Mark de Wever <koraq@xs4all.nl> |
[libc++] Implements Runtime format strings. (#73353)
This change requires quite a number of changes in the tests; this is not
code I expect people to use in the wild. So I don't expect breakage for
[libc++] Implements Runtime format strings. (#73353)
This change requires quite a number of changes in the tests; this is not
code I expect people to use in the wild. So I don't expect breakage for
users.
Implements:
- P2905R2 Runtime format strings, as a Defect Report
show more ...
|
|
Revision tags: llvmorg-17.0.6 |
|
| #
92d9f232 |
| 24-Nov-2023 |
Mark de Wever <koraq@xs4all.nl> |
[libc++] Implements Runtime format strings II. (#72543)
Implements
- P2918R2 Runtime format strings II
|
|
Revision tags: llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5 |
|
| #
dff62f52 |
| 17-May-2023 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][format] Removes the experimental status.
The code has been quite ready for a while now and there are no more ABI breaking papers. So this is a good time to mark the feature as stable.
Revi
[libc++][format] Removes the experimental status.
The code has been quite ready for a while now and there are no more ABI breaking papers. So this is a good time to mark the feature as stable.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D150802
show more ...
|
|
Revision tags: llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4 |
|
| #
04d4f4b3 |
| 05-May-2022 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][format] Adds container adaptor formatters.
Implements parts of - P2286R8 Formatting Ranges
Depends on D140653
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/
[libc++][format] Adds container adaptor formatters.
Implements parts of - P2286R8 Formatting Ranges
Depends on D140653
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D141290
show more ...
|
| #
22e8525d |
| 05-May-2022 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][format] Implements range_formatter
Implements parts of - P2286R8 Formatting Ranges - P2585R0 Improving default container formatting
Depends on D140651
Reviewed By: ldionne, #libc
Differe
[libc++][format] Implements range_formatter
Implements parts of - P2286R8 Formatting Ranges - P2585R0 Improving default container formatting
Depends on D140651
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D140653
show more ...
|
| #
eb6e13cb |
| 05-May-2022 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][format] Adds formatter for tuple and pair
Implements parts of - P2286R8 Formatting Ranges
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D136775
|
| #
d184958b |
| 19-Oct-2022 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][format] Adds range-default-formatter.
This adds an incomplete version where the specializations for the format_kinds are disabled dummy formatters.
Implements part of - P2585R0 Improving d
[libc++][format] Adds range-default-formatter.
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
show more ...
|
| #
00798e50 |
| 11-Sep-2022 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][format] Granularizes the format header.
Moves the last pieces of code to its own header.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D133665
|
| #
49c3c40c |
| 03-Sep-2022 |
Mark de Wever <koraq@xs4all.nl> |
[NFC][libc++][format] Removes unused code.
The code was for backwards compatibility with code no longer present in format.
|
| #
da6ff3ae |
| 13-Aug-2022 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][format] Uglyfies format buffer.
While working on D129964 I noticed some code hadn't been uglyfied, this rectifies the issue.
Depends on D129964
Reviewed By: #libc, philnik
Differential R
[libc++][format] Uglyfies format buffer.
While working on D129964 I noticed some code hadn't been uglyfied, this rectifies the issue.
Depends on D129964
Reviewed By: #libc, philnik
Differential Revision: https://reviews.llvm.org/D131834
show more ...
|
| #
f712775d |
| 15-Jul-2022 |
Mark de Wever <koraq@xs4all.nl> |
[libc++][format] Exposes basic-format-string
This paper was accepted during the last plenary and is intended to be backported to LLVM 15. When backporting the release notes in the branch should be u
[libc++][format] Exposes basic-format-string
This paper was accepted during the last plenary and is intended to be backported to LLVM 15. When backporting the release notes in the branch should be updated too.
Note the feature-test macro isn't updated since this will change; three papers have updated the same macro in the same plenary.
Implements: - P2508R1 Exposing std::basic-format-string
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D130643
show more ...
|