diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2bf04f0..43e12c7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,6 +28,7 @@ jobs: env: LLVM_INSTALL_PATH: ~/llvm LLVM_VERSION: "14" + LLVM_LIB_NAME: "libLLVM-14.so" steps: - name: Checkout Repo uses: actions/checkout@v2 @@ -44,7 +45,7 @@ jobs: path: | ${{ env.LLVM_INSTALL_PATH }}/bin/llvm-config ${{ env.LLVM_INSTALL_PATH }}/bin/opt - ${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM-${{ env.LLVM_VERSION }}.so + ${{ env.LLVM_INSTALL_PATH }}/lib/${{ env.LLVM_LIB_NAME }} ${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM.so ${{ env.LLVM_INSTALL_PATH }}/include key: ${{ runner.os }}-llvm-${{ env.LLVM_VERSION }}-opt @@ -58,7 +59,7 @@ jobs: clang-tidy \ llvm-plugin/cpp/*.{cc,hh} \ --warnings-as-errors='*,-llvm-header-guard' \ - -- -I"$HOME/llvm/include" -std=c++17 -DLLVM${{ env.LLVM_VERSION }}_0 + -- -I"$HOME/llvm/include" -std=c++17 -DLLVM_VERSION_MAJOR=${{ env.LLVM_VERSION }} - name: Clippy Lint run: | diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 26e42f3..d10b86e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -15,14 +15,15 @@ jobs: strategy: matrix: llvm-version: - - ["10", "10-0", "v10.0.1-rust-1.46/llvm-10.0.1-rust-1.46-linux.tar.gz"] - - ["11", "11-0", "v11.0.1-rust-1.51/llvm-lld-11.0.1-rust-1.51-linux.tar.gz"] - - ["12", "12-0", "v12.0.1-rust-1.55/llvm-lld-12.0.1-rust-1.55-linux.tar.gz"] - - ["13", "13-0", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-linux.tar.gz"] - - ["14", "14-0", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-linux.tar.gz"] - - ["15", "15-0", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-linux.tar.gz"] - - ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-linux.tar.gz"] - - ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-linux.tar.gz"] + - ["10", "10-0", "v10.0.1-rust-1.46/llvm-10.0.1-rust-1.46-linux.tar.gz", "libLLVM-10.so"] + - ["11", "11-0", "v11.0.1-rust-1.51/llvm-lld-11.0.1-rust-1.51-linux.tar.gz", "libLLVM-11.so"] + - ["12", "12-0", "v12.0.1-rust-1.55/llvm-lld-12.0.1-rust-1.55-linux.tar.gz", "libLLVM-12.so"] + - ["13", "13-0", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-linux.tar.gz", "libLLVM-13.so"] + - ["14", "14-0", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-linux.tar.gz", "libLLVM-14.so"] + - ["15", "15-0", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-linux.tar.gz", "libLLVM-15.so"] + - ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-linux.tar.gz", "libLLVM-16.so"] + - ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-linux.tar.gz", "libLLVM-17.so"] + - ["18", "18-0", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-linux.tar.gz", "libLLVM.so.18.1"] steps: - name: Checkout Repo uses: actions/checkout@v2 @@ -39,7 +40,7 @@ jobs: path: | ${{ env.LLVM_INSTALL_PATH }}/bin/llvm-config ${{ env.LLVM_INSTALL_PATH }}/bin/opt - ${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM-${{ matrix.llvm-version[0] }}.so + ${{ env.LLVM_INSTALL_PATH }}/lib/${{ matrix.llvm-version[3] }} ${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM.so ${{ env.LLVM_INSTALL_PATH }}/include key: ${{ runner.os }}-llvm-${{ matrix.llvm-version[0] }}-opt @@ -105,13 +106,14 @@ jobs: strategy: matrix: llvm-version: - - ["11", "11-0", "1.51", "v11.0.1-rust-1.51/llvm-lld-11.0.1-rust-1.51-linux.tar.gz"] - - ["12", "12-0", "1.55", "v12.0.1-rust-1.55/llvm-lld-12.0.1-rust-1.55-linux.tar.gz"] - - ["13", "13-0", "1.59", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-linux.tar.gz"] - - ["14", "14-0", "1.64", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-linux.tar.gz"] - - ["15", "15-0", "1.65", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-linux.tar.gz"] - - ["16", "16-0", "1.71", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-linux.tar.gz"] - - ["17", "17-0", "1.75", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-linux.tar.gz"] + - ["11", "11-0", "1.51", "v11.0.1-rust-1.51/llvm-lld-11.0.1-rust-1.51-linux.tar.gz", "libLLVM-11.so"] + - ["12", "12-0", "1.55", "v12.0.1-rust-1.55/llvm-lld-12.0.1-rust-1.55-linux.tar.gz", "libLLVM-12.so"] + - ["13", "13-0", "1.59", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-linux.tar.gz", "libLLVM-13.so"] + - ["14", "14-0", "1.64", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-linux.tar.gz", "libLLVM-14.so"] + - ["15", "15-0", "1.65", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-linux.tar.gz", "libLLVM-15.so"] + - ["16", "16-0", "1.71", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-linux.tar.gz", "libLLVM-16.so"] + - ["17", "17-0", "1.75", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-linux.tar.gz", "libLLVM-17.so"] + - ["18", "18-0", "1.78", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-linux.tar.gz", "libLLVM.so.18.1"] steps: - name: Checkout Repo uses: actions/checkout@v2 @@ -129,7 +131,7 @@ jobs: ${{ env.LLVM_INSTALL_PATH }}/bin/llvm-config ${{ env.LLVM_INSTALL_PATH }}/bin/lld ${{ env.LLVM_INSTALL_PATH }}/bin/ld.lld - ${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM-${{ matrix.llvm-version[0] }}.so + ${{ env.LLVM_INSTALL_PATH }}/lib/${{ matrix.llvm-version[4] }} ${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM.so ${{ env.LLVM_INSTALL_PATH }}/include key: ${{ runner.os }}-llvm-${{ matrix.llvm-version[0] }}-lld diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b2cb7de..c447911 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -8,20 +8,21 @@ env: jobs: macos-tests: name: "LLVM ${{ matrix.llvm-version[0] }} MacOS" - runs-on: macos-latest + runs-on: ${{ matrix.llvm-version[3] }} env: LLVM_INSTALL_PATH: ~/llvm PLUGINS_PATH: tests/plugins/target/debug strategy: matrix: llvm-version: - - ["11", "11-0", "v11.0.1-rust-1.51/llvm-11.0.1-rust-1.51-macos.tar.gz"] - - ["12", "12-0", "v12.0.1-rust-1.55/llvm-lld-12.0.1-rust-1.55-macos.tar.gz"] - - ["13", "13-0", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-macos.tar.gz"] - - ["14", "14-0", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-macos.tar.gz"] - - ["15", "15-0", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-macos.tar.gz"] - - ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-macos.tar.gz"] - - ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-macos.tar.gz"] + - ["11", "11-0", "v11.0.1-rust-1.51/llvm-11.0.1-rust-1.51-macos.tar.gz", "macos-13"] + - ["12", "12-0", "v12.0.1-rust-1.55/llvm-lld-12.0.1-rust-1.55-macos.tar.gz", "macos-13"] + - ["13", "13-0", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-macos.tar.gz", "macos-13"] + - ["14", "14-0", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-macos.tar.gz", "macos-13"] + - ["15", "15-0", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-macos.tar.gz", "macos-13"] + - ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-macos.tar.gz", "macos-13"] + - ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-macos.tar.gz", "macos-13"] + - ["18", "18-0", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-macos.tar.gz", "macos-latest"] steps: - name: Checkout Repo uses: actions/checkout@v2 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3582da0..f9b9e3e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -22,6 +22,7 @@ jobs: - ["15", "15-0", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-windows.7z"] - ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-windows.7z"] - ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-windows.7z"] + - ["18", "18-0", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-windows.7z"] steps: - name: Checkout Repo uses: actions/checkout@v2 @@ -110,6 +111,7 @@ jobs: - ["15", "15-0", "1.65", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-windows.7z"] - ["16", "16-0", "1.71", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-windows.7z"] - ["17", "17-0", "1.75", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-windows.7z"] + - ["18", "18-0", "1.78", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-windows.7z"] steps: - name: Checkout Repo uses: actions/checkout@v2 diff --git a/README.md b/README.md index 455ccb4..44c2245 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ Supported versions: | 15.0.x | llvm15-0 | **✓** | **✓** | **✓** | | 16.0.x | llvm16-0 | **✓** | **✓** | **✓** | | 17.0.x | llvm17-0 | **✓** | **✓** | **✓** | +| 18.0.x | llvm18-0 | **✓** | **✓** | **✓** | ## Getting Started diff --git a/examples/strings.rs b/examples/strings.rs index 60e3616..8a75f46 100644 --- a/examples/strings.rs +++ b/examples/strings.rs @@ -151,7 +151,12 @@ fn create_decode_fn<'a>(module: &mut Module<'a>) -> FunctionValue<'a> { "", ) .unwrap(); - #[cfg(not(any(feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0")))] + #[cfg(not(any( + feature = "llvm15-0", + feature = "llvm16-0", + feature = "llvm17-0", + feature = "llvm18-0", + )))] let var10 = unsafe { builder.build_gep( phi1.as_basic_value().into_pointer_value(), @@ -160,7 +165,12 @@ fn create_decode_fn<'a>(module: &mut Module<'a>) -> FunctionValue<'a> { ) } .unwrap(); - #[cfg(any(feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0"))] + #[cfg(any( + feature = "llvm15-0", + feature = "llvm16-0", + feature = "llvm17-0", + feature = "llvm18-0", + ))] let var10 = unsafe { builder.build_gep( cx.i8_type(), @@ -170,9 +180,19 @@ fn create_decode_fn<'a>(module: &mut Module<'a>) -> FunctionValue<'a> { ) } .unwrap(); - #[cfg(not(any(feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0")))] + #[cfg(not(any( + feature = "llvm15-0", + feature = "llvm16-0", + feature = "llvm17-0", + feature = "llvm18-0", + )))] let var11 = builder.build_load(phi1.as_basic_value().into_pointer_value(), ""); - #[cfg(any(feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0"))] + #[cfg(any( + feature = "llvm15-0", + feature = "llvm16-0", + feature = "llvm17-0", + feature = "llvm18-0", + ))] let var11 = builder .build_load(cx.i8_type(), phi1.as_basic_value().into_pointer_value(), "") .unwrap(); @@ -229,11 +249,21 @@ fn create_decode_stub<'a>( (s, len) } GlobalString::Struct(gs, id, len) => { - #[cfg(not(any(feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0")))] + #[cfg(not(any( + feature = "llvm15-0", + feature = "llvm16-0", + feature = "llvm17-0", + feature = "llvm18-0", + )))] let s = builder .build_struct_gep(gs.as_pointer_value(), id, "") .unwrap(); - #[cfg(any(feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0"))] + #[cfg(any( + feature = "llvm15-0", + feature = "llvm16-0", + feature = "llvm17-0", + feature = "llvm18-0", + ))] let s = { let i8_ty_ptr = cx.i8_type().ptr_type(AddressSpace::default()); let struct_ty = cx.struct_type(&[i8_ty_ptr.into()], false); diff --git a/llvm-plugin/Cargo.toml b/llvm-plugin/Cargo.toml index baa8288..2d90a43 100644 --- a/llvm-plugin/Cargo.toml +++ b/llvm-plugin/Cargo.toml @@ -32,6 +32,7 @@ llvm14-0 = ["inkwell/llvm14-0-no-llvm-linking"] llvm15-0 = ["inkwell/llvm15-0-no-llvm-linking"] llvm16-0 = ["inkwell/llvm16-0-no-llvm-linking"] llvm17-0 = ["inkwell/llvm17-0-no-llvm-linking"] +llvm18-0 = ["inkwell/llvm18-0-no-llvm-linking"] target-x86 = ["inkwell/target-x86"] target-arm = ["inkwell/target-arm"] @@ -52,8 +53,8 @@ target-riscv = ["inkwell/target-riscv"] target-all = ["inkwell/target-all"] [dependencies] -inkwell = "0.4" -inkwell_internals = "0.9.0" +inkwell = { git = "https://github.com/TheDan64/inkwell", branch = "master" } +inkwell_internals = { git = "https://github.com/TheDan64/inkwell", branch = "master" } llvm-plugin-macros = { path = "../llvm-plugin-macros", version = "0.2", optional = true } [build-dependencies] diff --git a/llvm-plugin/build.rs b/llvm-plugin/build.rs index f5ceecd..c3979cf 100644 --- a/llvm-plugin/build.rs +++ b/llvm-plugin/build.rs @@ -28,9 +28,6 @@ fn main() { build.flag_if_supported("-fno-rtti"); } - build.define("LLVM_VERSION_MAJOR", major.to_string().as_str()); - build.define("LLVM_VERSION_MINOR", minor.to_string().as_str()); - build.warnings(false); build.compile("llvm-plugin-cpp"); @@ -216,6 +213,8 @@ mod llvm_sys { (16, 0) } else if cfg!(feature = "llvm17-0") { (17, 0) + } else if cfg!(feature = "llvm18-0") { + (18, 0) } else { panic!("Missing llvm* feature") } diff --git a/tests/plugins/plugin1-lld/Cargo.toml b/tests/plugins/plugin1-lld/Cargo.toml index eabe354..155881c 100644 --- a/tests/plugins/plugin1-lld/Cargo.toml +++ b/tests/plugins/plugin1-lld/Cargo.toml @@ -17,6 +17,7 @@ llvm14-0 = ["llvm-plugin/llvm14-0"] llvm15-0 = ["llvm-plugin/llvm15-0"] llvm16-0 = ["llvm-plugin/llvm16-0"] llvm17-0 = ["llvm-plugin/llvm17-0"] +llvm18-0 = ["llvm-plugin/llvm18-0"] target-x86 = ["llvm-plugin/target-x86"] target-arm = ["llvm-plugin/target-arm"] diff --git a/tests/plugins/plugin1/Cargo.toml b/tests/plugins/plugin1/Cargo.toml index e901ba5..a415336 100644 --- a/tests/plugins/plugin1/Cargo.toml +++ b/tests/plugins/plugin1/Cargo.toml @@ -18,6 +18,7 @@ llvm14-0 = ["llvm-plugin/llvm14-0"] llvm15-0 = ["llvm-plugin/llvm15-0"] llvm16-0 = ["llvm-plugin/llvm16-0"] llvm17-0 = ["llvm-plugin/llvm17-0"] +llvm18-0 = ["llvm-plugin/llvm18-0"] target-x86 = ["llvm-plugin/target-x86"] target-arm = ["llvm-plugin/target-arm"] diff --git a/tests/plugins/plugin2/Cargo.toml b/tests/plugins/plugin2/Cargo.toml index c5d41ab..6cc5538 100644 --- a/tests/plugins/plugin2/Cargo.toml +++ b/tests/plugins/plugin2/Cargo.toml @@ -18,6 +18,7 @@ llvm14-0 = ["llvm-plugin/llvm14-0"] llvm15-0 = ["llvm-plugin/llvm15-0"] llvm16-0 = ["llvm-plugin/llvm16-0"] llvm17-0 = ["llvm-plugin/llvm17-0"] +llvm18-0 = ["llvm-plugin/llvm18-0"] target-x86 = ["llvm-plugin/target-x86"] target-arm = ["llvm-plugin/target-arm"] diff --git a/tests/plugins/plugin3/Cargo.toml b/tests/plugins/plugin3/Cargo.toml index c675825..a703fdd 100644 --- a/tests/plugins/plugin3/Cargo.toml +++ b/tests/plugins/plugin3/Cargo.toml @@ -18,6 +18,7 @@ llvm14-0 = ["llvm-plugin/llvm14-0"] llvm15-0 = ["llvm-plugin/llvm15-0"] llvm16-0 = ["llvm-plugin/llvm16-0"] llvm17-0 = ["llvm-plugin/llvm17-0"] +llvm18-0 = ["llvm-plugin/llvm18-0"] target-x86 = ["llvm-plugin/target-x86"] target-arm = ["llvm-plugin/target-arm"] diff --git a/tests/plugins/plugin4/Cargo.toml b/tests/plugins/plugin4/Cargo.toml index 947863e..62deea3 100644 --- a/tests/plugins/plugin4/Cargo.toml +++ b/tests/plugins/plugin4/Cargo.toml @@ -18,6 +18,7 @@ llvm14-0 = ["llvm-plugin/llvm14-0"] llvm15-0 = ["llvm-plugin/llvm15-0"] llvm16-0 = ["llvm-plugin/llvm16-0"] llvm17-0 = ["llvm-plugin/llvm17-0"] +llvm18-0 = ["llvm-plugin/llvm18-0"] target-x86 = ["llvm-plugin/target-x86"] target-arm = ["llvm-plugin/target-arm"] diff --git a/tests/plugins/plugin5/Cargo.toml b/tests/plugins/plugin5/Cargo.toml index 63d4516..c162e63 100644 --- a/tests/plugins/plugin5/Cargo.toml +++ b/tests/plugins/plugin5/Cargo.toml @@ -18,6 +18,7 @@ llvm14-0 = ["llvm-plugin/llvm14-0"] llvm15-0 = ["llvm-plugin/llvm15-0"] llvm16-0 = ["llvm-plugin/llvm16-0"] llvm17-0 = ["llvm-plugin/llvm17-0"] +llvm18-0 = ["llvm-plugin/llvm18-0"] target-x86 = ["llvm-plugin/target-x86"] target-arm = ["llvm-plugin/target-arm"] diff --git a/tests/plugins/plugin6/Cargo.toml b/tests/plugins/plugin6/Cargo.toml index 7c9a115..0ec75fa 100644 --- a/tests/plugins/plugin6/Cargo.toml +++ b/tests/plugins/plugin6/Cargo.toml @@ -18,6 +18,7 @@ llvm14-0 = ["llvm-plugin/llvm14-0"] llvm15-0 = ["llvm-plugin/llvm15-0"] llvm16-0 = ["llvm-plugin/llvm16-0"] llvm17-0 = ["llvm-plugin/llvm17-0"] +llvm18-0 = ["llvm-plugin/llvm18-0"] target-x86 = ["llvm-plugin/target-x86"] target-arm = ["llvm-plugin/target-arm"] diff --git a/tests/plugins/plugin6/src/lib.rs b/tests/plugins/plugin6/src/lib.rs index 9ceda4a..3a4c4e2 100644 --- a/tests/plugins/plugin6/src/lib.rs +++ b/tests/plugins/plugin6/src/lib.rs @@ -29,6 +29,7 @@ fn plugin_registrar(builder: &mut PassBuilder) { feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0", + feature = "llvm18-0", ))] builder.add_pipeline_start_ep_callback(|manager, opt| { assert!(matches!(opt, OptimizationLevel::O3)); @@ -42,6 +43,7 @@ fn plugin_registrar(builder: &mut PassBuilder) { feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0", + feature = "llvm18-0", ))] builder.add_pipeline_early_simplification_ep_callback(|manager, opt| { assert!(matches!(opt, OptimizationLevel::O3)); @@ -56,13 +58,19 @@ fn plugin_registrar(builder: &mut PassBuilder) { feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0", + feature = "llvm18-0", ))] builder.add_optimizer_last_ep_callback(|manager, opt| { assert!(matches!(opt, OptimizationLevel::O3)); manager.add_pass(OptimizerLastPass); }); - #[cfg(any(feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0"))] + #[cfg(any( + feature = "llvm15-0", + feature = "llvm16-0", + feature = "llvm17-0", + feature = "llvm18-0", + ))] builder.add_optimizer_early_ep_callback(|manager, opt| { assert!(matches!(opt, OptimizationLevel::O3)); manager.add_pass(OptimizerEarlyPass); diff --git a/tests/plugins/plugin7/Cargo.toml b/tests/plugins/plugin7/Cargo.toml index d5d2d91..1943c8a 100644 --- a/tests/plugins/plugin7/Cargo.toml +++ b/tests/plugins/plugin7/Cargo.toml @@ -18,6 +18,7 @@ llvm14-0 = ["llvm-plugin/llvm14-0"] llvm15-0 = ["llvm-plugin/llvm15-0"] llvm16-0 = ["llvm-plugin/llvm16-0"] llvm17-0 = ["llvm-plugin/llvm17-0"] +llvm18-0 = ["llvm-plugin/llvm18-0"] target-x86 = ["llvm-plugin/target-x86"] target-arm = ["llvm-plugin/target-arm"] diff --git a/tests/plugins/plugin7/src/lib.rs b/tests/plugins/plugin7/src/lib.rs index 66f6605..fae2d09 100644 --- a/tests/plugins/plugin7/src/lib.rs +++ b/tests/plugins/plugin7/src/lib.rs @@ -3,13 +3,23 @@ use llvm_plugin::{LlvmModulePass, ModuleAnalysisManager, PassBuilder, PreservedA #[llvm_plugin::plugin(name = "llvm_plugin", version = "0.1")] fn plugin_registrar(builder: &mut PassBuilder) { - #[cfg(any(feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0"))] + #[cfg(any( + feature = "llvm15-0", + feature = "llvm16-0", + feature = "llvm17-0", + feature = "llvm18-0", + ))] builder.add_full_lto_early_ep_callback(|manager, opt| { assert!(matches!(opt, llvm_plugin::OptimizationLevel::O3)); manager.add_pass(FullLtoEarlyPass); }); - #[cfg(any(feature = "llvm15-0", feature = "llvm16-0", feature = "llvm17-0"))] + #[cfg(any( + feature = "llvm15-0", + feature = "llvm16-0", + feature = "llvm17-0", + feature = "llvm18-0", + ))] builder.add_full_lto_last_ep_callback(|manager, opt| { assert!(matches!(opt, llvm_plugin::OptimizationLevel::O3)); manager.add_pass(FullLtoLastPass);