Build and install

CIR is enabled by adding the cir keyword to LLVM_ENABLE_PROJECTS, note that it requires both mlir and clang projects to also be enabled. Other than that it works with a regular build of Clang/LLVM.

... -DLLVM_ENABLE_PROJECTS="clang;mlir;cir;..." ...

See the steps here for general instruction on how to build LLVM.

For example, building and installing CIR enabled clang on macOS could look like:

CLANG=`xcrun -f clang`

$ cd llvm-project/llvm
$ mkdir build-release; cd build-release
$ /Applications/ -GNinja \
 -DLLVM_ENABLE_PROJECTS="clang;mlir;cir" \
$ ninja install

Check for cir-tool to confirm all is fine:

$ /tmp/install-llvm/bin/cir-tool --help