579 Commits

Author SHA1 Message Date
Joseph Huber
1484e0f16a
[libc] Use CMAKE_CROSSCOMPILING_EMULATOR instead searching for `llvm-gpu-loader' (#189417)
Summary:
We already handle this with other targets, we should be able to unify
the handling here.
2026-04-03 09:58:04 -05:00
Schrodinger ZHU Yifan
74c4243225
[libc][tsearch] add tsearch functions (#172625) 2026-03-30 17:51:36 -04:00
Zorojuro
15a7c45163
[libc][math][c23] Add asinbf16 math function (#184170)
Co-authored-by: bassiounix <muhammad.m.bassiouni@gmail.com>
2026-03-30 21:29:55 +02:00
Mohamed Emad
1bb03026b6
[libc][math][c23] implement double-precision asinpi (#188158)
Implement the double precision version of the asinpi c23 math function
2026-03-29 10:18:07 -04:00
Shikhar Soni
f0ce26d06d
[libc][math][c23] Add log2p1f16 C23 math function (#186754)
Signed-off-by: Shikhar Soni <shikharish05@gmail.com>
2026-03-28 11:34:42 -04:00
Jeff Bailey
030ef70908
[libc][docs] Document libc-shared-tests ninja target (#189062)
Added a brief description of the libc-shared-tests target to the
Building and Testing page.

This target allows running tests for shared standalone components like
math primitives without the full libc runtime.
2026-03-27 17:39:38 +00:00
Jeff Bailey
b2f5992412
[libc][docs][NFC] Document cross-compilation testing with QEMU (#188838)
Added a "Building and Testing with an Emulator" section to
full_cross_build.rst using riscv64 and qemu-riscv64 as the example.
Outlined necessary CMake flags for cross-compiling with Clang, including
CMAKE_C_COMPILER_TARGET, CMAKE_CXX_COMPILER_TARGET, and
LLVM_ENABLE_LLD=ON. Switched from CMAKE_SYSROOT to LIBC_KERNEL_HEADERS
and added the gcc-riscv64-linux-gnu package dependency to ensure sysroot
issues on Debian-based systems are avoided while retaining access to
cross-compiler runtime objects.

Explained the self-hosted libc-hermetic-tests target as the required
target for executing tests during a standalone cross build, since the
standard check-libc tests are not hermetic.

Refactored existing CMake examples in full_cross_build.rst to use -S and
-B flags instead of cd and mkdir.

Removed prompt characters from code blocks and separated host
environment setup into explicit code blocks for easier copy-pasting.
Also removed the initial 'cd llvm-project' directory changes to reduce
boilerplate.

Added a cross-reference to the new emulator section in
build_and_test.rst.
2026-03-27 15:14:38 +00:00
Jeff Bailey
9e6bd128f2
[libc][doc] Remove ToC incompatible with Furo (#188720)
Thanks to @Sukumarsawant for spotting this!
2026-03-26 13:42:03 +00:00
Jeff Bailey
4bfc9bd4cf
[libc][docs] Add guide for implementing a function (#188499)
Added implementing_a_function.rst providing a checklist for adding a new
function to LLVM-libc.

Updated dev/index.rst to include the new guide in the toctree.
2026-03-25 20:43:49 +00:00
Jeff Bailey
f0b58c16e1
[libc][docs][NFC] Expand entrypoints technical reference (#4) (#188255)
Expanded entrypoints.rst with details about definitions, registration
rules, and the lifecycle of an entrypoint.

Updated multiple documents to remove redundant technical details and
link to the centralized entrypoints reference:

- libc/docs/dev/cmake_build_rules.rst
- libc/docs/dev/implementation_standard.rst
- libc/docs/porting.rst
- libc/docs/dev/source_tree_layout.rst
2026-03-25 07:05:52 +00:00
Petter Berntsson
da439d5426
[libc][docs] Avoid docgen target collisions and restore pthread docs (#188221)
Fixes llvm/llvm-project#123821.

Re-enabling pthread docs created a global CMake utility target named
`pthread`, which collides in combined runtime builds where `pthread` is
expected to be a library name. Namespace the internal libc docgen helper
targets under `libc-docgen-*` and restore the generated pthread docs
page. `docs-libc-html` is unchanged.
2026-03-24 14:33:34 +00:00
Zorojuro
7d7cd745af
[libc][math][c23] Add atanbf16 function (#184019)
This PR intends to add atanbf16 higher math function for BFloat16 type
along with the tests.
2026-03-21 11:09:11 -04:00
Jeff Bailey
2b47497f6e
[libc][docs][NFC] Restructure Getting Started guide and update Build Concepts. (#187701)
Restructured the Getting Started guide into a numbered step-by-step path
for easier readability. Added a Hello World verification step to confirm
build integrity after build completion.

Additionally, updated build_concepts.rst and the Getting Started guide
to clarify that Overlay Mode is intended for augmenting the system's C
library rather than incremental adoption.
2026-03-21 00:56:38 +00:00
Jeff Bailey
df85f45bf1
[libc][docs][NFC] Add Build Concepts and consolidate patterns (#187490)
[libc][docs][NFC] Add Build Concepts page with five build scenarios

Added build_concepts.rst defining the five ways to build LLVM-libc:

overlay, full build, bootstrap, cross-compiler, and bootstrap
cross-compiler. Updated full_host_build.rst to cross-reference the new
concepts page for both the runtimes and bootstrap build sections, and
removed a duplicate GWP_ASAN flag from the sysroot CMake recipe. Added
the new page to index.rst.
2026-03-19 23:41:29 +00:00
Daniel Thornburgh
7efcd6198c
[libc] Modular printf option (float only) (#147426)
This adds LIBC_CONF_PRINTF_MODULAR, which causes floating point support
(later, others) to be weakly linked into the implementation.
__printf_modular becomes the main entry point of the implementaiton, an
printf itself wraps __printf_modular. printf it also contains a
BFD_RELOC_NONE relocation to bring in the float aspect.

See issue #146159 for context.
2026-03-19 14:22:03 -07:00
Jeff Bailey
89657f726f
[libc][docs][NFC] Documentation consolidation and de-duplication (#187385)
Summary:
Integrated a series of quick documentation cleanups for LLVM-libc. This
update focuses on de-duplicating core conventions (naming and
namespaces) across multiple developer and contribution guides, and
addresses empty platform stubs for UEFI.

Changes:

* libc/docs/contributing.rst: Removed duplicated code style rules and
provided a link to dev/code_style.rst.
* libc/docs/dev/clang_tidy_checks.rst: Removed redundant namespace
explanations and linked to dev/code_style.rst.
* libc/docs/dev/implementation_standard.rst: Removed repetitive notes
about LIBC_NAMESPACE_DECL and linked to the authoritative reference.
* libc/docs/uefi/support.rst & libc/docs/uefi/using.rst: Added
early-stage bring-up warnings and pointed to the config directory for
the source of truth.
2026-03-18 21:50:08 +00:00
Jeff Bailey
253616de7e
[libc][docs] Generate configure.rst in the build directory (#187266)
generate_config_doc() was writing configure.rst directly into the source
tree, which fails when building from a read-only source directory (e.g.
when the source is on a read-only filesystem or in a packaging
environment).

The Sphinx build in libc/docs/CMakeLists.txt already copies static .rst
files from the source tree into the build tree so that generated docs
don't pollute the source directory. Move configure.rst generation to
follow this same pattern by writing to LIBC_BUILD_DIR/docs/ instead of
LIBC_SOURCE_DIR/docs/.

This also removes configure.rst from the checked-in source tree, since
it was fully generated content that was being regenerated on every CMake
configure anyway.
2026-03-18 16:51:13 +00:00
Michael Jones
838b1ccdd9
[libc] Add a smaller b36_char_to_int (#180841)
For ASCII systems, b36_char_to_int gets compiled into a jump table. That
jump table ends up being pretty large because it covers the range from
'0' (48) to 'z' (122). On size-constrained systems that can assume
ASCII, this patch provides a new flag: LIBC_CONF_CTYPE_SMALLER_ASCII
that forces a smaller implementation that doesn't compile into a jump
table.
2026-03-17 15:36:41 -07:00
Jeff Bailey
ebb3309975
[libc] Refactor core Linux syscalls to use syscall_wrappers (#185983)
This patch initiates the refactoring of Linux syscalls as described in
the RFC (https://discourse.llvm.org/t/rfc-linux-syscall-cleanup/87248/).

It introduces a new infrastructure in
`src/__support/OSUtil/linux/syscall_wrappers/` to house header-only
syscall wrappers. These wrappers utilize `ErrorOr` to provide a
consistent, type-safe interface for error handling across the library,
standardizing how syscall return values are converted into
errno-compatible Error objects.

Summary of changes:
- Created the `syscall_wrappers` directory and added `close.h`,
`read.h`, `write.h`, and `open.h`.
- Moved the existing `getrandom.h` into the new `syscall_wrappers`
directory and updated its callers (including HashTable/randomness.h).
- Refactored core entrypoints (`close`, `read`, `write`, `open`) to use
the new wrappers, removing direct `syscall_impl` logic and manual errno
setting.
- Updated `shm_open.cpp` to use the new `open` wrapper.
- Cleaned up `OSUtil/linux/fcntl.cpp` by removing redundant internal
implementations of `open` and `close`.
- Added a developer guide in `docs/dev/syscall_wrapper_refactor.rst`
outlining the established pattern for future migrations.

---------

Co-authored-by: Michael Jones <michaelrj@google.com>
2026-03-17 18:27:32 +00:00
Petter Berntsson
7887ac6e7f
[libc][docs] Update clang-tidy checks page (#185923)
Document layered .clang-tidy config, update llvmlibc-* check names, and
drop stale TODO
2026-03-17 09:07:38 +00:00
Xinlong Chen
458096d5f8
[libc][math][c23] Add atan2f16 function (#183531)
Add atan2f16 function

closes https://github.com/llvm/llvm-project/issues/180969
Part of https://github.com/llvm/llvm-project/issues/95250.

also refactor to header only, it's a part of
https://github.com/llvm/llvm-project/issues/147386
2026-03-13 22:12:44 +02:00
Zorojuro
ad054822eb
[libc][math][c23] Add hypotbf16 function (#183460)
This PR intends to add hypotbf16 higher math function for BFloat16 type
along with the tests.
2026-03-13 10:11:33 -04:00
Shikhar Soni
a7d1a87b30
[libc][math][c23] Add log10p1f16 C23 math function (#184739)
Closes #133202

---------

Signed-off-by: Shikhar Soni <shikharish05@gmail.com>
2026-03-13 09:59:26 -04:00
Zorojuro
0bebee6782
[libc][math][c++23] Add Fmabf16 math function (#182836)
closes #180171 
part of #177259 

Here are some extra changes apart from the usual which were needed
1. `libc/src/__support/FPUtil/generic/add_sub.h` → +0 -0 error
2. `libc/src/__support/FPUtil/generic/FMA.h` → implemented to handle
fmabf16(Normal,Normal,+/-INF)

```jsx
/home/runner/work/llvm-project/llvm-project/libc/test/src/math/fmabf16_test.cpp:62: FAILURE
Failed to match __llvm_libc_23_0_0_git::fmabf16(x, y, z) against LIBC_NAMESPACE::testing::mpfr::get_mpfr_matcher<mpfr::Operation::Fma>( input, __llvm_libc_23_0_0_git::fmabf16(x, y, z), 0.5, mpfr::RoundingMode::Nearest).
Input decimal: x: 338953138925153547590470800371487866880.00000000000000000000000000000000000000000000000000 y: 338953138925153547590470800371487866880.00000000000000000000000000000000000000000000000000 z: -inf
 First input bits: 0x7F7F = (S: 0, E: 0x00FE, M: 0x007F)
