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 |
| 14 | + utils |
| 15 | - build_scripts |
| 16 | - testing |
| 17 | - www |
| 18 | |
| 19 | Each of these directories is explained in detail below. |
| 20 | |
| 21 | The ``cmake`` directory |
| 22 | ----------------------- |
| 23 | |
| 24 | The ``cmake`` directory contains the implementations of LLVM-libc's CMake build |
| 25 | rules. |
| 26 | |
| 27 | The ``docs`` directory |
| 28 | ---------------------- |
| 29 | |
| 30 | The ``docs`` directory contains design docs and also informative documents like |
| 31 | this document on source layout. |
| 32 | |
| 33 | The ``include`` directory |
| 34 | ------------------------- |
| 35 | |
| 36 | The ``include`` directory contains: |
| 37 | |
| 38 | 1. Self contained public header files - These are header files which are |
| 39 | already in the form that get installed when LLVM-libc is installed on a user's |
| 40 | computer. |
| 41 | 2. ``*.h.def`` and ``*.h.in`` files - These files are used to construct the |
| 42 | generated public header files. |
| 43 | 3. A ``CMakeLists.txt`` file - This file lists the targets for the self |
| 44 | contained and generated public header files. |
| 45 | |
| 46 | The ``lib`` directory |
| 47 | --------------------- |
| 48 | |
| 49 | This directory contains a ``CMakeLists.txt`` file listing the targets for the |
| 50 | public libraries ``libc.a``, ``libm.a`` etc. |
| 51 | |
| 52 | The ``loader`` directory |
| 53 | ------------------------ |
| 54 | |
| 55 | This directory contains the implementations of the application loaders like |
| 56 | ``crt1.o`` etc. |
| 57 | |
| 58 | The ``src`` directory |
| 59 | --------------------- |
| 60 | |
| 61 | This directory contains the implementations of the llvm-libc entrypoints. It is |
| 62 | further organized as follows: |
| 63 | |
| 64 | 1. There is a toplevel CMakeLists.txt file. |
| 65 | 2. For every public header file provided by llvm-libc, there exists a |
| 66 | corresponding directory in the ``src`` directory. The name of the directory |
| 67 | is same as the base name of the header file. For example, the directory |
| 68 | corresponding to the public ``math.h`` header file is named ``math``. The |
| 69 | implementation standard document explains more about the *header* |
| 70 | directories. |
| 71 | |
| 72 | The ``www`` directory |
| 73 | --------------------- |
| 74 | |
| 75 | The ``www`` directory contains the HTML content of libc.llvm.org |
| 76 | |
| 77 | The ``utils/build_scripts`` directory |
| 78 | ------------------------------------- |
| 79 | |
| 80 | This directory contains scripts which support the build system, tooling etc. |
| 81 | |
| 82 | The ``utils/testing`` directory |
| 83 | ------------------------------- |
| 84 | |
| 85 | This directory contains testing infrastructure. |