LLVM and Clang
A modular compiler toolchain and C/C++ frontend.
LLVM is a compiler infrastructure built around a typed, language-agnostic intermediate representation. Compilers for many languages (Clang for C/C++, Rust, Swift, Julia, Crystal, Zig, mojo, and more) all target LLVM IR, which then gets optimised and translated to machine code by the LLVM backend. The modular design lets multiple frontends share the same optimisation passes and target backends.
Clang, the LLVM project's C/C++/Objective-C frontend, compiles competitively with GCC while producing significantly clearer error messages and offering better support for tooling such as static analysers, source formatters (clang-format), language servers (clangd), and refactoring tools. Apple uses Clang as its system compiler on macOS and iOS, which has driven much of LLVM's investment in C++ language conformance.
Chris Lattner started LLVM in 2000 as a research project at the University of Illinois Urbana-Champaign. The LLVM Foundation governs the project today, with releases approximately every six months. LLVM has become the most widely-used compiler infrastructure in the world. The Apache 2.0 with LLVM exception licence keeps the codebase broadly usable, including in proprietary toolchains.
Install
Debian/Ubuntu: sudo apt install clang lld llvm Fedora/RHEL: sudo dnf install clang lld llvm Arch: sudo pacman -S clang lld llvm macOS: brew install llvm
Authors
- Chris Lattner (creator, 2000)
- LLVM Foundation contributors