Build or optimize your own compiler with this modular toolset
If you want to design the process of turning your own programming language into machine code by hand, this repository provides the foundation. LLVM is a toolbox that gathers the core components of a compiler, which processes intermediate representations to create final executables. It includes major elements of the compiler ecosystem, from Clang, which compiles languages like C and C++, to standard libraries.
The core engine for handling intermediate representations
The center of the LLVM project is a component named 'LLVM'. This part accepts intermediate representations, optimizes them, and converts them into object files that actual machines can understand. It includes tools such as assemblers, disassemblers, bitcode analyzers, and bitcode optimizers. Each tool can be used independently, allowing you to utilize them even when you only need a specific stage.
Frontends for C-family languages
The Clang frontend is used to compile C, C++, Objective-C, and Objective-C++ code. Clang converts source code into LLVM bitcode, after which LLVM completes the process by turning it into an object file. This structure allows the frontend and backend to be managed separately, and it enables the reuse of existing LLVM infrastructure when supporting new languages.
Ecosystem components provided together
In addition to the compiler itself, several components required for the compilation process are included in this repository. Notable examples include libc++, the C++ standard library, and LLD, the linker. These components are built alongside LLVM to form an integrated toolchain. They are also designed to be separated from the source code for individual use if needed.
Obtaining source code and build methods
Specific procedures for obtaining the source code and building it are detailed on the 'Getting Started with LLVM' page. This repository does not include build scripts or automation tools, so you must set up the build environment directly according to the official documentation. If you wish to contribute, you should refer to the 'Contributing to LLVM' guide.
Items to check before use
This repository contains source code, not finished compiler binaries. Therefore, you need an environment and time to build it yourself. While LLVM is widely used as a standard for compiler infrastructure, you should verify the stability and support scope of specific versions through release notes and official documentation. Community communication channels include the Discourse forum, Discord chat, and office hours, and participants must adhere to the project's code of conduct.