Skip to content

Commit 8437175

Browse files
committed
feat: add llvm 19 support
1 parent ab2872a commit 8437175

File tree

25 files changed

+64
-10
lines changed

25 files changed

+64
-10
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
runs-on: ubuntu-latest
2929
env:
3030
LLVM_INSTALL_PATH: ~/llvm
31-
LLVM_VERSION: "18"
32-
LLVM_VERSION_IN_FEATURE: "18-1"
33-
LLVM_LIB_NAME: "libLLVM.so.18.1"
31+
LLVM_VERSION: "19"
32+
LLVM_VERSION_IN_FEATURE: "19-1"
33+
LLVM_LIB_NAME: "libLLVM.so.19.1"
3434
steps:
3535
- name: Checkout Repo
3636
uses: actions/checkout@v2

.github/workflows/linux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-linux-x86_64.tar.gz", "libLLVM-16.so"]
2626
- ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-linux-x86_64.tar.gz", "libLLVM-17.so"]
2727
- ["18", "18-1", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-linux-x86_64.tar.gz", "libLLVM.so.18.1"]
28+
- ["19", "19-1", "v19.1.5-rust-1.84/llvm-lld-19.1.5-rust-1.84-linux-x86_64.tar.gz", "libLLVM.so.19.1"]
2829
steps:
2930
- name: Checkout Repo
3031
uses: actions/checkout@v2
@@ -149,6 +150,7 @@ jobs:
149150
- ["16", "16-0", "1.71", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-linux-x86_64.tar.gz", "libLLVM-16.so"]
150151
- ["17", "17-0", "1.75", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-linux-x86_64.tar.gz", "libLLVM-17.so"]
151152
- ["18", "18-1", "1.78", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-linux-x86_64.tar.gz", "libLLVM.so.18.1"]
153+
- ["19", "19-1", "1.84", "v19.1.5-rust-1.84/llvm-lld-19.1.5-rust-1.84-linux-x86_64.tar.gz", "libLLVM.so.19.1"]
152154
steps:
153155
- name: Checkout Repo
154156
uses: actions/checkout@v2

.github/workflows/macos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-macos-x86_64.tar.gz", "macos-13"]
2525
- ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-macos-x86_64.tar.gz", "macos-13"]
2626
- ["18", "18-1", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-macos-arm64.tar.gz", "macos-latest"]
27+
- ["19", "19-1", "v19.1.5-rust-1.84/llvm-lld-19.1.5-rust-1.84-macos-arm64.tar.gz", "macos-latest"]
2728
steps:
2829
- name: Checkout Repo
2930
uses: actions/checkout@v2

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ jobs:
3636
runs-on: ubuntu-latest
3737
env:
3838
LLVM_INSTALL_PATH: ~/llvm
39-
LLVM_VERSION: "18"
40-
LLVM_VERSION_IN_FEATURE: "18-1"
41-
LLVM_LIB_NAME: "libLLVM.so.18.1"
39+
LLVM_VERSION: "19"
40+
LLVM_VERSION_IN_FEATURE: "19-1"
41+
LLVM_LIB_NAME: "libLLVM.so.19.1"
4242
steps:
4343
- name: Checkout the repository
4444
uses: actions/checkout@v4

.github/workflows/windows.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-windows-x86_64.7z"]
2525
- ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-windows-x86_64.7z"]
2626
- ["18", "18-1", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-windows-x86_64.7z"]
27+
- ["19", "19-1", "v19.1.5-rust-1.84/llvm-lld-19.1.5-rust-1.84-windows-x86_64.7z"]
2728
steps:
2829
- name: Checkout Repo
2930
uses: actions/checkout@v2
@@ -147,6 +148,7 @@ jobs:
147148
- ["16", "16-0", "1.71", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-windows-x86_64.7z"]
148149
- ["17", "17-0", "1.75", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-windows-x86_64.7z"]
149150
- ["18", "18-1", "1.78", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-windows-x86_64.7z"]
151+
- ["19", "19-1", "1.84", "v19.1.5-rust-1.84/llvm-lld-19.1.5-rust-1.84-windows-x86_64.7z"]
150152
steps:
151153
- name: Checkout Repo
152154
uses: actions/checkout@v2

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[workspace]
22
resolver = "2"
33
members = ["llvm-plugin", "llvm-plugin-macros"]
4+
5+
[patch.crates-io]
6+
inkwell = { git = "https://github.com/stevefan1999-personal/inkwell" }

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ When importing this crate in your `Cargo.toml`, you will need to specify the LLV
2727

2828
```toml
2929
[dependencies]
30-
llvm-plugin = { version = "0.6", features = ["llvm18-1"] }
30+
llvm-plugin = { version = "0.6", features = ["llvm19-1"] }
3131
```
3232

33-
Supported versions: LLVM 10-18 mapping to a cargo feature flag `llvmX-Y` where `X` and `Y` are the LLVM major and minor versions.
33+
Supported versions: LLVM 10-19 mapping to a cargo feature flag `llvmX-Y` where `X` and `Y` are the LLVM major and minor versions.
3434

3535
## Getting Started
3636

examples/inject_printf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use llvm_plugin::{
1313
feature = "llvm16-0",
1414
feature = "llvm17-0",
1515
feature = "llvm18-1",
16+
feature = "llvm19-1",
1617
)))]
1718
macro_rules! ptr_type {
1819
($cx:ident, $ty:ident) => {
@@ -24,6 +25,7 @@ macro_rules! ptr_type {
2425
feature = "llvm16-0",
2526
feature = "llvm17-0",
2627
feature = "llvm18-1",
28+
feature = "llvm19-1",
2729
))]
2830
macro_rules! ptr_type {
2931
($cx:ident, $ty:ident) => {

examples/strings.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use llvm_plugin::{
1515
feature = "llvm16-0",
1616
feature = "llvm17-0",
1717
feature = "llvm18-1",
18+
feature = "llvm19-1",
1819
)))]
1920
macro_rules! ptr_type {
2021
($cx:ident, $ty:ident) => {
@@ -26,6 +27,7 @@ macro_rules! ptr_type {
2627
feature = "llvm16-0",
2728
feature = "llvm17-0",
2829
feature = "llvm18-1",
30+
feature = "llvm19-1",
2931
))]
3032
macro_rules! ptr_type {
3133
($cx:ident, $ty:ident) => {
@@ -189,6 +191,7 @@ fn create_decode_fn<'a>(module: &mut Module<'a>) -> FunctionValue<'a> {
189191
feature = "llvm16-0",
190192
feature = "llvm17-0",
191193
feature = "llvm18-1",
194+
feature = "llvm19-1",
192195
)))]
193196
let var10 = unsafe {
194197
builder.build_gep(
@@ -203,6 +206,7 @@ fn create_decode_fn<'a>(module: &mut Module<'a>) -> FunctionValue<'a> {
203206
feature = "llvm16-0",
204207
feature = "llvm17-0",
205208
feature = "llvm18-1",
209+
feature = "llvm19-1",
206210
))]
207211
let var10 = unsafe {
208212
builder.build_gep(
@@ -218,6 +222,7 @@ fn create_decode_fn<'a>(module: &mut Module<'a>) -> FunctionValue<'a> {
218222
feature = "llvm16-0",
219223
feature = "llvm17-0",
220224
feature = "llvm18-1",
225+
feature = "llvm19-1",
221226
)))]
222227
let var11 = builder
223228
.build_load(phi1.as_basic_value().into_pointer_value(), "")
@@ -227,6 +232,7 @@ fn create_decode_fn<'a>(module: &mut Module<'a>) -> FunctionValue<'a> {
227232
feature = "llvm16-0",
228233
feature = "llvm17-0",
229234
feature = "llvm18-1",
235+
feature = "llvm19-1",
230236
))]
231237
let var11 = builder
232238
.build_load(cx.i8_type(), phi1.as_basic_value().into_pointer_value(), "")
@@ -285,6 +291,7 @@ fn create_decode_stub<'a>(
285291
feature = "llvm16-0",
286292
feature = "llvm17-0",
287293
feature = "llvm18-1",
294+
feature = "llvm19-1",
288295
)))]
289296
let s = builder
290297
.build_struct_gep(gs.as_pointer_value(), id, "")
@@ -294,6 +301,7 @@ fn create_decode_stub<'a>(
294301
feature = "llvm16-0",
295302
feature = "llvm17-0",
296303
feature = "llvm18-1",
304+
feature = "llvm19-1",
297305
))]
298306
let s = {
299307
let i8_ty_ptr = ptr_type!(cx, i8_type);

llvm-plugin/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ llvm14-0 = ["inkwell/llvm14-0-no-llvm-linking"]
3232
llvm15-0 = ["inkwell/llvm15-0-no-llvm-linking"]
3333
llvm16-0 = ["inkwell/llvm16-0-no-llvm-linking"]
3434
llvm17-0 = ["inkwell/llvm17-0-no-llvm-linking"]
35-
llvm18-1 = ["inkwell/llvm18-0-no-llvm-linking"]
35+
llvm18-1 = ["inkwell/llvm18-1-no-llvm-linking"]
36+
llvm19-1 = ["inkwell/llvm19-1-no-llvm-linking"]
3637

3738
target-x86 = ["inkwell/target-x86"]
3839
target-arm = ["inkwell/target-arm"]
@@ -53,7 +54,7 @@ target-riscv = ["inkwell/target-riscv"]
5354
target-all = ["inkwell/target-all"]
5455

5556
[dependencies]
56-
inkwell = "0.5"
57+
inkwell = "0.6"
5758
llvm-plugin-macros = { path = "../llvm-plugin-macros", version = "0.2", optional = true }
5859

5960
[build-dependencies]

0 commit comments

Comments
 (0)