Getting Started
Grab the LLVM source
Clone the official LLVM repository from GitHub.
git clone https://github.com/llvm/llvm-project.git
Checkout the LLVM version
Checkout the commit 7602d781b03427052c44537fa4b9c2a6da15697c
.
You can create a new branch from here.
cd llvm-projectgit checkout 7602d781b03427052c44537fa4b9c2a6da15697cgit switch -c your-branch-name
Build the LLVM project. See all options at Building LLVM with CMake.
Here is an example: (the Nova
target is what we will add, so it won’t work yet)
Nova can be enabled after the Target Triple chapter.
cmake -S llvm -B build -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_BUILD_TESTS=ON \ -DLLVM_PARALLEL_LINK_JOBS=8 \ -DLLVM_TARGETS_TO_BUILD='X86;Mips;Nova' # Nova won't work yet
cmake --build build --target llc