mirror-llvm-project/libc
Scott Linder 42ff45b865
[docs] Create utils/docs (#203962)
llvm-project is home to many sphinx documentation sites, each with
configuration quirks and bespoke extensions.

The sphinx config model makes sharing code somewhat difficult. There
are options like sphinx-multiproject, but some of our docs builds are
out of the source tree while some are done out of the binary tree, so
the multiproject configuration itself would need to be generated. It
also would impose more uniformity around extensions than required.

This change instead creates a python package at utils/docs/llvm_sphinx
and makes it available to all sphinx-build processes via PYTHONPATH.
Each conf.py does not modify its own sys.path because not all builds are
out of the source tree, so there isn't a stable relative path to use to
refer to the utils/docs/ directory.

Type checking via pyright in new package is pinned to being python 3.8
compatible.

The myst slug script from llvm/docs is promoted to be the default,
with a slight edit to targets needed in FlangDriver.md to adapt to the
change.

The ghlinks extension from clang gets lifted to be the first generic
extension, although it is still only used in clang currently. I used it
as an example of a general extension that might be useful for other
projects, but I also intend to add a new generic extension in a future
patch.

As part of the move ghlinks is refactored a bit:

* Rather than have a main function directly to run its tests, those
  tests are now run via the command-line entrypoint to the new package,
  e.g. `python utils/docs --test` will now replace
  `python clang/docs/ghlinks.py --test`. This makes the command-line
  more pithy (`python utils/docs/llvm_sphinx/ext/ghlinks --test` is a
  bit long), and makes the default behavior when running be to
  include utils/docs in the sys.path, so imports can be absolute and
  the behavior is as close to the CMake targets as possible.
* The static files that were previously written to a tempdir during
  testing are just committed directly in git. The assumption here is
  that the original version was taking pains to avoid polluting the
  clang/docs directory with test files that would confuse sphinx-build,
  and without that limitation the workaround can be removed.
* Some typing-related changes to make it strictly python 3.8 compatible.

Change-Id: Ie16de273f74973f163dbf7fe9d22d80a466d051f
2026-06-24 15:12:48 -04:00
..
benchmarks [libc][math][c23] Improve rsqrtf16 function for targets without fp32 FPUs. (#160639) 2026-06-17 19:56:19 -04:00
cmake [libc] Remove 32-bit time_t support (#200426) 2026-06-05 14:33:17 +01:00
config Reland "[libc] Implement basename and dirname in libgen.h #204554" (#205352) 2026-06-23 15:59:59 +01:00
docs [docs] Create utils/docs (#203962) 2026-06-24 15:12:48 -04:00
examples [libc] Fix broken links in libc (#145199) 2025-06-23 15:51:43 -07:00
fuzzing [libc] Add a differential fuzzer for inet_aton (#200341) 2026-06-11 12:37:46 +02:00
hdr [libc] Add IPv4 socket options and related structs (#204787) 2026-06-24 11:17:03 +02:00
include [libc] Add IPv4 socket options and related structs (#204787) 2026-06-24 11:17:03 +02:00
lib [libc] Generate a stub for libpthread.a (#200908) 2026-06-15 23:35:20 -07:00
shared [libc][math][c23] Implement higher math function cbrtf16 in LLVM libc (#132484) 2026-06-15 22:10:19 +00:00
src [libc] Refactor qsort code (#198781) 2026-06-24 09:33:58 +01:00
startup [libc] Port munmap and mprotect to the new syscall interface (#199199) 2026-05-25 13:07:05 +02:00
test [libc] Add IPv4 socket options and related structs (#204787) 2026-06-24 11:17:03 +02:00
utils [libc][NFC] Remove a compiler warning for MPCommon (#205264) 2026-06-24 11:40:34 +08:00
.clang-tidy
.gitignore [libc][wctype] Create generation script for classification lookup tables (#172042) 2026-01-06 12:13:28 +01:00
CMakeLists.txt [libc] Add LLVM_LIBC_ENABLE_EXPERIMENTAL_ENTRYPOINTS CMake flag (#197537) 2026-05-14 07:01:13 +01:00
LICENSE.TXT
Maintainers.md [libc][freebsd] initialize freebsd support (#124459) 2026-05-19 13:04:34 -07:00
README.txt

LLVM libc
=========

This directory and its subdirectories contain source code for llvm-libc,
a retargetable implementation of the C standard library.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.