llvm-project/libcxx/docs
Christopher Di Bella ab46648082 [libcxx] adds an include-what-you-use (IWYU) mapping file
This makes it possible for programmers to run IWYU and get more accurate
standard library inclusions. Prior to this commit, the following program
would be transformed thusly:

```cpp
// Before
 #include <algorithm>
 #include <vector>

void f() {
  auto v = std::vector{0, 1};
  std::find(std::ranges::begin(v), std::ranges::end(v), 0);
}
```

```cpp
// After
 #include <__algorithm/find.h>
 #include <__ranges/access.h>
 #include <vector>
...
```

There are two ways to fix this issue: to use [comment pragmas](https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md)
on every private include, or to write a canonical [mapping file](https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUMappings.md)
that provides the tool with a manual on how libc++ is laid out. Due to
the complexity of libc++, this commit opts for the latter, to maximise
correctness and minimise developer burden.

To mimimise developer updates to the file, it makes use of wildcards
that match everything within listed subdirectories. A script has also
been added to ensure that the mapping is always fresh in CI, and makes
the process a single step.

Finally, documentation has been added to inform users that IWYU is
supported, and what they need to do in order to leverage the mapping
file.

Closes #56937.

Differential Revision: https://reviews.llvm.org/D138189
2022-11-22 01:09:49 +00:00
..
DesignDocs [libc++] Start classifying debug mode features with more granularity 2022-11-15 11:18:22 -05:00
Helpers [libc++][doc] Use issue labels. 2021-10-15 17:30:33 +02:00
Status [libc++] Implement P2438R2 (std::string::substr() &&) 2022-11-02 20:28:47 +01:00
AddingNewCIJobs.rst [libc++] Add timeout to BuildKite jobs 2021-08-09 15:31:04 -04:00
BuildingLibcxx.rst [SystemZ][z/OS] Add ASCII and 32-bit variants for libc++. 2022-10-03 17:24:02 -05:00
CMakeLists.txt
Contributing.rst [libc++] Documents details of the pre-commit CI. 2022-11-10 20:20:17 +01:00
FeatureTestMacroTable.rst [libc++] Add FTM for constexpr vector 2022-11-09 22:45:20 +01:00
README.txt [libc++] NFC: Add note about how the libcxx website gets updated 2021-07-05 10:25:33 -04:00
ReleaseNotes.rst [libc++] Make it an error to define _LIBCPP_DEBUG 2022-11-15 09:48:13 -05:00
TestingLibcxx.rst [libc++] Add a bunch of missing _LIBCPP_HIDE_FROM_ABI 2022-08-13 22:41:22 +02:00
UsingLibcxx.rst [libcxx] adds an include-what-you-use (IWYU) mapping file 2022-11-22 01:09:49 +00:00
conf.py Bump the trunk major version to 16 2022-07-26 21:34:45 -07:00
index.rst [libcxx] Fix link to Buildbot interface 2022-11-18 15:47:21 +00:00

README.txt

libc++ Documentation
====================

The libc++ documentation is written using the Sphinx documentation generator. It is
currently tested with Sphinx 1.1.3.

To build the documents into html configure libc++ with the following cmake options:

  * -DLLVM_ENABLE_SPHINX=ON
  * -DLIBCXX_INCLUDE_DOCS=ON

After configuring libc++ with these options the make rule `docs-libcxx-html`
should be available.

The documentation in this directory is published at https://libcxx.llvm.org. It is kept up-to-date
by a build bot: https://lab.llvm.org/buildbot/#/builders/publish-sphinx-docs. If you notice that the
documentation is not updating anymore, please contact one of the maintainers.