LLVM project master repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sjoerd Meijer 342bbb7832 [FuncSpec] Don't specialise functions with NoDuplicate instructions. 4 days ago
.github Removing the main to master sync GitHub workflow. 5 months ago
clang [clang] NFC: adjust indentation of statements with more than one lines 13 hours ago
clang-tools-extra [clangd] Type hints for C++14 return type deduction 10 hours ago
compiler-rt [profile] Fix variable name 2 days ago
debuginfo-tests [Dexter] Remove erroneously added diff file 4 weeks ago
flang [flang] Implement constant folding for the NOT intrinsic 1 day ago
libc [libc][Obvious] Add the new header file PlatformDefs.h to the fputil target. 3 days ago
libclc Support: Stop using F_{None,Text,Append} compatibility synonyms, NFC 2 months ago
libcxx [libcxx] Implement P0883R2 ("Fixing Atomic Initialization") 1 day ago
libcxxabi [libc++] Promote GCC 11 to mandatory CI 6 days ago
libunwind [libcxx] Fix exception raised during downstream bare-metal libunwind tests 5 days ago
lld [lld/mac] Make a variable more local; no behavior change 13 hours ago
lldb Try to unbreak the windows CI 19 hours ago
llvm [FuncSpec] Don't specialise functions with NoDuplicate instructions. 7 hours ago
mlir [mlir][linalg] Support low padding in subtensor(pad_tensor) lowering 8 hours ago
openmp [AMDGPU][Libomptarget] Remove redundant functions 9 hours ago
parallel-libs Try enabling -Wsuggest-override again, using add_compile_options instead of add_compile_definitions for disabling it in unittests/ directories. 11 months ago
polly [Polly][Isl] Refactoring IslAstInfo::getBuild() and IslAstInfo::IslAstUserPayload::Build to use isl++. NFC 3 days ago
pstl [pstl] Workaround more errors in the test suite 4 weeks ago
runtimes [runtimes] Add the libc project to the list of runtimes. 3 months ago
utils/arcanist [utils] Don't print username in arcanist clang format message 1 month ago
.arcconfig Add modern arc config for default "onto" branch 4 months ago
.arclint PR46997: don't run clang-format on clang's testcases. 11 months ago
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2 years ago
.clang-tidy .clang-tidy: Disable misc-no-recursion in general/across the monorepo 2 weeks ago
.git-blame-ignore-revs [lldb] Add 9494c510af56 to .git-blame-ignore-revs 2 weeks ago
.gitignore [NFC] Add CMakeUserPresets.json filename to .gitignore 5 months ago
.mailmap Update my mailmap 2 weeks ago
CONTRIBUTING.md Add contributing info to CONTRIBUTING.md and README.md 2 years ago
README.md Fix grammar in README.md 1 month ago
SECURITY.md [docs] Describe reporting security issues on the chromium tracker. 1 month ago


The LLVM Compiler Infrastructure

This directory and its sub-directories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.

The README briefly describes how to get started with building LLVM. For more information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.

Getting Started with the LLVM System

Taken from https://llvm.org/docs/GettingStarted.html.


Welcome to the LLVM project!

The LLVM project has multiple components. The core of the project is itself called "LLVM". This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer. It also contains basic regression tests.

C-like languages use the Clang front end. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.

Other components include: the libc++ C++ standard library, the LLD linker, and more.

Getting the Source Code and Building LLVM

The LLVM Getting Started documentation may be out of date. The Clang Getting Started page might have more accurate information.

This is an example work-flow and configuration to get and build the LLVM source:

  1. Checkout LLVM (including related sub-projects like Clang):

    • git clone https://github.com/llvm/llvm-project.git

    • Or, on windows, git clone --config core.autocrlf=false https://github.com/llvm/llvm-project.git

  2. Configure and build LLVM and Clang:

    • cd llvm-project

    • cmake -S llvm -B build -G <generator> [options]

      Some common build system generators are:

      • Ninja --- for generating Ninja build files. Most llvm developers use Ninja.
      • Unix Makefiles --- for generating make-compatible parallel makefiles.
      • Visual Studio --- for generating Visual Studio projects and solutions.
      • Xcode --- for generating Xcode projects.

      Some Common options:

      • -DLLVM_ENABLE_PROJECTS='...' --- semicolon-separated list of the LLVM sub-projects you'd like to additionally build. Can include any of: clang, clang-tools-extra, libcxx, libcxxabi, libunwind, lldb, compiler-rt, lld, polly, or debuginfo-tests.

        For example, to build LLVM, Clang, libcxx, and libcxxabi, use -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi".

      • -DCMAKE_INSTALL_PREFIX=directory --- Specify for directory the full path name of where you want the LLVM tools and libraries to be installed (default /usr/local).

      • -DCMAKE_BUILD_TYPE=type --- Valid options for type are Debug, Release, RelWithDebInfo, and MinSizeRel. Default is Debug.

      • -DLLVM_ENABLE_ASSERTIONS=On --- Compile with assertion checks enabled (default is Yes for Debug builds, No for all other build types).

    • cmake --build build [-- [options] <target>] or your build system specified above directly.

      • The default target (i.e. ninja or make) will build all of LLVM.

      • The check-all target (i.e. ninja check-all) will run the regression tests to ensure everything is in working order.

      • CMake will generate targets for each tool and library, and most LLVM sub-projects generate their own check-<project> target.

      • Running a serial build will be slow. To improve speed, try running a parallel build. That's done by default in Ninja; for make, use the option -j NNN, where NNN is the number of parallel jobs, e.g. the number of CPUs you have.

    • For more information see CMake

Consult the Getting Started with LLVM page for detailed information on configuring and compiling LLVM. You can visit Directory Layout to learn about the layout of the source code tree.