The CI can no longer run with clang-tidy 16 increment it to version 17.
Whether permanently moving to the latest development version is being
discussed on Discourse.
Depends on D149455
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D151628
Module require Clang 17, since Clang 16 requires the magic # __FILE__
line. Therefore, if available, use clang-tidy 17 too. This change should
be reverted after LLVM 17 is released.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D149455
This is an attempt to reduce the time taken by the Bootstrapping
build job and the Clang CI job that builds the compiler from scratch.
Differential Revision: https://reviews.llvm.org/D150908
This reduces the amount of boilerplate that we need to generate
for each commit. It also resolves a problem where the modular CI
would run extremely slow on this test because we'd define a macro
before including the standard library, defeating the module cache.
Differential Revision: https://reviews.llvm.org/D151156
A recurring problem recently has been that libc++ has several generated
tests which all need to be re-generated before committing a change. This
creates noise during code reviews and friction for contributors.
Furthermore, the way we generated most of these tests resulted in
extremely bad compilation times when using modules, because we defined
a macro before compiling each file.
This commit introduces a new kind of test called a '.gen' test. These
tests are normal shell tests, however the Lit test format will run the
test to discover the actual Lit tests it should run. This basically
allows generating a Lit test suite on the fly using arbitrary code,
which can be used in the future to generate tests like our __verbose_abort
tests and several others.
Differential Revision: https://reviews.llvm.org/D151258
This is an ongoing series of commits that are reformatting our
Python code.
Reformatting is done with `black`.
If you end up having problems merging this commit because you
have made changes to a python file, the best way to handle that
is to run git checkout --ours <yourfile> and then reformat it
with black.
If you run into any problems, post to discourse about it and
we will try to help.
RFC Thread below:
https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style
Reviewed By: #libc, kwk, Mordante
Differential Revision: https://reviews.llvm.org/D150763
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
The type traits parts are moved to a type_traits detail header.
This was discovered while working on modules.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D150538
Clang has been updated to support C++26, this adds the same support for
libc++. At the moment C++23 and C++26 are identical. During the next
plenary in June the first C++26 papers will be voted on.
Note like Clang this patch uses C++26 is the internal part and C++2c in
the user visible part.
Depends on D150795
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D151026
To make sure all member functions that require it are marked `_LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION` I compared the output of `objdump --syms lib/libc++.1.0.dylib` before and after, ignoring addresses.
Reviewed By: #libc, ldionne
Spies: Mordante, libcxx-commits, ldionne, arichardson, mstorsjo
Differential Revision: https://reviews.llvm.org/D150896
This will avoid hardcoding all unsupported targets, since even after one
more follow up fix [1], there is one more failure.
[1]: https://reviews.llvm.org/D150886
Plus, if you want to run it locally on some target that CI does not
covers, it could also false-positively fail, which is not good.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D151046
During the ISO C++ Committee meeting plenary session the C++23 Standard
has been voted as technical complete.
This updates the reference to c++2b to c++23 and updates the __cplusplus
macro.
Note since we use clang-tidy 16 a small work-around is needed. Clang
knows -std=c++23 but clang-tidy not so for now force the lit compiler
flag to use -std=c++2b instead of -std=c++23.
Reviewed By: #libc, philnik, jloser, ldionne
Differential Revision: https://reviews.llvm.org/D150795
For some reason the expected ignore_format.txt changed. This patch fixes it in trunk, but the problem is being investigated.
Reviewed By: #libc, Mordante
Spies: Mordante, libcxx-commits, arichardson
Differential Revision: https://reviews.llvm.org/D151115
The main change is to allow a UCS scalar value as fill character.
Especially for char based formatting this increase the number of valid
characters. Originally this was to be expected ABI breaking, however the
current change does not seem to break the ABI.
Implements
- P2572 std::format() fill character allowances
Depends on D144499
Reviewed By: ldionne, tahonermann, #libc
Differential Revision: https://reviews.llvm.org/D144742
This reverts commit ebc111b08bddca55d5f7e560a20bdb2c913d80cb.
Sorry, I forgot to append Phabricator reversion when land D140911, I try to revert this change and reland.
Reviewed By: #libc, ldionne, EricWF
Differential Revision: https://reviews.llvm.org/D150793
This patch adds std::extents. extents is one of the core classes used by std::mdspan. It describes a multi-dimensional index space with a mix of compile time and runtime sizes. Furthermore, it is templated on the index type used to describe the multi-dimensional index space.
The class is designed to be highly optimizable in performance critical code sections, and is fully useable in constant expressions contexts.
Testing of this class tends to be somewhat combinatorical, due to the large number of possible corner cases involved in situations where we have both runtime and compile time extents. To add to this, the class is designed to be interoperable (in particular constructible) from arguments which only need to be convertible to the index_type, but are otherwise arbitrary user types. For a larger discussion on the design of this class refer to: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html
Co-authored-by: Damien L-G <dalg24@gmail.com>
Reviewed By: ldionne, #libc
Spies: libcxx-commits, H-G-Hristov, tschuett, philnik, arichardson, Mordante, crtrott
Differential Revision: https://reviews.llvm.org/D148067
This was requested in the review of D145807, but I had missed to
apply it before landing the patch.
Differential Revision: https://reviews.llvm.org/D150444
The newer formatters for (tuple, vector<bool>::reference) specify the
formatter's parse and format member function. This signature is slightly
different from the signature for existing formatters. Adapt the existing
formatters to the new style.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D150034
The financial cost of the network I/O for the Clang install artifacts is
quite significant. afd3478f37c8 improved this by creating tarballs. This
commit improves the tarball by using xz compression instead of gzip. This
option is the slowest, but gives the smallest size.
size time time
(compression) (decompression)
gzip 51 M 7 s 1.2 s
bz2 44 M 17 s 5.8 s
xz 33 M 76 s 3.1 s
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D150062
Several tests undefined __DEPRECATED to avoid warnings as they're
testing the deprecated ext/hash_map. A better way to do this is to use
-Wno-deprecated so it isn't defined in the first place. This prevents
these tests from failing when we give a warning when undefining the
__DEPRECATED macro, as D144654 will do.
For the generated tests however just remove the testing of these
header files, so we don't disable the warning when testing the other
header files.
Differential Revision: https://reviews.llvm.org/D145691
This removes the need for a custom libc++ build to have a basic set of PSTL algorithms.
Reviewed By: ldionne, #libc
Spies: miyuki, libcxx-commits, arichardson
Differential Revision: https://reviews.llvm.org/D149624
This was contributed ~10 years ago, but we don't officially support it
and I am not aware of any bot testing it, so this has likely rotten to
the point where it is unusable.
Differential Revision: https://reviews.llvm.org/D138680
This is an attempt to reduce the insane amount of network we use when
uploading Clang binaries to Buildkite for other jobs to use. We think
that removing debug information will result in much smaller binaries.
When cuchar is compiled independently on platforms that don't have <uchar.h>, it doesn't get a declaration of mbstate_t, and so makes an empty declaration for ::mbstate_t. That conflicts with the declarations in __mbstate_t.h and cwchar since both of those headers do get mbstate_t before making ::mbstate_t.
Change `__mbstate_t.h` to just get the underlying declaration for mbstate_t and not make a declaration for ::mbstate_t. Include __mbstate_t.h in uchar.h and wchar.h when their next headers aren't available so that at least mbstate_t gets defined.
Add __std_mbstate_t.h to declare ::mbstate_t for headers that need that when cuchar or cwchar aren't available (because either _LIBCPP_HAS_NO_WIDE_CHARACTERS or _LIBCPP_CXX03_LANG).
Reviewed By: ldionne, Mordante, #libc, philnik
Differential Revision: https://reviews.llvm.org/D148542
On Windows, the PATH env variable is used for locating dynamically
linked librarys, akin to LD_LIBRARY_PATH on Linux.
The tests that run with a dynamically linked libc++ used "--env
PATH=%{lib}" in the test config. This had the unfortunate side effect
of making other tools from PATH unavailable during the runtime of the
tests; in particular, it caused the "executor-has-no-bash" flag to be
set for all those Windows test configs (with the clang-cl static config
being the only one lacking it).
Thus, this increases the number of tests actually included in the
clang-cl dll and all mingw test configs by 9 tests.
The clang-cl static test configuration has been executing those tests
since the "--env PATH=%{lib}" was removed from that test config in
e78223e79efc886ef6f0ea5413deab3737d6d63b. (For mingw we haven't had a
need to split the test config between shared and static, which means
that the mingw static test config previously ran with --env PATH
needlessly.)
This increases the test coverage for patches like D146398 which
can't be executed in the executor-has-no-bash configs.
Change the default value of the arg.env to an empty array; when we do
pass values to the option, they get passed as an array of strings,
so make sure the variable behaves consistently when no arguments
have been passed.
Differential Revision: https://reviews.llvm.org/D148324
No test actually does this, but this makes the option behave like
the corresponding one in run.py.
This was broken by commit b8b23aa80eefe84187d6ba364d06496c90c53bdb
(https://reviews.llvm.org/D99242) which introduced quoting; instead
of quoting the whole space separated list, quote each individual
argument.
Differential Revision: https://reviews.llvm.org/D149319