Siva Chandra | 4380647 | 2019-10-04 17:30:54 +0000 | [diff] [blame] | 1 | LLVM-libc Source Tree Layout |
| 2 | ============================ |
| 3 | |
| 4 | At the top-level, LLVM-libc source tree is organized in to the following |
| 5 | directories:: |
| 6 | |
| 7 | + libc |
| 8 | - cmake |
| 9 | - docs |
| 10 | - include |
| 11 | - lib |
| 12 | - loader |
| 13 | - src |
Siva Chandra Reddy | 5b24c08 | 2020-01-03 12:00:45 -0800 | [diff] [blame] | 14 | - test |
Siva Chandra | 4380647 | 2019-10-04 17:30:54 +0000 | [diff] [blame] | 15 | + utils |
| 16 | - build_scripts |
| 17 | - testing |
| 18 | - www |
| 19 | |
| 20 | Each of these directories is explained in detail below. |
| 21 | |
| 22 | The ``cmake`` directory |
| 23 | ----------------------- |
| 24 | |
| 25 | The ``cmake`` directory contains the implementations of LLVM-libc's CMake build |
| 26 | rules. |
| 27 | |
| 28 | The ``docs`` directory |
| 29 | ---------------------- |
| 30 | |
| 31 | The ``docs`` directory contains design docs and also informative documents like |
| 32 | this document on source layout. |
| 33 | |
| 34 | The ``include`` directory |
| 35 | ------------------------- |
| 36 | |
| 37 | The ``include`` directory contains: |
| 38 | |
| 39 | 1. Self contained public header files - These are header files which are |
| 40 | already in the form that get installed when LLVM-libc is installed on a user's |
| 41 | computer. |
| 42 | 2. ``*.h.def`` and ``*.h.in`` files - These files are used to construct the |
| 43 | generated public header files. |
| 44 | 3. A ``CMakeLists.txt`` file - This file lists the targets for the self |
| 45 | contained and generated public header files. |
| 46 | |
| 47 | The ``lib`` directory |
| 48 | --------------------- |
| 49 | |
| 50 | This directory contains a ``CMakeLists.txt`` file listing the targets for the |
| 51 | public libraries ``libc.a``, ``libm.a`` etc. |
| 52 | |
| 53 | The ``loader`` directory |
| 54 | ------------------------ |
| 55 | |
| 56 | This directory contains the implementations of the application loaders like |
| 57 | ``crt1.o`` etc. |
| 58 | |
| 59 | The ``src`` directory |
| 60 | --------------------- |
| 61 | |
| 62 | This directory contains the implementations of the llvm-libc entrypoints. It is |
| 63 | further organized as follows: |
| 64 | |
| 65 | 1. There is a toplevel CMakeLists.txt file. |
| 66 | 2. For every public header file provided by llvm-libc, there exists a |
| 67 | corresponding directory in the ``src`` directory. The name of the directory |
| 68 | is same as the base name of the header file. For example, the directory |
| 69 | corresponding to the public ``math.h`` header file is named ``math``. The |
| 70 | implementation standard document explains more about the *header* |
| 71 | directories. |
| 72 | |
Siva Chandra Reddy | 5b24c08 | 2020-01-03 12:00:45 -0800 | [diff] [blame] | 73 | The ``test`` directory |
| 74 | ---------------------- |
| 75 | |
| 76 | This directory contains tests for the various components of llvm-libc. The |
| 77 | directory structure within this directory mirrors the directory structure of the |
| 78 | toplevel ``libc`` directory itself. A test for, say the ``mmap`` function, lives |
| 79 | in the directory ``test/src/sys/mman/`` as implementation of ``mmap`` lives in |
| 80 | ``src/sys/mman``. |
| 81 | |
Siva Chandra | 4380647 | 2019-10-04 17:30:54 +0000 | [diff] [blame] | 82 | The ``www`` directory |
| 83 | --------------------- |
| 84 | |
| 85 | The ``www`` directory contains the HTML content of libc.llvm.org |
| 86 | |
| 87 | The ``utils/build_scripts`` directory |
| 88 | ------------------------------------- |
| 89 | |
| 90 | This directory contains scripts which support the build system, tooling etc. |
| 91 | |
| 92 | The ``utils/testing`` directory |
| 93 | ------------------------------- |
| 94 | |
| 95 | This directory contains testing infrastructure. |