This repo provides an example usage for LLVM IR cmake pipelines.
- cmake 3.2.0 or later
- LLVM IR cmake pipelines
- LLVM IR cmake utilities
- LLVM/Clang
git clone --recursive
this repo.- Create a directory for an out-of-source build and
cd
into it. - Provide the appropriate option to
cmake
during configuration. For examples on the various options have a look at the export scripts (provided for convenience) located in theutils/scripts/build
subdirectory. Then, you can use thebuild.sh
script located in the same directory to build the project.
This repository provides 2 example uses for generating LLVM
IR bitcode using:
First, the subproject under the subdirectory statically
shows how to use a chain/pipeline of various LLVM
opt
passes by specifying them in the lists file. For this, see the configuration options in the following export scripts
under utils/scripts/build
:
exports_deps1.sh
exports_deps2.sh
Second, the subproject under the subdirectory dynamically
provides a working example on how to chain/pipeline and
group passes by specifying their order during configuration. For this, see the configuration options in the following
export scripts under utils/scripts/build
:
exports_deps3.sh
exports_deps4.sh