Commit Graph

1433 Commits

Author SHA1 Message Date
Hristo Hristov
03c19e91e8
[libc++][numeric] P0543R3: Saturation arithmetic (#77967)
Implements: https://wg21.link/P0543R3
- https://eel.is/c++draft/numeric.sat

Additional references:
- Division: https://eel.is/c++draft/expr.mul#4
- Arithmetic conversions: https://eel.is/c++draft/expr.arith.conv#1
- Clang builtins:
https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions

Depends on: https://github.com/llvm/llvm-project/pull/78086

---------

Co-authored-by: Zingam <zingam@outlook.com>
Co-authored-by: Mark de Wever <zar-rpg@xs4all.nl>
2024-01-22 06:57:45 +02:00
Mark de Wever
04757337cd
[libc++][modules] Improves std.compat module. (#76330)
Let the std.compat module use the std module instead of duplicating the
exports.

Based on @ChuanqiXu9's suggestion in #71438.
2024-01-21 12:15:15 +01:00
Mark de Wever
1d6b6132ff [libc++] Reland CI module improvements.
Revert "Revert #76246 and #76083"

This reverts commit 5c150e7eeb.

Adds a small fix that should properly disable the tests on Windows.
Unfortunately the original poster has not provided feedback and the
original patch did not fail in the LLVM CI infrastructure.

Modules are known to fail on Windows due to non compliance of the
C library. Currently not having this patch prevents testing on other
platforms.
2024-01-21 12:10:36 +01:00
Hristo Hristov
7d9b5aa65b
[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>
2024-01-21 12:30:25 +02:00
Hristo Hristov
3412bc7658
[libc++][variant] P2637R3: Member visit (std::variant) (#76447)
Implements parts of: `P2637R3` https://wg21.link/P2637R3
(https://eel.is/c++draft/variant.visit)

Implements:
`variant.visit()`
`variant.visit<R>()`

The tests are as close as possible to the non-member function.

To land after: https://github.com/llvm/llvm-project/pull/76268

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-21 07:16:51 +02:00
Hristo Hristov
dbbeee6b83
[libc++][span] P2447R4: std::span over an initializer list (#78157)
Implements: https://wg21.link/P2447R6
- https://eel.is/c++draft/span.syn
- https://eel.is/c++draft/span.overview
- https://eel.is/c++draft/span.cons
- https://eel.is/c++draft/diff

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-20 06:09:46 +02:00
Daniel Thornburgh
5c150e7eeb Revert #76246 and #76083
These cause test build failures on Windows.

This reverts the following commits:
  57ca748435
  d06ae33ec3
2024-01-18 15:07:33 -08:00
Dominik Wójt
7f05153236
[libc++] Un-xfail module tests in picolibc tests (#78580)
Some of the module tests now pass after picolibc update.
https://github.com/llvm/llvm-project/pull/77908

The remaining tests fail and are now set to xfail on picolibc
specifically.
2024-01-18 18:40:52 +01:00
Konstantin Varlamov
8dfc67d672
[libc++][hardening] Rework how the assertion handler can be overridden. (#77883)
Previously there were two ways to override the verbose abort function
which gets called when a hardening assertion is triggered:
- compile-time: define the `_LIBCPP_VERBOSE_ABORT` macro;
- link-time: provide a definition of `__libcpp_verbose_abort` function.

This patch adds a new configure-time approach: the vendor can provide
a path to a custom header file which will get copied into the build by
CMake and included by the library. The header must provide a definition
of the
`_LIBCPP_ASSERTION_HANDLER` macro which is what will get called should
a hardening assertion fail. As of this patch, overriding
`_LIBCPP_VERBOSE_ABORT` will still work, but the previous mechanisms
will be effectively removed in a follow-up patch, making the
configure-time mechanism the sole way of overriding the default handler.

Note that `_LIBCPP_ASSERTION_HANDLER` only gets invoked when a hardening
assertion fails. It does not affect other cases where
`_LIBCPP_VERBOSE_ABORT` is currently used (e.g. when an exception is
thrown in the `-fno-exceptions` mode).

The library provides a default version of the custom header file that
will get used if it's not overridden by the vendor. That allows us to
always test the override mechanism and reduces the difference in
configuration between the pristine version of the library and
a platform-specific version.
2024-01-17 18:56:07 -08:00
Mark de Wever
e6ac33b936
[libc++][modules] Increase clang-tidy version used. (#76268)
As suggested in #71438 we should use
  export import std;
in the std.compat module.

Testing this locally failed when building with the clang-tidy-17 plugin.
The std module was considered corrupt in the test
  libcxx/test/libcxx/module_std_compat.gen.py
however the test
  libcxx/test/libcxx/module_std.gen.py
passed. Both test generated identical std.pcm files. Using the
clang-tidy-18 plugin solves the issue.
2024-01-17 08:18:36 +01:00
Mark de Wever
57ca748435
[libc++][modules] Adds module testing. (#76246)
This adds a new module test infrastructure. This requires tagging tests
using modules. The test runner uses this information to determine the
compiler flags needed to build and use the module.

Currently modules are build per test, which allows testing them for
tests with ADDITIONAL_COMPILE_FLAGS. At the moment only 4 tests use
modules. Therefore the performance penalty is not measurable. If in the
future more tests use modules it would be good to measure the overhead
and determine whether it's acceptable.
2024-01-17 08:15:18 +01:00
Mark de Wever
d06ae33ec3
[libc++][modules] Removes module testing. (#76083)
This removes the entire modules testing infrastructure.

The current infrastructure uses CMake to generate the std and std.compat
module. This requires quite a bit of plumbing and uses CMake. Since
CMake introduced module support in CMake 3.26, modules have a higher
CMake requirement than the rest of the LLVM project. (The LLVM project
requires 3.20.) The main motivation for this approach was how libc++
generated its modules. Every header had its own module partition. This
was changed to improve performance and now only two modules remain. The
code to build these can be manually crafted.

A followup patch will reenable testing modules, using a different
approach.
2024-01-17 08:11:25 +01:00
Louis Dionne
127c390fc4
[libc++] Rewrite the IWYU generation (#78295)
This simplifies the IWYU generation script by treating everything as a
file, instead of dealing with directories and files separately.

This has the downside that the `libcxx.imp` file is a lot larger than it
used to be, however we now have the flexibility of mapping files under
detail directories to different public headers. For example, this allows
us to map <__fwd/subrange.h> to <ranges> but <__fwd/pair.h> to
<utility>.

This patch also adds basic validation to ensure that we never map a
header to a public header that doesn't exist. We may still be missing
some mappings or we may be mapping to incorrect headers, but we won't be
mapping to headers that downright don't exist.

Fixes #63346
2024-01-16 13:45:05 -05:00
Mark de Wever
4a87db6b10
[libc++][print] Enables it on Apple backdeployment. (#76293)
As suggested in #73262 this enable the stream printing on Apple
backdeployment targets. This omits the check whether the file is a
terminal. This is not entirely conforming, but the differences should be
minor and are typically not observable.

Fixes https://github.com/llvm/llvm-project/issues/75225
2024-01-16 19:14:33 +01:00
Dominik Wójt
2b2310484f
[libc++] tests with picolibc: update picolibc (#77908)
The updated picolibc version has "isblank" function with external
linkage. This is required for C++ modules support.

This should solve all the problems reported in #76980, but
we'll wait to validate this with the modules build without
closing that issue.
2024-01-12 17:32:04 -05:00
Ryan Prichard
4c41449edd
[libc++][Android] Add NDK ABI lists for i686 and x86_64 (#69272)
This commit adds ABI lists for the Android NDK.

Fixes: https://github.com/llvm/llvm-project/issues/69270
Differential Revision: https://reviews.llvm.org/D155341
2024-01-12 13:00:16 -08:00
Louis Dionne
8f90e6937a
[runtimes] Use LLVM libunwind from libc++abi by default (#77687)
I recently came across LIBCXXABI_USE_LLVM_UNWINDER and was surprised to
notice it was disabled by default. Since we build libunwind by default
and ship it in the LLVM toolchain, it would seem to make sense that
libc++ and libc++abi rely on libunwind for unwinding instead of using
the system-provided unwinding library (if any).

Most importantly, using the system unwinder implies that libc++abi is
ABI compatible with that system unwinder, which is not necessarily the
case. Hence, it makes a lot more sense to instead default to using the
known-to-be-compatible LLVM unwinder, and let vendors manually select a
different unwinder if desired.

As a follow-up change, we should probably apply the same default to
compiler-rt.

Differential Revision: https://reviews.llvm.org/D150897
Fixes #77662
rdar://120801778
2024-01-11 10:13:21 -05:00
Will Hawkins
d301539b77
[libc++][docs] Document the libc++ Lit testing format naming scheme (#73136)
As a new contributor, I found it hard to find the documentation for the
meaning of the names of different tests and how those names translate to
Lit. This patch moves the documentation to the RST documentation we
publish on the website instead of leaving it in the source code only.
2024-01-10 10:51:06 -05:00
Louis Dionne
ca06c330fd
[libc++] Allow running the test suite with optimizations (#68753)
This patch adds a configuration of the libc++ test suite that enables
optimizations when building the tests. It also adds a new CI
configuration to exercise this on a regular basis. This is added in the
context of [1], which requires building with optimizations in order to
hit the bug.

[1]: https://github.com/llvm/llvm-project/issues/68552
2024-01-09 10:39:14 -05:00
David Spickett
acbb491ab2
[libcxx] Require qemu-system-arm for armv7m builder (#77067)
And add a check in the python script that the binary given to `--qemu`
actually exists. Otherwise you get a generic Python error:
```
 # .---command stderr------------
 # | Traceback (most recent call last):
 # |   File "/home/david.spickett/modules-llvm-project/libcxx/utils/qemu_baremetal.py", line 70, in <module>
 # |     exit(main())
 # |   File "/home/david.spickett/modules-llvm-project/libcxx/utils/qemu_baremetal.py", line 66, in main
 # |     os.execvp(qemu_commandline[0], qemu_commandline)
 # |   File "/usr/lib/python3.8/os.py", line 568, in execvp
 # |     _execvpe(file, args)
 # |   File "/usr/lib/python3.8/os.py", line 610, in _execvpe
 # |     raise last_exc
 # |   File "/usr/lib/python3.8/os.py", line 601, in _execvpe
 # |     exec_func(fullname, *argrest)
 # | FileNotFoundError: [Errno 2] No such file or directory
 # `-----------------------------
 # error: command failed with exit status: 1
```
When it tries to run the entire command later.

For the builder, it's only ever going to use qemu-system-arm so error at
config time if it's not there.
2024-01-08 08:55:39 +00:00
Hristo Hristov
92e243173c
Reapply "[libc++][streams] P1759R6: Native handles and file streams" (#77190)
Fixes build on Windows in C++26 mode.

Reverted in:
40c07b559a
Original PR: https://github.com/llvm/llvm-project/pull/76632

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-07 18:01:03 +02:00
Haowei Wu
40c07b559a Revert "[libc++][streams] P1759R6: Native handles and file streams (#76632)"
This reverts commit 255f95a403, which
contains a breaking libcxx test on Windows when using C++26
2024-01-05 17:23:40 -08:00
Hristo Hristov
255f95a403
[libc++][streams] P1759R6: Native handles and file streams (#76632)
Implements: `P1759R6` https://wg21.link/P1759R6

- https://eel.is/c++draft/filebuf
- https://eel.is/c++draft/ifstream
- https://eel.is/c++draft/ofstream
- https://eel.is/c++draft/fstream

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-05 11:42:08 +02:00
Hristo Hristov
a72ab9c14d
[libc++][span] P2821R5: span.at() (#74994)
- Implements: [P2821R5: span.at()](https://wg21.link/P2821R5)
  (https://eel.is/c++draft/views.contiguous#views.span)
- Cleaned up `span.operator[]` test

---------

Co-authored-by: Zingam <zingam@outlook.com>
2024-01-05 11:41:22 +02:00
Mark de Wever
2fd4084fca
[libc++][print] Adds ostream overloads. (#73262)
Finishes implementation of
- P2093R14 Formatted output
- P2539R4 Should the output of std::print to a terminal be synchronized
with the underlying stream?

Differential Revision: https://reviews.llvm.org/D156609
2023-12-19 19:32:17 +01:00
Dominik Wójt
e60167927b
[libc++] Add a picolibc test configuration with exceptions enabled (#75462) 2023-12-18 10:25:50 -05:00
Mark de Wever
9c18f03196
[libc++] Adds headers to FTM. (#75699)
These feature-test macros had no headers listed in their associated
papers. This adds the expected headers.

Fixes https://github.com/llvm/llvm-project/issues/75577
2023-12-18 12:43:10 +01:00
Stephan T. Lavavej
64addd6521
[libc++][test] Enhance ADDITIONAL_COMPILE_FLAGS, use TEST_MEOW_DIAGNOSTIC_IGNORED sparingly (#75317)
This is the last PR that's needed (for now) to get libc++'s tests
working with MSVC's STL.

The ADDITIONAL_COMPILE_FLAGS machinery is very useful, but also very
problematic for MSVC, as it doesn't understand most of Clang's compiler
options. We've been dealing with this by simply marking anything that
uses ADDITIONAL_COMPILE_FLAGS as FAIL or SKIPPED, but that creates
significant gaps in test coverage.

Fortunately, ADDITIONAL_COMPILE_FLAGS also supports "features", which
can be slightly enhanced to send Clang-compatible and MSVC-compatible
options to the right compilers.

This patch adds the gcc-style-warnings and cl-style-warnings Lit features,
and uses that to pass the appropriate warning flags to tests. It also uses
TEST_MEOW_DIAGNOSTIC_IGNORED for a few local suppressions of MSVC
warnings.
2023-12-14 17:38:27 -05:00
Louis Dionne
4bd32cc445
[libc++] Remove anchors for agent queues from the BuildKite pipeline configuration (#75359)
We didn't save that much boilerplate with those anchors, but it made the
pipeline description harder to understand because the definition of the
jobs and the agents they run on were so far apart. Anchors are useful
for the other common boilerplate we truly share between all jobs, but it
seems reasonable to define agent queues in-line.
2023-12-14 09:52:42 -05:00
Louis Dionne
f0d4811690
[libc++] Add CI job for testing macOS C++03 (#75355)
It's not that I have much love for C++03, but we should ensure that it
works. Some recent changes broke this configuration because slightly
older Clang versions don't support attribute syntax in C++03 mode.
2023-12-13 18:05:36 -05:00
Mark de Wever
7d34f8c09e
[libc++][module] Fixes std::string UDL. (#75000)
The fix changes the way the validation script determines the qualified
name of a declaration. Inline namespaces without a reserved name are now
always part of the name. The Clang code only does this when the names
are ambigious. This method is often used for the operator""foo for UDLs.

Adjusted the newly flagged issue and removed a work-around in the test
code that is no longer required.

Fixes https://github.com/llvm/llvm-project/issues/72427
2023-12-12 22:17:02 +01:00
Mark de Wever
ed210f9f5a
[libc++][CI] Tests the no RTTI configuration. (#65518)
There are a few drive-by fixes:
- Since the combination RTTI disabled and exceptions enabled do not
work, this combination is prohibited.
- A small NFC in any fixing clang-tidy.

The code in the Buildkite configuration is prepared for using the std
module. There are more fixes needed for that configuration which will be
done in a separate commit.
2023-12-12 17:11:53 +01:00
Mark de Wever
600462a2db
[libc++][modules] Adds std.compat module. (#71438)
This adds the std.compat module. The patch contains a bit of refactoring
to avoid code duplication between the std and std.compat module.

Implements parts of
- P2465R3 Standard Library Modules std and std.compat
2023-12-09 13:51:50 +01:00
Louis Dionne
8908296b62 [libc++][NFC] Move 32-bit pointer Lit feature check where it belongs
It was previously defined in the block where we defined back-deployment
features.
2023-12-08 09:43:42 -05:00
Stephan T. Lavavej
3aee4a9628
[libc++] Update <source_location> and msvc_stdlib_force_include.h (#74266)
This makes libc++'s <filesystem> tests compatible with MSVC's STL.

In msvc_stdlib_force_include.h, we need to define 3 more macros:

- _CRT_DECLARE_NONSTDC_NAMES activates the POSIX names of
  `getcwd` etc. As the comment explains, we need this because
  we test with Clang `-fno-ms-compatibility`, which defines 
  `__STDC__` to `1`, which causes the UCRT headers to disable 
  the POSIX names by default.
- Then we need _CRT_NONSTDC_NO_WARNINGS to avoid emitting
  deprecation warnings about the POSIX names.
- Finally, we need `NOMINMAX` to seal away the ancient evil.

These macros are documented in https://learn.microsoft.com/en-us/cpp/c-runtime-library/compatibility?view=msvc-170.

As a drive-by change, the patch adds a "simulated" macro for 
__has_feature(hwaddress_sanitizer). It also clang-formats all
of msvc_stdlib_force_include.h and removes guards for
__has_builtin(__builtin_source_location) in <source_location>,
since those are not needed anymore.
2023-12-06 09:04:06 -05:00
Louis Dionne
9eea744183
[libc++] Add a merge driver that can apply clang-format (#73712)
In preparation for the moment when we'll clang-format the whole code
base, this patch adds a script that can be used to rebase patches across
clang-format changes mechanically, without requiring manual
intervention.

See https://discourse.llvm.org/t/rfc-clang-formatting-all-of-libc-once-and-for-all.
2023-12-04 15:24:37 -05:00
Louis Dionne
b18a46e35d
[libc++][NFC] Add a few clang-format annotations (#74352)
This is in preparation for clang-formatting the whole code base. These
annotations are required either to avoid clang-format bugs or because
the manually formatted code is significantly more readable than the
clang-formatted alternative. All in all, it seems like very few
annotations are required, which means that clang-format is doing a very
good job in most cases.
2023-12-04 15:17:31 -05:00
Stephan T. Lavavej
c000f754bf
[libc++][test] Avoid non-Standard zero-length arrays (#74183)
Found while running libc++'s test suite with MSVC's STL, where we use
both MSVC's compiler and Clang/LLVM.

MSVC's compiler rejects the non-Standard extension of zero-length
arrays. For conformance, I'm changing these occurrences to
`std::array<int, 0>`.

Many of these files already had `#include <array>`; I'm adding it to the
rest.

I wanted to add `-Wzero-length-array` to
`libcxx/utils/libcxx/test/params.py` to prevent future occurrences, but
it complained about product code 😿 :

```
In file included from /home/runner/_work/llvm-project/llvm-project/libcxx/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/long.pass.cpp:18:
In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/istream:170:
In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/ostream:172:
In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__system_error/error_code.h:18:
In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__system_error/error_category.h:15:
/home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:811:25: error: zero size arrays are an extension [-Werror,-Wzero-length-array]
  811 |         char __padding_[sizeof(value_type) - 1];
      |                         ^~~~~~~~~~~~~~~~~~~~~~
/home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:817:19: note: in instantiation of member class 'std::basic_string<char>::__short' requested here
  817 |     static_assert(sizeof(__short) == (sizeof(value_type) * (__min_cap + 1)), "__short has an unexpected size.");
      |                   ^
/home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/string:2069:5: note: in instantiation of template class 'std::basic_string<char>' requested here
 2069 |     _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST(_LIBCPP_DECLARE, char)
      |     ^
/home/runner/_work/llvm-project/llvm-project/build/generic-cxx03/include/c++/v1/__string/extern_template_lists.h:31:60: note: expanded from macro '_LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST'
   31 |   _Func(_LIBCPP_EXPORTED_FROM_ABI basic_string<_CharType>& basic_string<_CharType>::replace(size_type, size_type, value_type const*, size_type)) \
      |                                                            ^
```

I pushed a tiny commit to fix unrelated comment typos, in an attempt to
clear out spurious CI failures.
2023-12-03 10:47:09 +01:00
Stephan T. Lavavej
8f018d3ca0
[libc++][test] Make the feature-test macro tests more portable (#74185)
Found while running libc++'s test suite with MSVC's STL.

This is a followup to @philnik777's recent #71002 (thank you!) which
provided the existing examples of `__cpp_lib_barrier` and
`__cpp_lib_polymorphic_allocator`:

66a3e4fafb/libcxx/utils/generate_feature_test_macro_components.py (L199-L203)

66a3e4fafb/libcxx/utils/generate_feature_test_macro_components.py (L866-L870)

Applying that new pattern to the feature-test macros here gets their
corresponding tests passing for us.

🤖 Only `generate_feature_test_macro_components.py` was manually
updated; the other files were regenerated.
2023-12-02 17:41:23 -08:00
eric
1a013b61dc Allow libc++ image tag to be specified via enviroment variables.
This change is needed for changes I'm working on that allow
github workflows to build, push, and otherwise manage the container
images they use
2023-12-01 14:34:36 -05:00
Stephan T. Lavavej
4e2216e184
[libc++][test] ADDITIONAL_COMPILE_FLAGS should be a space-separated list (#73541)
Found while running libc++'s test suite with MSVC's STL.

`ADDITIONAL_COMPILE_FLAGS` is a `ParserKind.LIST`:

3c23ed156f/libcxx/utils/libcxx/test/format.py (L104-L108)

With a comma-separated example:

3c23ed156f/libcxx/utils/libcxx/test/format.py (L223-L228)

And comma-separated test coverage:

dd3184c30f/libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-run.sh.cpp (L12-L15)

Because the machinery splits on commas:

dd09221a29/llvm/utils/lit/lit/TestRunner.py (L1882-L1883)

dd09221a29/llvm/utils/lit/lit/TestRunner.py (L1951-L1956)

However, most (although not all) usage of `ADDITIONAL_COMPILE_FLAGS` is
treating it as space-separated. That apparently works in the normal
Clang environment, but in my exotic configuration it causes `"-DMEOW
-DWOOF"` to be passed as a single argument to MSVC, which then emits
"warning C5102: ignoring invalid command-line macro definition
`'_LIBCPP_DISABLE_DEPRECATION_WARNINGS
-D_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT'`", causing test failures due to
warnings-as-errors.

This PR changes `ADDITIONAL_COMPILE_FLAGS` to actually be parsed as a
space-separated list, and changes the few uses/examples that had commas.
2023-11-30 13:54:52 -08:00
Hui
6677f029b2
[libc++] Workaround linker errors in floating-point atomic tests (#73398)
We now add -latomic whenever we detect that it's supported on the platform,
and we mark the tests as UNSUPPORTED on platforms where non-lockfree
atomics are not supported.
2023-11-30 09:18:30 -05:00
Eric
9ac64abc02
[libc++] Remove linux Buildkite builders entirely (#73825)
This removes the Google hosted Linux buildkite builders. We have since
moved all of them over to github actions.

Follow up changes will be sent for android.
2023-11-29 17:34:45 -05:00
Mark de Wever
16b8c9608f
[libc++][format] Fixes formatting code units as integers. (#73396)
This paper was voted in as a DR, so it's retroactively enabled back to
C++20; the C++ version that introduced std::format.

Implements:
- P2909R4 Fix formatting of code units as integers (Dude, where’s my
``char``?)
2023-11-29 17:55:09 +01:00
Michael Platings
8aeacebf28 [libc++] Add initial support for picolibc
Picolibc is a C Standard Library that is commonly used in embedded
environments. This patch adds initial support for this configuration
along with pre-commit CI. As of this patch, the test suite only builds
the tests and nothing is run. A follow-up patch will make the test suite
actually run the tests.

Differential Revision: https://reviews.llvm.org/D154246
2023-11-29 10:43:16 -05:00
Stephan T. Lavavej
0d3c40b82b
[libc++] Remove unused Python imports (#73724)
VSCode's Pylance extension informed me, and text searching confirmed,
that these imports are unused. I believe we should be able to remove
them harmlessly.
2023-11-29 09:25:06 -05:00
Louis Dionne
e666e27485
[libc++] Move compiler-detection Lit features first (#73544)
Lit features are evaluated in order. Some checks may require the
compiler detection to have run first in order to work properly, for
example some checks being added in https://reviews.llvm.org/D154246
which require GCC to have been detected. It is kind of brittle to rely
on such ordering, but in practice moving the compiler detection first
should never hurt.
2023-11-27 15:53:35 -05:00
Louis Dionne
12bb2910c3
[libc++] Remove experimental pmr headers now shipped in mainline (#73172)
Several experimental headers around std::pmr have been slated for
removal for a while now. This patch actually performs the removal and
cleanups from the code base.
2023-11-27 10:54:35 -05:00
philnik777
1314e8774f
[libc++] Add missing headers to the modulemap (#71127)
I don't know when, but at some point we lost test coverage to ensue that
all the headers are in the modulemap. This adds a test to make sure all
the headers (excluding a few which shouldn't be part of the modulemap)
are at least mentioned. This also fixes a few headers which bit-rotted
while we were missing the coverage.
2023-11-27 00:14:59 +01:00
philnik777
12563ea640
[libc++][NFC] Refactor _LIBCPP_AVAILABILITY_HAS_* macros to always be defined (#71002)
This makes the conditionals quite a bit simpler to understand, since it
avoids double negatives and makes sure we have <__availability>
included. For vendors which use availability macros, it also enforces
that they check when specific features are introduced and define the
macro for their platform appropriately.
2023-11-24 23:45:17 +01:00