File: source_layout.rst

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-6~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,418,812 kB
  • sloc: cpp: 5,290,827; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,900; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,892; xml: 953; cs: 573; fortran: 539
file content (99 lines) | stat: -rw-r--r-- 3,075 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
LLVM-libc Source Tree Layout
============================

At the top-level, LLVM-libc source tree is organized in to the following
directories::

   + libc
        - cmake
        - docs
        - fuzzing
        - include
        - lib
        - loader
        - src
        - test
        - utils
        - www

Each of these directories is explained in detail below.

The ``cmake`` directory
-----------------------

The ``cmake`` directory contains the implementations of LLVM-libc's CMake build
rules.

The ``docs`` directory
----------------------

The ``docs`` directory contains design docs and also informative documents like
this document on source layout.

The ``fuzzing`` directory
----------------------

This directory contains fuzzing tests for the various components of llvm-libc. The
directory structure within this directory mirrors the directory structure of the
top-level ``libc`` directory itself. For more details, see :doc:`fuzzing`.

The ``include`` directory
-------------------------

The ``include`` directory contains:

1. Self contained public header files - These are header files which are
   already in the form that get installed when LLVM-libc is installed on a user's
   computer.
2. ``*.h.def`` and ``*.h.in`` files - These files are used to construct the
   generated public header files.
3. A ``CMakeLists.txt`` file - This file lists the targets for the self
   contained and generated public header files.

The ``lib`` directory
---------------------

This directory contains a ``CMakeLists.txt`` file listing the targets for the
public libraries ``libc.a``, ``libm.a`` etc.

The ``loader`` directory
------------------------

This directory contains the implementations of the application loaders like
``crt1.o`` etc.

The ``src`` directory
---------------------

This directory contains the implementations of the llvm-libc entrypoints. It is
further organized as follows:

1. There is a top-level CMakeLists.txt file.
2. For every public header file provided by llvm-libc, there exists a
   corresponding directory in the ``src`` directory. The name of the directory
   is same as the base name of the header file. For example, the directory
   corresponding to the public ``math.h`` header file is named ``math``. The
   implementation standard document explains more about the *header*
   directories.

The ``test`` directory
----------------------

This directory contains tests for the various components of llvm-libc. The
directory structure within this directory mirrors the directory structure of the
toplevel ``libc`` directory itself. A test for, say the ``mmap`` function, lives
in the directory ``test/src/sys/mman/`` as implementation of ``mmap`` lives in
``src/sys/mman``.

The `utils` directory
---------------------

This directory contains utilities used by other parts of the llvm-libc system.
See the `README` files, in the sub-directories within this directory, to learn
about the various utilities.

The ``www`` directory
---------------------

The ``www`` directory contains the HTML content of libc.llvm.org