12702 Commits

Author SHA1 Message Date
Hristo Hristov
e52ad499ff
[libc++][NFC] Add reminder to remove _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER macro (#127070)
`__cpp_explicit_this_parameter` has been set in LLVM20
https://github.com/llvm/llvm-project/pull/107451 /
72e58e00c2

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2025-02-14 16:02:13 +02:00
Nikolas Klauser
55b0fde20a
[libc++][NFC] Simplify unique_ptr a bit (#121230) 2025-02-14 10:08:23 +01:00
Alex Bradbury
db2953d801
[doc] Add Discord invite link alongside channel links (#126352)
By far the most important part of this patch is updating
GettingInvolved.rst to include the invite link, but I've grepped for any
other discord.com links.

I'm no Discord expert, but from my experience (confirmed via @preames
kindly testing as well) the direct channel links provide a confusing
experience if you haven't already found and used an invite link to the
LLVM Discord server. If you're logged into Discord but not a member of
LLVM's sever, the web app opens and then...nothing. No channel opens, no
prompt to join the server or even a hint that you need to find an invite
link (and if you're not used to Discord, you likely don't even know
that's necessary).

This patch addresses the issue by providing the invite link where
Discord is mentioned.
2025-02-13 15:00:21 +00:00
Takuto Ikuta
0761841bc0
[libcxx] Add a missing include for __enable_if_t (#127016)
This is to fix compile error with explicit Clang modules like
```
../../third_party/libc++/src/include/__filesystem/path.h:80:26: error: declaration of '__enable_if_t' must be imported from module 'std_core.type_traits.enable_if' before it is required
   80 | template <class _ECharT, __enable_if_t<__can_convert_char<_ECharT>::value, int> = 0>
      |                          ^
../../third_party/libc++/src/include/__type_traits/enable_if.h:34:1: note: declaration here is not visible
   34 | using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
      | ^
```
2025-02-13 08:54:56 +01:00
Takuto Ikuta
672e3858a4
[libcxx] Add a missing include for __bit_iterator (#127015)
This is to fix compile error with explicit Clang modules like
```
../../third_party/libc++/src/include/__vector/vector_bool.h:85:11: error: default argument of '__bit_iterator' must be imported from module 'std.bit_reference_fwd' before it is required
   85 |   typedef __bit_iterator<vector, false> pointer;
      |           ^
../../third_party/libc++/src/include/__fwd/bit_reference.h:23:68: note: default argument declared here is not reachable
   23 | template <class _Cp, bool _IsConst, typename _Cp::__storage_type = 0>
      |                                                                    ^
```
2025-02-13 08:54:43 +01:00
Louis Dionne
5953e5a3c6
[libc++] Simplify the apple-system-hardened CI configuration (#126911)
It was basically a copy-paste of the non-hardened version of the same
job, and it's easy to remove the duplication.
2025-02-12 23:58:14 +01:00
Louis Dionne
dbfb29fd45
[libc++] Add a link to __builtin_verbose_trap from the hardening docs (#126930) 2025-02-12 23:57:37 +01:00
Nikolas Klauser
b101c35bc7
[libc++] Remove conditional for attributes that are always available (#126879)
These attributes are available in all supported compilers, so the
`#else` case of the conditional is dead code.
2025-02-12 13:48:54 +01:00
Louis Dionne
39f0f0a21b
[libc++] Remove obsolete guards for join_view being experimental (#126697)
These TODOs were forgotten when join_view was made non-experimental. By
removing these checks, we slightly increase the coverage of the test
suite.
2025-02-12 09:44:49 +01:00
Mark de Wever
c4fe4561c7 [libc++] Fixes building with Python 3.8.
This addresses the post-commit issues reported in #101880.
2025-02-11 20:08:12 +01:00
Louis Dionne
2d66ab5e8e
[libc++][NFC] Run the container tests through clang-format (#126499)
We've been improving these the tests for vector quite a bit and we are
probably not done improving our container tests. Formatting everything
at once will make subsequent reviews easier.
2025-02-11 06:17:39 +01:00
A. Jiang
998f2422a5
[libc++][test] Fixes for hash<Emplaceable> and value discarding (#126566)
Currently `std::hash<Emplaceable>::operator()` relies implicit
conversion from `int` to `size_t`, which makes MSVC compelling. This PR
switches to use `static_cast`.

In `flat.map/flat.map.access/at_transparent.pass.cpp`, there's one
value-discarding use of `at` that wasn't marked `TEST_IGNORE_NODISCARD`.
This PR adds the missing `TEST_IGNORE_NODISCARD`.
2025-02-11 07:56:53 +08:00
Joseph Huber
3d9409f5bc
[NVPTX] Make ctor/dtor lowering always enabled in NVPTX (#126544)
Summary:
Currently we conditionally enable NVPTX lowering depending on the
language (C/C++/OpenMP). Unfortunately this causes problems because this
option is only present if the backend was enabled, which causes this to
error if you try to make LLVM-IR.

This patch instead makes it the only accepted lowering. The reason we
had it as opt-in before is because it is not handled by CUDA. So, this
pach also introduces diagnostics to prevent *all* creation of
device-side global constructors and destructors. We already did this for
variables, now we do it for attributes as well.

This inverts the responsibility of blocking this from the backend to the
langauage like it should be given that support for this is language
dependent.
2025-02-10 14:25:44 -06:00
Louis Dionne
f332455dd9
[libc++] Extract destroy algorithms into separate headers (#126449)
This patch separates the destroy algorithms from the primitive
construct_at and destroy_at operations, which are conceptually not
algorithms. This makes it easier to start using these destroy algorithms
from upcoming relocation facilities.

As part of this, it also implements `std::destroy_at` for arrays without
relying on the `std::destroy` algorithm, which is conceptually a
higher-level facility.
2025-02-10 21:19:46 +01:00
Mark de Wever
b319dfef21
[libc++][CI] Updates Clang HEAD version in Docker. (#126419)
This is a preparation to test Clang 21 in the CI,

Drive-by: Updated some outdated documentation.
2025-02-10 18:08:24 +01:00
Mark de Wever
5b9e6c7993
[libc++] Improves type-safety in generator script. (#101880)
This changes the code to use dataclasses instead of dict entries. It
also adds type aliases to use in the typing information and updates the
typing information.
2025-02-10 18:03:44 +01:00
Mark de Wever
cb1b51f4ff [libc++][doc] Updates format status. 2025-02-09 15:11:13 +01:00
Mark de Wever
8a4707bf1d [NFC][libc++] Fixes minor issues in the synopsis. 2025-02-09 15:08:30 +01:00
A. Jiang
51ba9819b4
[libc++][test] Fix size_type issues with MinSequenceContainer and min_allocator (#126267)
`MinSequenceContainer::size` can be narrowing on 64-bit platforms, and
MSVC complains about such implicit conversion. This PR changes the
implicit conversion to explicit `static_cast`.

`min_allocator::allocate` and `min_allocator::deallocate` have
`ptrdiff_t` as the parameter type, which seems weird, because the
underlying `std::allocator`'s member functions take `size_t`. It seems
better to use `size_t` consistently.
2025-02-08 09:26:59 +08:00
Louis Dionne
27598aba49
[libc++] Further refactor sequence container benchmarks (#126129)
This patch does not significantly change how the sequence container
benchmarks are done, but it adopts the same style as the associative
container benchmarks.

This commit does adjust how we were benchmarking push_back, where we
never really measured the overhead of the slow path of push_back (when
we need to reallocate).
2025-02-07 09:56:45 -05:00
Nikolas Klauser
0227396417 Revert "[libc++] Reduce std::conjunction overhead (#124259)"
It turns out that the new implementation takes significantly more stack
memory for some reason.

This reverts commit 2696e4fb9567d23ce065a067e7f4909b310daf50.
2025-02-07 15:50:17 +01:00
Nikolas Klauser
60cc48d900 [libc++] Refactor strings operator+ tests
This avoids duplicating the test data for all the different tests.
2025-02-07 14:07:15 +01:00
Nikolas Klauser
778861742d
[libc++][NFC] Replace typedefs with using aliases in <string> (#126070) 2025-02-07 01:08:02 +01:00
Louis Dionne
1d319dfe7d
[libc++] Implement generic associative container benchmarks (#123663)
This patch implements generic associative container benchmarks for
containers with unique keys. In doing so, it replaces the existing
std::map benchmarks which were based on the cartesian product
infrastructure and were too slow to execute.

These new benchmarks aim to strike a balance between exhaustive coverage
of all operations in the most interesting case, while executing fairly
rapidly (~40s on my machine).

This bumps the requirement for the map benchmarks from C++17 to C++20
because the common header that provides associative container benchmarks
requires support for C++20 concepts.
2025-02-06 16:08:55 -05:00
Nikolas Klauser
2ef2587ae9
[libc++][NFC] Inline the simple observer functions into the basic_string definition (#126061)
Having them defined ouf-of-line results in a significant amount of
boilerplate without improving readability, since they're just one or two
lines long anyways.

As a drive-by, add comments between the declarations to make them easier
to distinguish.
2025-02-06 19:29:30 +01:00
Nikolas Klauser
1117568dad
[libc++][NFC] Remove __default_allocator_type aliases (#126066)
These aliases are never used, so we can ditch them.
2025-02-06 19:28:12 +01:00
Mark de Wever
aca829de13
[libc++][chrono] implements TAI clock. (#125550)
Implements parts of:
- P0355 Extending <chrono> to Calendars and Time Zones
- P1361 Integration of chrono with text formatting
- LWG3359 <chrono> leap second support should allow for negative leap
seconds
2025-02-06 17:55:02 +01:00
Nikolas Klauser
ee3bccab34
[libc++] Remove basic_string::__clear_and_shrink (#126050)
`__clear_and_shrink` is only used in a single place and does more work
than actually required.
2025-02-06 14:07:45 +01:00
Nikolas Klauser
4562efc674
Reapply "[libc++] Simplify the implementation of reserve() and shrink_to_fit() (#113453)" (#125888)
The capacity is now passed correctly and a test for this path is added.

Since we changed the implementation of `reserve(size_type)` to only ever
extend,
it doesn't make a ton of sense anymore to have `__shrink_or_extend`,
since the code
paths of `reserve` and `shrink_to_fit` are now almost completely
separate.

This patch splits up `__shrink_or_extend` so that the individual parts
are in `reserve`
and `shrink_to_fit` depending on where they are needed.

This reverts commit 59f57be94f38758616b1339b293b43af845571af.
2025-02-06 09:35:24 +01:00
Дмитрий Изволов
6e402f5121
[libc++] Support constexpr for std::stable_sort in radix sort branch (#125284)
`std::stable_sort` is `constexpr` since PR
https://github.com/llvm/llvm-project/pull/110320
But `radix_sort` branch is still non-`constexpr`.
This PR fixes it.

#119394
#105360
2025-02-06 09:07:25 +01:00
Peng Liu
efa287dd8a
[libc++] Slightly simplify max_size and add new tests for vector (#119990)
This PR slightly simplifies the implementation of `vector<bool>::max_size`
and adds extensive tests for the `max_size()` function for both `vector<bool>`
and `vector<T>`. The main purposes of the new tests include:

- Verify correctness of `max_size()` under various `size_type` and
  `difference_type` definitions: check that `max_size()` works properly
  with allocators that have custom `size_type` and `difference_type`. This
  is particularly useful for `vector<bool>`, as different `size_type` lead
  to different `__storage_type` of different word lengths, resulting in
  varying `max_size()` values for `vector<bool>`. Additionally, different
  `difference_type` also sets different upper limit of `max_size()` for
  both `vector<bool>` and `std::vector`. These tests were previously
  missing.

- Eliminate incorrect implementations: Special tests are added to identify and
  reject incorrect implementations of `vector<bool>::max_size` that unconditionally
  return `std::min<size_type>(size-max, __internal_cap_to_external(allocator-max-size))`.
  This can cause overflow in the `__internal_cap_to_external()` call and lead
  to incorrect results. The new tests ensure that such incorrect
  implementations are identified.
2025-02-05 22:38:32 -05:00
Louis Dionne
accfbd4cb3
[libc++] Replace __is_trivially_relocatable by is_trivially_copyable (#124970)
The __is_trivially_relocatable builtin has semantics that do not
correspond to any current or future notion of trivial relocation.
Furthermore, it currently leads to incorrect optimizations for some
types on supported compilers:
- Clang on Windows where types with non-trivial destructors get
  incorrectly optimized
- AppleClang where types with non-trivial move constructors get
  incorrectly optimized

Until there is an agreed upon and bugfree implementation of what it
means to be trivially relocatable, it is safer to simply use trivially
copyable instead. This doesn't leave a lot of types behind and is
definitely correct.
2025-02-05 22:32:51 -05:00
Mark de Wever
5b98be4e0b
[lib++][Format] Updates Unicode database. (#125712)
Updates the databease to the Unicode release 16.0.0. The algorithms of
the Grapheme clustering rules have not changed.
2025-02-05 18:55:02 +01:00
Peng Liu
cf9806eb4d
[libc++] Fix UB in bitwise logic of {std, ranges}::{fill, fill_n} algorithms (#122410)
This PR addresses an undefined behavior that arises when using the
`std::fill` and `std::fill_n` algorithms, as well as their ranges
counterparts `ranges::fill` and `ranges::fill_n`, with `vector<bool, Alloc>`
that utilizes a custom-sized allocator with small integral types.
2025-02-05 11:39:49 -05:00
Louis Dionne
ccb08b9dab
[libc++] Also provide an alignment assumption for vector in C++03 mode (#124839)
There's no reason not to, and it's easy enough to do using enable_if. As
a drive-by change, also add a missing _LIBCPP_NO_CFI attribute on
__add_alignment_assumption.
2025-02-05 08:57:22 -05:00
Louis Dionne
bcfd9f81e1 [libc++] Fix stray usage of _LIBCPP_HAS_NO_WIDE_CHARACTERS on Windows 2025-02-05 08:37:09 -05:00
Mark de Wever
a27f3b2bb1
[libc++][TZDB] Fixes %z escaping. (#125399)
The previous tested TZDB did not contain %z for the rule letters. The
usage of %z in TZDB 2024b revealed a bug in the implementation. The
patch fixes it and has been locally tested with TZDB 2024b.

Fixes #108957
2025-02-04 11:36:31 -05:00
Nikolas Klauser
d8148244e9
[libc++] Decrease instantiation cost of __constexpr_memmove (#125109)
Using `if constexpr` in `__constexpr_memmove` makes the instantiation
three times faster for the same type, since it avoids a bunch of class
instantiations and SFINAE for constexpr support that's never actually
used. Given that `__constexpr_memmove` is used quite a bit through
`std::copy` and is instantiated multiple times when just including
`<__string/char_traits.h>` this can provide a nice compile time speedup
for a very simple change.
2025-02-04 17:12:35 +01:00
Louis Dionne
c7c7eabc7f
[libc++] Add a benchmark for std::reverse (#125262) 2025-02-03 12:10:47 -05:00
Nikolas Klauser
fcc4ceb331
[libc++] Implement N4258(Cleaning-up noexcept in the Library) (#120312)
Fixes #99937
2025-01-30 21:10:56 +01:00
Louis Dionne
439bef9751
[libc++] Refactor the sequence container benchmarks (#119763)
Rewrite the sequence container benchmarks to only rely on the actual
operations specified in SequenceContainer requirements and add
benchmarks for std::list, which is also considered a sequence container.

One of the major goals of this refactoring is also to make these
container benchmarks run faster so that they can be run more frequently.
The existing benchmarks have the significant problem that they take so
long to run that they must basically be run overnight. This patch
reduces the size of inputs such that the rewritten benchmarks each take
at most a minute to run.

This patch doesn't touch the string benchmarks, which were not using the
generic container benchmark functions previously.
2025-01-30 15:02:34 -05:00
Peng Liu
edc3dc6abd
[libc++] Optimize ranges::copy_backward for vector<bool>::iterator (#121026)
As a follow-up to #121013 (which focused on `std::ranges::copy`), this
PR optimizes the performance of `std::ranges::copy_backward` for
`vector<bool>::iterator`, addressing a subtask outlined in issue #64038.
The optimizations yield performance improvements of up to 2000x for
aligned copies and 60x for unaligned copies.
2025-01-30 14:55:05 -05:00
Louis Dionne
b552e35a06 [libc++] Forward-proof some tests for AppleClang 17 2025-01-30 12:47:14 -05:00
Peng Liu
5b65896ad6
[libc++] Optimize ranges::copy{, _n} for vector<bool>::iterator (#121013)
This PR optimizes the performance of `std::ranges::copy` and
`std::ranges::copy_n` specifically for `vector<bool>::iterator`,
addressing a subtask outlined in issue #64038. The optimizations yield
performance improvements of up to **2000x** for aligned copies and
**60x** for unaligned copies. Additionally, new tests have been added to
validate these enhancements.


- Aligned source-destination bits

ranges::copy
```
--------------------------------------------------------------------------
Benchmark                                Before        After   Improvement
--------------------------------------------------------------------------
bm_ranges_copy_vb_aligned/8              10.8 ns      1.42 ns           8x
bm_ranges_copy_vb_aligned/64             88.5 ns      2.28 ns          39x
bm_ranges_copy_vb_aligned/512             709 ns      1.95 ns         364x
bm_ranges_copy_vb_aligned/4096           5568 ns      5.01 ns        1111x
bm_ranges_copy_vb_aligned/32768         44754 ns      38.7 ns        1156x
bm_ranges_copy_vb_aligned/65536         91092 ns      73.2 ns        1244x
bm_ranges_copy_vb_aligned/102400       139473 ns       127 ns        1098x
bm_ranges_copy_vb_aligned/106496       189004 ns      81.5 ns        2319x
bm_ranges_copy_vb_aligned/110592       153647 ns      71.1 ns        2161x
bm_ranges_copy_vb_aligned/114688       159261 ns      70.2 ns        2269x
bm_ranges_copy_vb_aligned/118784       181910 ns      73.5 ns        2475x
bm_ranges_copy_vb_aligned/122880       174117 ns      76.5 ns        2276x
bm_ranges_copy_vb_aligned/126976       176020 ns      82.0 ns        2147x
bm_ranges_copy_vb_aligned/131072       180757 ns       137 ns        1319x
bm_ranges_copy_vb_aligned/135168       190342 ns       158 ns        1205x
bm_ranges_copy_vb_aligned/139264       192831 ns       103 ns        1872x
bm_ranges_copy_vb_aligned/143360       199627 ns      89.4 ns        2233x
bm_ranges_copy_vb_aligned/147456       203881 ns      88.6 ns        2301x
bm_ranges_copy_vb_aligned/151552       213345 ns      88.4 ns        2413x
bm_ranges_copy_vb_aligned/155648       216892 ns      92.9 ns        2335x
bm_ranges_copy_vb_aligned/159744       222751 ns      96.4 ns        2311x
bm_ranges_copy_vb_aligned/163840       225995 ns       173 ns        1306x
bm_ranges_copy_vb_aligned/167936       235230 ns       202 ns        1165x
bm_ranges_copy_vb_aligned/172032       244093 ns       131 ns        1863x
bm_ranges_copy_vb_aligned/176128       244434 ns       111 ns        2202x
bm_ranges_copy_vb_aligned/180224       249570 ns       108 ns        2311x
bm_ranges_copy_vb_aligned/184320       254538 ns       108 ns        2357x
bm_ranges_copy_vb_aligned/188416       261817 ns       113 ns        2317x
bm_ranges_copy_vb_aligned/192512       269923 ns       125 ns        2159x
bm_ranges_copy_vb_aligned/196608       273494 ns       210 ns        1302x
bm_ranges_copy_vb_aligned/200704       280035 ns       269 ns        1041x
bm_ranges_copy_vb_aligned/204800       293102 ns       231 ns        1269x
```

ranges::copy_n
```
--------------------------------------------------------------------------
Benchmark                                Before        After   Improvement
--------------------------------------------------------------------------
bm_ranges_copy_n_vb_aligned/8            11.8 ns       0.89 ns         13x
bm_ranges_copy_n_vb_aligned/64           91.6 ns       2.06 ns         44x
bm_ranges_copy_n_vb_aligned/512           718 ns       2.45 ns        293x
bm_ranges_copy_n_vb_aligned/4096         5750 ns       5.02 ns       1145x
bm_ranges_copy_n_vb_aligned/32768       45824 ns       40.9 ns       1120x
bm_ranges_copy_n_vb_aligned/65536       92267 ns       73.8 ns       1250x
bm_ranges_copy_n_vb_aligned/102400     143267 ns       125 ns        1146x
bm_ranges_copy_n_vb_aligned/106496     148625 ns      82.4 ns        1804x
bm_ranges_copy_n_vb_aligned/110592     154817 ns      72.0 ns        2150x
bm_ranges_copy_n_vb_aligned/114688     157953 ns      70.4 ns        2244x
bm_ranges_copy_n_vb_aligned/118784     162374 ns      71.5 ns        2270x
bm_ranges_copy_n_vb_aligned/122880     168638 ns      72.9 ns        2313x
bm_ranges_copy_n_vb_aligned/126976     175596 ns      76.6 ns        2292x
bm_ranges_copy_n_vb_aligned/131072     181164 ns       135 ns        1342x
bm_ranges_copy_n_vb_aligned/135168     184697 ns       157 ns        1176x
bm_ranges_copy_n_vb_aligned/139264     191395 ns       104 ns        1840x
bm_ranges_copy_n_vb_aligned/143360     194954 ns      88.3 ns        2208x
bm_ranges_copy_n_vb_aligned/147456     208917 ns      86.1 ns        2426x
bm_ranges_copy_n_vb_aligned/151552     211101 ns      87.2 ns        2421x
bm_ranges_copy_n_vb_aligned/155648     213175 ns      89.0 ns        2395x
bm_ranges_copy_n_vb_aligned/159744     218988 ns      86.7 ns        2526x
bm_ranges_copy_n_vb_aligned/163840     225263 ns       156 ns        1444x
bm_ranges_copy_n_vb_aligned/167936     230725 ns       184 ns        1254x
bm_ranges_copy_n_vb_aligned/172032     235795 ns       119 ns        1981x
bm_ranges_copy_n_vb_aligned/176128     241145 ns       101 ns        2388x
bm_ranges_copy_n_vb_aligned/180224     250680 ns      99.5 ns        2519x
bm_ranges_copy_n_vb_aligned/184320     262954 ns      99.7 ns        2637x
bm_ranges_copy_n_vb_aligned/188416     258584 ns       103 ns        2510x
bm_ranges_copy_n_vb_aligned/192512     267190 ns       125 ns        2138x
bm_ranges_copy_n_vb_aligned/196608     270821 ns       213 ns        1271x
bm_ranges_copy_n_vb_aligned/200704     279532 ns       262 ns        1067x
bm_ranges_copy_n_vb_aligned/204800     283412 ns       222 ns        1277x
```

- Unaligned source-destination bits
```
--------------------------------------------------------------------------------
Benchmark                                    Before           After  Improvement
--------------------------------------------------------------------------------
bm_ranges_copy_vb_unaligned/8               12.8 ns         8.59 ns         1.5x
bm_ranges_copy_vb_unaligned/64              98.2 ns         8.24 ns          12x
bm_ranges_copy_vb_unaligned/512              755 ns         18.1 ns          42x
bm_ranges_copy_vb_unaligned/4096            6027 ns          102 ns          59x
bm_ranges_copy_vb_unaligned/32768          47663 ns          774 ns          62x
bm_ranges_copy_vb_unaligned/262144        378981 ns         6455 ns          59x
bm_ranges_copy_vb_unaligned/1048576      1520486 ns        25942 ns          59x
bm_ranges_copy_n_vb_unaligned/8             11.3 ns         8.22 ns         1.4x
bm_ranges_copy_n_vb_unaligned/64            97.3 ns         7.89 ns          12x
bm_ranges_copy_n_vb_unaligned/512            747 ns         18.1 ns          41x
bm_ranges_copy_n_vb_unaligned/4096          5932 ns         99.0 ns          60x
bm_ranges_copy_n_vb_unaligned/32768        47776 ns         749 ns           64x
bm_ranges_copy_n_vb_unaligned/262144      378802 ns        6576 ns           58x
bm_ranges_copy_n_vb_unaligned/1048576    1547234 ns       26229 ns           59x
```
2025-01-30 17:26:26 +01:00
Nikolas Klauser
956cfa69b1
[libc++] Refactor num_get optimization to not be ABI breaking (#121690)
```
----------------------------------------------------
Benchmark                             old        new
----------------------------------------------------
BM_num_get<bool>                  81.8 ns    79.6 ns
BM_num_get<long>                  80.2 ns    75.4 ns
BM_num_get<long long>             81.5 ns    76.4 ns
BM_num_get<unsigned short>        82.5 ns    78.4 ns
BM_num_get<unsigned int>          82.8 ns    78.6 ns
BM_num_get<unsigned long>         81.2 ns    78.1 ns
BM_num_get<unsigned long long>    83.6 ns    76.7 ns
BM_num_get<float>                  119 ns     120 ns
BM_num_get<double>                 113 ns     109 ns
BM_num_get<long double>            115 ns     119 ns
BM_num_get<void*>                  147 ns     139 ns
```
2025-01-30 10:45:47 +01:00
gulfemsavrun
62f6d637c0
[libc++] Add clang-21 to failing tests on Windows (#124955)
After we switched to LLVM version 21, some libc++ tests started failing
on Windows. This patch adds the clang-21 condition to XFAIL to fix the
issue.
2025-01-29 14:55:32 -08:00
Nikolas Klauser
608012ace4
[libc++] Simplify the implementation of iostream.cpp (#124103)
This refactors the standard stream implementation in multiple ways:
- The streams are now `stream_data` structs, which contain all the data
required for a stream
- The windows mangling is generated via a macro instead of having magic
strings for the different streams. (i.e. it's now only partially magic)
2025-01-29 21:24:58 +01:00
Peng Liu
67752f6191
[libc++] Simplify vector<bool>::__construct_at_end (#119632)
This patch simplifies the implementation of `__construct_at_end` in
`vector<bool>`, which currently contains duplicate initialization logic
across its two overloads.
2025-01-29 11:46:57 -05:00
Nikolas Klauser
bfabd5be53
[libc++] Remove some private symbols from the ABI (#121497)
These symbols are never referenced directly outside the dylib, so we can
make them hidden instead. They are still in the dylib since can be
referenced through the `memory_resource*`, but dynamic linkers don't
have to do any work to deduplicate them.
2025-01-29 10:25:23 -05:00
Martin Storsjö
86e20b00c3
[libcxx] Use _ftelli64/_fseeki64 on Windows (#123128)
This allows using the full 64 bit range for file offsets.

This should fix the issue reported downstream at
https://github.com/mstorsjo/llvm-mingw/issues/462.
2025-01-29 15:25:43 +02:00