-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
LLVM Upgrade Process
Andrew Kelley edited this page Feb 14, 2020
·
36 revisions
This page documents how to update the Zig source code to a new LLVM version.
- Update the version numbers in:
README.md
cmake/Findllvm.cmake
cmake/Findclang.cmake
cmake/Findlld.cmake
- Do a git diff in LLVM's compiler-rt project to find out what has changed since the previous release. Apply the relevant changes to Zig.
- Build LLVM, clang, and LLD in debug mode.
- Update
src/zig_clang_*.cpp
to the new versions. Before updating, replace each file with the original file from the old LLVM version and do agit diff
to see what patches have been applied by Zig. Then update each file to the versions from the new LLVM, and re-apply the patches as necessary.-
src/zig_clang_driver.cpp
corresponds tollvm-project/clang/tools/driver/driver.cpp
-
src/zig_clang_cc1_main.cpp
corresponds tollvm-project/clang/tools/driver/cc1_main.cpp
-
src/zig_clang_cc1as_main.cpp
corresponds tollvm-project/clang/tools/driver/cc1as_main.cpp
-
- Update
lib/include/
to the latestclang_install_prefix/lib/clang/X.Y.Z/include/
. - Update
lib/libcxx/
to the latestllvm-project/libcxx/
. Only theinclude/
directory andLICENSE.txt
are copied. Cmake files are not copied. - Update
lib/libunwind/
to the latestllvm-project/libunwind/
. Only theinclude/
,src/
directories andLICENSE.txt
are copied. Cmake files are not copied. - Run llvm-target-details-generator with the new LLVM version. Commit the diff to the repository. Using the generated diff, update CPUs and target features in the Zig source repo correspondingly. Think carefully before deleting things, since this could represent breaking changes.
- Update the CI scripts to the new version
- Update How to build LLVM, libclang, and liblld from source
- Update Building Zig on Windows
- Update the static asserts at the bottom of src/zig_llvm.cpp
- Build zig in debug mode with the debug mode llvm, clang, lld, and run the full Zig test suite. This takes several hours.
master branch is always the latest LLVM release. The llvmX
branch is kept up to date with the next LLVM release. The day that LLVM is released, we merge the llvmX
branch into master, and start the next llvmX
branch, following this upgrade process.