1 .. _source_tree_layout:
3 ============================
4 LLVM-libc Source Tree Layout
5 ============================
7 At the top-level, LLVM-libc source tree is organized in to the following
21 Each of these directories is explained in detail below.
23 The ``cmake`` directory
24 -----------------------
26 The ``cmake`` directory contains the implementations of LLVM-libc's CMake build
29 The ``docs`` directory
30 ----------------------
32 The ``docs`` directory contains design docs and also informative documents like
33 this document on source layout.
35 The ``fuzzing`` directory
36 -------------------------
38 This directory contains fuzzing tests for the various components of llvm-libc. The
39 directory structure within this directory mirrors the directory structure of the
40 top-level ``libc`` directory itself. For more details, see :doc:`fuzzing`.
42 The ``include`` directory
43 -------------------------
45 The ``include`` directory contains:
47 1. Self contained public header files - These are header files which are
48 already in the form that get installed when LLVM-libc is installed on a user's
50 2. ``*.h.def`` and ``*.h.in`` files - These files are used to construct the
51 generated public header files.
52 3. A ``CMakeLists.txt`` file - This file lists the targets for the self
53 contained and generated public header files.
58 This directory contains a ``CMakeLists.txt`` file listing the targets for the
59 public libraries ``libc.a``, ``libm.a`` etc.
61 The ``startup`` directory
62 -------------------------
64 This directory contains the implementations of the application startup objects
70 This directory contains the implementations of the llvm-libc entrypoints. It is
71 further organized as follows:
73 1. There is a top-level CMakeLists.txt file.
74 2. For every public header file provided by llvm-libc, there exists a
75 corresponding directory in the ``src`` directory. The name of the directory
76 is same as the base name of the header file. For example, the directory
77 corresponding to the public ``math.h`` header file is named ``math``. The
78 implementation standard document explains more about the *header*
81 The ``test`` directory
82 ----------------------
84 This directory contains tests for the various components of llvm-libc. The
85 directory structure within this directory mirrors the directory structure of the
86 toplevel ``libc`` directory itself. A test for, say the ``mmap`` function, lives
87 in the directory ``test/src/sys/mman/`` as implementation of ``mmap`` lives in
90 The ``utils`` directory
91 -----------------------
93 This directory contains utilities used by other parts of the llvm-libc system.
94 See the `README` files, in the sub-directories within this directory, to learn
95 about the various utilities.