Understanding the directory structure
In this section, you will learn the basics of how the LLVM folders are organized. This knowledge will come in handy when you start contributing to LLVM. This will help you shape patches that follow the philosophy behind the directory structure and hence, help you avoid unnecessary rounds of reviews where you would have to fix that.
High-level directory structure
At a high level, the LLVM code base is organized into projects: Clang, MLIR, the LLVM debugger (LLDB), and many more. Each project has its own directory, and its name matches the name of the related project in lowercase: clang
, mlir
, lldb
, and so on.
You need to use these directory names in the LLVM_ENABLE_PROJECTS
CMake variable to build the related projects.
The common theme around these projects is that they use or contribute to a part of the LLVM infrastructure.
Focusing on the core LLVM project
Unsurprisingly, the core LLVM project lives in the llvm
directory...