LLVM-libc Source Tree Layout¶
At the top-level, LLVM-libc source tree is organized in to the following directories:
Each of these directories is explained breifly below.
benchmarks directory contains LLVM-libc’s benchmarking utilities. These
are mostly used for the memory functions. This also includes the automemcpy
subdirectory for automatic generation of optimized memory functions.
config directory contains the default configurations for the targets
LLVM-libc supports. These are files in the
config.json. These tell cmake which entrypoints are available, which
entrypoints to exclude, which headers to generate, and what options to set for
the current target respectively. There are also other platform specific files in
cmake directory contains the implementations of LLVM-libc’s CMake build
docs directory contains design docs and also informative documents like
this document on source layout.
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
Fuzzing for LLVM-libc functions.
include directory contains:
*.h.deffiles - These files are used to construct the generated public header files.
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. These are mostly in the
This directory contains a
CMakeLists.txt file listing the targets for the
This directory contains the specifications for the types, macros, and entrypoint
functions. These definitions come from the various standards and extensions
LLVM-libc supports, and they are used along with the
*.h.def files and the
config files to generate the headers for fullbuild mode.
This directory contains the implementations of the llvm-libc entrypoints. It is further organized as follows:
There is a top-level CMakeLists.txt file.
For every public header file provided by llvm-libc, there exists a corresponding directory in the
srcdirectory. The name of the directory is same as the base name of the header file. For example, the directory corresponding to the public
math.hheader file is named
math. The implementation standard document explains more about the header directories.
This directory contains the implementations of the application startup objects
This directory contains tests for the various components of LLVM-libc. The
directory structure within this directory mirrors the directory structure of the
libc directory itself. A test for, say the
mmap function, lives
in the directory
test/src/sys/mman/ as implementation of
mmap lives in
This directory contains utilities used by other parts of the LLVM-libc system. See the README files in the subdirectories within this directory to learn about the various utilities.