Second input bits: 0x7F7F = (S: 0, E: 0x00FE, M: 0x007F)
 Third input bits: (-Infinity)
Libc result: nan
MPFR result: -inf
Libc floating point result bits: (NaN)
              MPFR rounded bits: (-Infinity)
```

1. ~~`libc/src/__support/FPUtil/bfloat16.h` → to handle *= operator for
Bfloat16 ( uses the already available mult operator)~~
moved to  #182882 

The exhaustive test currently includes subnormal range and for checking
for specific edge cases . This is due to the repeated failure at <2^32
input space specifically only for ubuntu 24.04 and 24.04-arm
The removed tests included -> PositiveRange and NegativeRange for
Normals and an extra positive test for subnormals/Denormals

Let me know if there are any changes expected or anything I missed in
this .
 cc: @lntue @krishna2803 @overmighty
2026-03-13 05:33:52 +00:00
sohail
cd7e200e42
[libc][math] Add cbrtbf16 math function (#180327)
Add a bfloat16 implementation of cbrt along with corresponding smoke
tests and an MPFR-based exhaustive unit test.

Fixes #179729
2026-03-10 12:59:26 -04:00
Jeff Bailey
7030a34403
[libc][docs] Furo theme, new landing page, cleanups (#184303)
Switch the libc documentation site from the alabaster theme to Furo,
which provides mobile-friendly layout, a collapsible sidebar with
caption-based section grouping, and built-in "Edit this page" links.

Changes by area:

conf.py
- Switch html_theme to "furo"
- Add myst_parser extension (already in llvm/docs/requirements.txt, used
by LLDB/Clang/LLVM docs) to allow Markdown alongside RST
- Accept both .rst and .md source suffixes
- Configure Furo source_repository/source_branch/source_directory for
"Edit this page" links pointing to GitHub
- Wire _static/copybutton.{js,css} for copy-to-clipboard buttons on code
blocks (no new pip dependency; can migrate to sphinx-copybutton later
once it's in requirements-hashed.txt)
- Exclude plan-docs.md and Helpers/ from Sphinx processing

index.rst
- Rewrite landing page: remove apologetic "not fully complete" note, add
"What Works Today" section with concrete supported use cases, honest
caveat that full C stdlib coverage is still in progress
- Restructure hidden toctrees into five captioned sidebar groups: "Using
LLVM-libc", "Platforms" (GPU/UEFI promoted to top-level),
"Implementation Status", "Development", "Links"

New files
- docs/_static/copybutton.{js,css}: lightweight copy button for code
blocks
- docs/_static/custom.css: add status badge styles (.badge-complete
etc.) for use with Helpers/Styles.rst substitutions in later phases

Prepare for future status badges:
- docs/Helpers/Styles.rst: RST substitution definitions for status
badges (|Complete|, |Partial|, |InProgress|, |NotStarted|, |GPUOnly|,
|LinuxOnly|) — excluded from toctree, available for Phase 5+ pages
- docs/dev/building_docs.rst: new page covering prerequisites (with
Debian apt-first instructions), CMake flags, ninja docs-libc-html, the
docgen auto-generation pipeline, and troubleshooting

Removed
- docs/README.txt: stale file claiming Sphinx 1.1.3, not in any toctree;
superseded by docs/dev/building_docs.rst

Cleanups
- Remove redundant ".. contents:: Table of Contents" directives from 16
RST files (Furo renders its own per-page TOC in the sidebar)
- Remove same directive from libc/Maintainers.rst (pulled into docs via
include)
2026-03-09 20:48:42 +00:00
Mohamed Emad
8f3dd82a0a
[libc][math][c23] implement asinpif function (#181511)
Implementing `asinpi` for single-precision. it continues what is done in
#152690 that implemented `asinpif16` with header-only approach that is
followed since #147386
2026-02-26 05:05:49 +02:00
Joseph Huber
d85576d368
[libc] Replace RPC 'close()' mechanism with RAII handler (#181690)
Summary:
Closing ports was previously done manually, This makes the protocol more
error prone as unclosed ports will leak and eventually the locks will
run out. I believe the original fear was that the RAII portion would
negatively impact code generation but I have not noticed anything
significant.
2026-02-16 15:14:30 -06:00
Jeff Bailey
aa0e429576
[libc] Rewrite "Full Host Build" instructions (#180439)
This commit restructures the full_host_build.rst documentation to better
serve two use cases:

1. Standard Building and Testing: Add a new introductory section with
simplified instructions for local development. This covers basic build
configuration, building/testing without a full sysroot, and
documentation generation.

2. Building a Sysroot: Reorganize the comprehensive sysroot setup
instructions into a clear 5-step guide:
   - Step 1: Preparation (environment variables)
   - Step 2: Linux Headers (copying headers into sysroot)
- Step 3: Build and Install Runtimes (cmake configuration and ninja
build)
   - Step 4: Configure the Compiler Wrapper (creating clang config file)
   - Step 5: Verification (testing with sample C program)

Key improvements:
- Restructure content to lead with simpler development workflow
- Replace bootstrapping build instructions with clearer sysroot
instructions
- Fix typo: "non-triivial" -> "non-trivial"
- Remove directory changes that can be confusing. All commands are run
from the root of the llvm tree
- Improve code block formatting and add complete working examples
- Make it easy to cut and paste shell commands
- Simplify "Hello, World!" example
- Simplify and clarify assumptions and requirements
- Remove obsolete notes about C++ standard library support

Tested:
 * Built runtimes build and tests
 * Built sysroot and verified with sample C program
 * Verified document builds and looks right in VSCode browser
2026-02-12 07:54:34 +00:00
Joseph Huber
39f2ce3685 [libc] Cleanup RPC helpers and comments
Summary:
Mostly NFC, replaced some inconsistent comments and replaces `class`
with `typename` to be consistent. Also fix incomplete type detection I
forgot to merge in the RPC helper PR.
2026-02-11 16:41:54 -06:00
Joseph Huber
6d6feb7655
[libc] Add RPC helpers for dispatching functions to the host (#179085)
Summary:
The RPC interface is useful for forwarding functions. This PR adds
helper functions for doing a completely bare forwarding of a function
from the client to the server. This is intended to facilitate
heterogenous libraries that implement host functions on the GPU (like
MPI or Fortran).
2026-02-11 08:13:52 -06:00
Michael Jones
ac1220f860
[libc] Add option to disable printf bit int (#180832)
Requested as a binary size optimization. Updates the parser, converter
utils, config, tests, and docs.
2026-02-10 15:41:38 -08:00
Petter Berntsson
19d6950739
[libc][docs] Fix stale entrypoints links and time.h table duplication (#180347)
Update stale links and remove duplication in table.
2026-02-10 00:02:28 +00:00
petbernt
30533d0757
[libc][docs] Document printf NULL handling for %s/%n (#180067)
- Fix printf_behavior to describe NULL %s as printing "(null)" when
nullptr checks are enabled
- Point undefined_behavior NULL %s/%n entry at
LIBC_COPT_PRINTF_NO_NULLPTR_CHECKS
- Add Sphinx labels to link directly to the flag and Conversion sections
2026-02-06 15:40:50 +00:00
Joseph Huber
e07a1182fd
[libc] Tweak the runtimes cross-build for GPU (#178548)
Summary:
We should likely use `-DLLVM_DEFAULT_TARGET_TRIPLE` as the general
source of truth, make the handling work with that since we use it for
the output directories. Fix the creation of startup files in this mode
and make sure it can detect the GPU properly.

Fixes: https://github.com/llvm/llvm-project/issues/179375
2026-02-03 10:35:17 -06:00
Prabhu Rajasekaran
66424a02de
[libc] provide str to float build configs (#178780)
The str to float code path offers options which can reduce code bloat.
Expose them as build config options. Disable Eisel Lemire for avoiding
code bloat caused by DETAILED_POWERS_OF_TEN look up table.
2026-01-30 00:32:38 +00:00
Michael Jones
7940a5afef
[libc][NFC] update configure page with wchar flag (#177050)
Whenever the cmake runs it updates configure.rst based on the contents
of config.json. This PR just applies the change generated after #176110
2026-01-20 15:07:55 -08:00
Shubh Pachchigar
41cfe83ab1
[libc] Reland %lc support in printf (#176110)
Add support for %lc in printf by calling internal wcrtomb function and
relevant end-to-end sprintf test.

Additionally, made the following changes:
- Modified printf parser for recognizing length modifier
- Added two internal error codes. 
- Added a flag to disable wchar support on windows platform.
- To keep printf interface header only, converted wcrtomb and
CharacterConverter to header only implementation and removed the cpp
source.

Resolves GPU libc issues in #169983 and original issue: #166598

---------

Co-authored-by: shubhe25p <shubhp@mbm3a24.local>
Co-authored-by: Joseph Huber <huberjn@outlook.com>
2026-01-20 16:18:50 -06:00
Joseph Huber
95da1354d0 Revert "[libc] Support %lc in printf (#169983)"
This reverts commit 1327c50ef199b481f5326cf6ca3710fc111b70b1.

The printf headers are intended to be header-only, this introduces
external symbol dependencies.
2026-01-13 20:01:29 -06:00
Shubh Pachchigar
1327c50ef1
[libc] Support %lc in printf (#169983)
Add support for %lc in printf by calling internal wcrtomb function and
relevant end-to-end sprintf test. Additionally, modified printf parser
for recognizing length modifier and added two internal error codes. Also
added a flag to disable wchar support on windows platform. Resolves
#166598

Co-authored-by: shubh@DOE <shubhp@mbm3a24.local>
2026-01-13 14:05:48 -08:00
Michael Jones
a6cfca8b8e
[libc][docs] Fix typo (#174631)
There was a typo introduced in #168637, this PR fixes it. Thanks to
Nikolas for pointing it out.
2026-01-06 10:53:17 -08:00
Roland McGrath
2e16cadd56
[libc] Split out src/__support/alloc-checker.h (#173104)
This moves the libc-internal AllocChecker API out of
src/__support/CPP/new.h and updates CPP/README.md to state the
intent to keep src/__support/CPP and the LIBC_NAMESPACE::cpp
namespace a "pure" subset of standard C++ API polyfills.
2025-12-22 11:04:33 -08:00
lntue
e2956fefd9
[libc][math] Add LIBC_CONF_MATH_USE_SYSTEM_FENV / LIBC_MATH_USE_SYSTEM_FENV (#172902)
This is to allow math function implementations to use system libc's
fenv.h instead of internal fenv implementations.
2025-12-22 13:19:56 -05:00
Michael Jones
0ca779fae7
[libc][docs] Update website to reflect new strategy (#168637)
The LLVM-libc goals are updated to better reflect the strategy shared
at the LLVM dev meeting 2025.
2025-12-19 22:12:31 +00:00
Michael Jones
2797688887
[libc][docs] Add a sunset policy to porting docs (#168936)
As discussed in the monthly meeting, update the porting docs to clarify
what's needed for a target and add a policy for sunsetting targets.
2025-12-11 09:29:26 -08:00
lntue
4c59219fc9
[libc][fenv] Refactor x86 fenv implementations to make it work for various fenv_t. (#165015) 2025-12-05 16:00:10 -05:00
Sterling-Augustine
ed7e66a41d
Reland Refactor WIDE_READ to allow finer control over high-performance function selection (#165613) (#170738)
[Previous commit had an incorrect default case when
FIND_FIRST_CHARACTER_WIDE_READ_IMPL was not specified in config.json.
This PR is identical to that one with one line fixed.]

As we implement more high-performance string-related functions, we have
found a need for better control over their selection than the big-hammer
LIBC_CONF_STRING_LENGTH_WIDE_READ. For example, I have a memchr
implementation coming, and unless I implement it in every variant, a
simple binary value doesn't work.

This PR makes gives finer-grained control over high-performance
functions than the generic LIBC_CONF_UNSAFE_WIDE_READ option. For any
function they like, the user can now select one of four implementations
at build time:

1. element, which reads byte-by-byte (or wchar by wchar)
2. wide, which reads by unsigned long
3. generic, which uses standard clang vector implemenations, if
available
4. arch, which uses an architecture-specific implemenation

(Reading the code carefully, you may note that a user can actually
specify any namespace they want, so we aren't technically limited to
those 4.)

We may also want to switch from command-line #defines as it is currently
done, to something more like
llvm-project/llvm/include/llvm/Config/llvm-config.h.cmake, and
complexity out of the command-line. But that's a future problem.
2025-12-04 15:58:14 -08:00
Sterling-Augustine
4e5b114ce2
Revert "Refactor WIDE_READ to allow finer control over high-performance function selection" (#170717)
Reverts llvm/llvm-project#165613

Breaks build bot
2025-12-04 10:34:46 -08:00
Sterling-Augustine
8701c2a910
Refactor WIDE_READ to allow finer control over high-performance function selection (#165613)
[This is more of a straw-proposal than a ready-for-merging PR. I got
started thinking about what this might look like, and ended up just
implementing something as a proof-of-concept. Totally open to other
methods an ideas.]

As we implement more high-performance string-related functions, we have
found a need for better control over their selection than the big-hammer
LIBC_CONF_STRING_LENGTH_WIDE_READ. For example, I have a memchr
implementation coming, and unless I implement it in every variant, a
simple binary value doesn't work.

This PR makes gives finer-grained control over high-performance
functions than the generic LIBC_CONF_UNSAFE_WIDE_READ option. For any
function they like, the user can now select one of four implementations
at build time:

1. element, which reads byte-by-byte (or wchar by wchar)
2. wide, which reads by unsigned long
3. generic, which uses standard clang vector implemenations, if
available
4. arch, which uses an architecture-specific implemenation

(Reading the code carefully, you may note that a user can actually
specify any namespace they want, so we aren't technically limited to
those 4.)

We may also want to switch from command-line #defines as it is currently
done, to something more like
llvm-project/llvm/include/llvm/Config/llvm-config.h.cmake, and
#including the resulting file, which would move quite a bit of
complexity out of the command-line. But that's a future problem.
2025-12-04 10:21:53 -08:00
Marcell Leleszi
d8b43edf55
[libc][wctype] Add cmake flag for configuring wctype implementation used (#170531)
#170525 

Based on our
[RFC](https://discourse.llvm.org/t/rfc-libc-wctype-header-implementation/88941/10),
we are starting the implementation of the wctype header with C.UTF8
support. This implementation will increase the binary size by
approximately ~70KB, so this PR introduces a flag so that this is
configurable, allowing the user to choose between a simple ASCII
implementation or the full Unicode one.
2025-12-04 15:38:42 +01:00