xref: /openbsd/gnu/llvm/libcxx/docs/Contributing.rst (revision d89ec533)
1.. _ContributingToLibcxx:
2
3======================
4Contributing to libc++
5======================
6
7This file contains notes about various tasks and processes specific to contributing
8to libc++. If this is your first time contributing, please also read `this document
9<https://www.llvm.org/docs/Contributing.html>`__ on general rules for contributing to LLVM.
10
11For libc++, please make sure you follow `these instructions <https://www.llvm.org/docs/Phabricator.html#requesting-a-review-via-the-command-line>`_
12for submitting a code review from the command-line using ``arc``, since we have some
13automation (e.g. CI) that depends on the review being submitted that way.
14
15Looking for pre-existing reviews
16================================
17
18Before you start working on any feature, please take a look at the open reviews
19to avoid duplicating someone else's work. You can do that by going to the website
20where code reviews are held, `Differential <https://reviews.llvm.org/differential>`__,
21and clicking on ``Libc++ Open Reviews`` in the sidebar to the left. If you see
22that your feature is already being worked on, please consider chiming in instead
23of duplicating work!
24
25Pre-commit check list
26=====================
27
28Before committing or creating a review, please go through this check-list to make
29sure you don't forget anything:
30
31- Do you have tests for every public class and/or function you're adding or modifying?
32- Did you update the synopsis of the relevant headers?
33- Did you update the relevant files to track implementation status (in ``docs/Status/``)?
34- Did you mark all functions and type declarations with the :ref:`proper visibility macro <visibility-macros>`?
35- If you added a header:
36
37  - Did you add it to ``include/module.modulemap``?
38  - Did you add it to ``include/CMakeLists.txt``?
39  - If it's a public header, did you add a test under ``test/libcxx`` that the new header defines ``_LIBCPP_VERSION``? See ``test/libcxx/algorithms/version.pass.cpp`` for an example. NOTE: This should be automated.
40  - If it's a public header, did you update ``utils/generate_header_inclusion_tests.py``?
41
42- Did you add the relevant feature test macro(s) for your feature? Did you update the ``generate_feature_test_macro_components.py`` script with it?
43- Did you run the ``libcxx-generate-files`` target and verify its output?
44
45Post-release check list
46=======================
47
48After branching for an LLVM release:
49
501. Update ``_LIBCPP_VERSION`` in ``include/__config``
512. Update the ``include/__libcpp_version`` file
523. Update the version number in ``docs/conf.py``
53
54Exporting new symbols from the library
55======================================
56
57When exporting new symbols from libc++, you must update the ABI lists located in ``lib/abi``.
58To test whether the lists are up-to-date, please run the target ``check-cxx-abilist``.
59To regenerate the lists, use the target ``generate-cxx-abilist``.
60The ABI lists must be updated for all supported platforms; currently Linux and
61Apple.  If you don't have access to one of these platforms, you can download an
62updated list from the failed build at
63`Buildkite <https://buildkite.com/llvm-project/libcxx-ci>`__.
64Look for the failed build and select the ``artifacts`` tab. There, download the
65abilist for the platform, e.g.:
66
67* C++20 for the Linux platform.
68* MacOS C++20 for the Apple platform.
69