brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.0 KiB · 8430a74 Raw
125 lines · plain
1.. _source_tree_layout:2 3============================4LLVM-libc Source Tree Layout5============================6 7At the top-level, LLVM-libc source tree is organized in to the following8directories::9 10   + libc11        - benchmarks12        - cmake13        - config14        - docs15        - examples16        - fuzzing17        - hdr18        - include19        - lib20        - src21        - startup22        - test23        - utils24 25Each of these directories is explained briefly below.26 27The ``benchmarks`` directory28----------------------------29 30The ``benchmarks`` directory contains LLVM-libc's benchmarking utilities. These31are mostly used for the memory functions.32 33The ``config`` directory34------------------------35 36The ``config`` directory contains the default configurations for the targets37LLVM-libc supports. These are files in the ``config/<platform>/<architecture>/``38subdirectory called ``entrypoints.txt``, ``exclude.txt``, ``headers.txt``,  and39``config.json``. These tell cmake which entrypoints are available, which40entrypoints to exclude, which headers to generate, and what options to set for41the current target respectively. There are also other platform specific files in42the ``config/<platform>/`` subdirectory.43 44The ``cmake`` directory45-----------------------46 47The ``cmake`` directory contains the implementations of LLVM-libc's CMake build48rules.49 50The ``docs`` directory51----------------------52 53The ``docs`` directory contains design docs and also informative documents like54this document on source layout.55 56The ``fuzzing`` directory57-------------------------58 59This directory contains fuzzing tests for the various components of LLVM-libc.60The directory structure within this directory mirrors the directory structure61of the top-level ``libc`` directory itself. For more details, see62:doc:`fuzzing`.63 64The ``hdr`` directory65---------------------66 67This directory contains proxy headers which are included from the files in the68src directory. These proxy headers either include our internal type or macro69definitions, or the system's type or macro definitions, depending on if we are70in fullbuild or overlay mode.71 72The ``include`` directory73-------------------------74 75The ``include`` directory contains:76 771. ``*.h.def`` files - These files are used to construct the generated public78   header files.792. Self contained public header files - These are header files which are80   already in the form that get installed when LLVM-libc is installed on a81   user's computer. These are mostly in the ``llvm-libc-macros`` and82   ``llvm-libc-types`` subdirectories.83 84The ``lib`` directory85---------------------86 87This directory contains a ``CMakeLists.txt`` file listing the targets for the88public libraries ``libc.a``, ``libm.a`` etc.89 90The ``src`` directory91---------------------92 93This directory contains the implementations of the llvm-libc entrypoints. It is94further organized as follows:95 961. There is a top-level CMakeLists.txt file.972. For every public header file provided by llvm-libc, there exists a98   corresponding directory in the ``src`` directory. The name of the directory99   is same as the base name of the header file. For example, the directory100   corresponding to the public ``math.h`` header file is named ``math``. The101   implementation standard document explains more about the *header*102   directories.103 104The ``startup`` directory105-------------------------106 107This directory contains the implementations of the application startup objects108like ``crt1.o`` etc.109 110The ``test`` directory111----------------------112 113This directory contains tests for the various components of LLVM-libc. The114directory structure within this directory mirrors the directory structure of the115toplevel ``libc`` directory itself. A test for, say the ``mmap`` function, lives116in the directory ``test/src/sys/mman/`` as implementation of ``mmap`` lives in117``src/sys/mman``.118 119The ``utils`` directory120-----------------------121 122This directory contains utilities used by other parts of the LLVM-libc system.123See the `README` files in the subdirectories within this directory to learn124about the various utilities.125