Skip to content

Commit

Permalink
Upgrade to LLVM 19.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Il-Capitano committed Sep 23, 2024
1 parent b83cbd7 commit c9569e5
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
26 changes: 13 additions & 13 deletions .cppb/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
},
"linux": {
"link_dependencies": [ "ryu_format.linux.o" ],
"compiler": "clang-18",
"libraries": [ "LLVM-18", "backtrace" ],
"link_flags": [ "-fuse-ld=lld-18" ],
"compiler": "clang-19",
"libraries": [ "LLVM-19", "backtrace" ],
"link_flags": [ "-fuse-ld=lld-19" ],
"emit_compile_commands": false
},
"debug": {
Expand Down Expand Up @@ -106,7 +106,7 @@
},
"linux": {
"compiler": "gcc-12",
"libraries": [ "LLVM-18", "backtrace" ],
"libraries": [ "LLVM-19", "backtrace" ],
"link_flags": [ "-fuse-ld=lld" ],
"warnings": [ "no-unused-parameter" ]
},
Expand Down Expand Up @@ -188,9 +188,9 @@
},
"linux": {
"link_dependencies": [ "ryu_format.linux.o" ],
"compiler": "clang-18",
"compiler": "clang-19",
"libraries": [ "backtrace" ],
"link_flags": [ "-fuse-ld=lld-18" ],
"link_flags": [ "-fuse-ld=lld-19" ],
"emit_compile_commands": false
},
"debug": {
Expand All @@ -216,7 +216,7 @@
"link_flags": [ "-fuse-ld=lld" ]
},
"linux": {
"link_flags": [ "-fuse-ld=lld-18" ]
"link_flags": [ "-fuse-ld=lld-19" ]
},
"debug": {
"optimization": "0",
Expand Down Expand Up @@ -255,7 +255,7 @@
},
"generate_config.out": {
"dependencies": [ "scripts/generate_config.cpp" ],
"command": "clang++-18 -std=c++20 -Isrc -Iinclude scripts/generate_config.cpp -o generate_config.out"
"command": "clang++-19 -std=c++20 -Isrc -Iinclude scripts/generate_config.cpp -o generate_config.out"
},
"generate-config": {
"windows": {
Expand Down Expand Up @@ -299,7 +299,7 @@
},
"generate_lexer.out": {
"dependencies": [ "scripts/generate_lexer.cpp", "src/token_info.h" ],
"command": "clang++-18 -std=c++20 -Isrc -Iinclude scripts/generate_lexer.cpp -o generate_lexer.out"
"command": "clang++-19 -std=c++20 -Isrc -Iinclude scripts/generate_lexer.cpp -o generate_lexer.out"
},
"generate-lexer": {
"windows": {
Expand All @@ -319,7 +319,7 @@
},
"ryu_format.linux.o": {
"dependencies": [ "ryu_format.linux.bc" ],
"command": "llc-18 ryu_format.linux.bc --filetype=obj --relocation-model=pic -o ryu_format.linux.o"
"command": "llc-19 ryu_format.linux.bc --filetype=obj --relocation-model=pic -o ryu_format.linux.o"
},
"ryu_format.windows.bc": {
"dependencies": [ "ryu_format.bz" ],
Expand Down Expand Up @@ -351,19 +351,19 @@
},
"a.out": {
"dependencies": [ "bitcode_test.o" ],
"command": "clang-18 bitcode_test.o -lm -o a.out -fuse-ld=lld-18"
"command": "clang-19 bitcode_test.o -lm -o a.out -fuse-ld=lld-19"
},
"run-tests": {
"command": "python3 scripts/run_tests.py",
"is_file": false
},
"fuzz-test/lex/fuzz.o": {
"dependencies": [ "fuzz-test/lex/fuzz.cpp" ],
"command": "clang++-18 -c -g `llvm-config-18 --cxxflags` -std=c++20 -fno-omit-frame-pointer -fsanitize=fuzzer,address -Isrc -Iinclude -DBOZON_NO_ARENA -Wall -Wextra -Wno-unused-parameter -Wno-c++20-extensions -Wno-defaulted-function-deleted -O1 -o fuzz-test/lex/fuzz.o fuzz-test/lex/fuzz.cpp"
"command": "clang++-19 -c -g `llvm-config-19 --cxxflags` -std=c++20 -fno-omit-frame-pointer -fsanitize=fuzzer,address -Isrc -Iinclude -DBOZON_NO_ARENA -Wall -Wextra -Wno-unused-parameter -Wno-c++20-extensions -Wno-defaulted-function-deleted -O1 -o fuzz-test/lex/fuzz.o fuzz-test/lex/fuzz.cpp"
},
"fuzz-test/lex/fuzz.out": {
"dependencies": [ "fuzz-test/lex/fuzz.o" ],
"command": "clang++-18 -o fuzz-test/lex/fuzz.out fuzz-test/lex/fuzz.o `llvm-config-18 --ldflags --libs --system-libs` -fsanitize=fuzzer,address -fuse-ld=lld -Wl,--unresolved-symbols=ignore-in-object-files"
"command": "clang++-19 -o fuzz-test/lex/fuzz.out fuzz-test/lex/fuzz.o `llvm-config-19 --ldflags --libs --system-libs` -fsanitize=fuzzer,address -fuse-ld=lld -Wl,--unresolved-symbols=ignore-in-object-files"
},
"run-lex-fuzzer": {
"dependencies": [ "fuzz-test/lex/fuzz.out" ],
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ jobs:
- uses: actions/checkout@v4
- name: Install packages
run: |
printf "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main" | sudo tee /etc/apt/sources.list.d/llvm-toolchain-focal-18.list
printf "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-19 main" | sudo tee /etc/apt/sources.list.d/llvm-toolchain-focal-19.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt update
sudo apt install gcc gcc-12 g++-12 llvm-18 lld-18 clang-18 libfmt-dev nlohmann-json3-dev libssl-dev python3
sudo apt install gcc gcc-12 g++-12 llvm-19 lld-19 clang-19 libfmt-dev nlohmann-json3-dev libssl-dev python3
- name: Install libbacktrace
run: |
git clone https://github.com/ianlancetaylor/libbacktrace.git
Expand All @@ -112,7 +112,7 @@ jobs:
git clone https://github.com/Il-Capitano/cppb.git
cd cppb
mkdir bin
make CXX=clang++-18 LD=lld-18
make CXX=clang++-19 LD=lld-19
cd ..
- run: touch ryu_format.linux.bc
- name: Build bozon
Expand All @@ -136,10 +136,10 @@ jobs:
- uses: actions/checkout@v4
- name: Install packages
run: |
printf "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main" | sudo tee /etc/apt/sources.list.d/llvm-toolchain-focal-18.list
printf "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-19 main" | sudo tee /etc/apt/sources.list.d/llvm-toolchain-focal-19.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt update
sudo apt install gcc lld gcc-12 g++-12 llvm-18 lld-18 clang-18 libfmt-dev nlohmann-json3-dev libssl-dev python3
sudo apt install gcc lld gcc-12 g++-12 llvm-19 lld-19 clang-19 libfmt-dev nlohmann-json3-dev libssl-dev python3
- name: Install libbacktrace
run: |
git clone https://github.com/ianlancetaylor/libbacktrace.git
Expand All @@ -152,7 +152,7 @@ jobs:
git clone https://github.com/Il-Capitano/cppb.git
cd cppb
mkdir bin
make CXX=clang++-18 LD=lld-18
make CXX=clang++-19 LD=lld-19
cd ..
- run: touch ryu_format.linux.bc
- name: Build bozon
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Bozon is a general-purpose compiled programming language that aims to provide hi
The only tested platforms at the moment are Windows with [MSYS2](https://www.msys2.org/) and Ubuntu 22.04+.

Required libraries:
* LLVM 17.x
* LLVM 19.x
* dwarfstack (Windows only)
* [libbacktrace](https://github.com/ianlancetaylor/libbacktrace) (Linux only)

Expand Down
Binary file modified ryu_format.linux.bc
Binary file not shown.
Binary file modified ryu_format.windows.bc
Binary file not shown.
4 changes: 2 additions & 2 deletions scripts/generate_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ static bz::u8string to_upper(bz::u8string_view s)
static bool has_llvm(void)
{
return bz::run_process("llvm-config", bz::array_view<char const * const>{ "--version" }).return_code != 0
|| bz::run_process("llvm-config-18", bz::array_view<char const * const>{ "--version" }).return_code != 0;
|| bz::run_process("llvm-config-19", bz::array_view<char const * const>{ "--version" }).return_code != 0;
}

static bz::optional<bz::u8string> get_llvm_default_target(void)
{
for (auto const llvm_config : { "llvm-config", "llvm-config-18" })
for (auto const llvm_config : { "llvm-config", "llvm-config-19" })
{
auto process_result = bz::run_process(llvm_config, bz::array_view<char const * const>{ "--host-target" });
if (process_result.return_code == 0)
Expand Down
6 changes: 3 additions & 3 deletions src/codegen/llvm_latest/backend_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include <llvm/Passes/PassBuilder.h>
#include <llvm/Bitcode/BitcodeWriter.h>

#if LLVM_VERSION_MAJOR != 18
#error LLVM 18 is required
#endif // LLVM 18
#if LLVM_VERSION_MAJOR != 19
#error LLVM 19 is required
#endif // LLVM 19

namespace codegen::llvm_latest
{
Expand Down

0 comments on commit c9569e5

Please sign in to comment.