Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support llvm-sys 150.x.x #383

Merged
merged 37 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3a97796
Support llvm-15 for inkwell
ksolana Nov 1, 2022
fffe576
Add llvm15-0 to supported features
ksolana Nov 1, 2022
9dacd28
Add the zkSync VM local changes
Jun 9, 2022
09c83e7
Add the LLVMParseCommandLineOptions binding
Jun 9, 2022
30efb42
Change the dependencies protocol to HTTPS
Jul 11, 2022
2a5b193
Make 'inkwell' compiler with LLVM 15
Nov 17, 2022
47bd6a0
Make 'inkwell' compile with LLVM 15
Nov 17, 2022
82ca8f5
Support load2 and gep2
Nov 18, 2022
7138801
Support the rest of GEPs and ptr_diff
Nov 19, 2022
952f33b
Support call_2 and invoke_2
Nov 19, 2022
eb77041
Fix tests for passes and debug info
Nov 24, 2022
4330a51
Update the tests
Nov 24, 2022
0bd11e5
Merge branch 'llvm-15' into az/update-llvm-15-support
Nov 24, 2022
3f3a8a4
Merge branch 'master' into az/update-llvm-15-support
hedgar2017 Nov 24, 2022
abeb758
Remove the local target artifacts
Nov 24, 2022
dee5b78
Restore the deprecated passes and const functions
Nov 24, 2022
5fedbd3
Remove a function type check
Nov 24, 2022
ea49435
Remove function extensions, fix LLVM version deps
Nov 27, 2022
34c30f8
Remove the command line arguments parsing function
Nov 27, 2022
b0ae971
Remove another function type check
Dec 1, 2022
e5dce8b
Restore bitcast; some minor improvements
Dec 2, 2022
4aa2f42
Merge the CI changes
Dec 10, 2022
9bc6a16
Fix LLVM version 5
Dec 11, 2022
241c733
Fix the LTO pass manager import
Dec 18, 2022
966861c
Fix the debug info test
Dec 18, 2022
7a83275
Improve namings; potential fix for the struct_gep segfault
Dec 18, 2022
c5757b7
Bump changes version from >=14 to >=15
Dec 18, 2022
90bbf7f
Bump changes in tests from version >=14 to >=15
Dec 18, 2022
58f63d5
Fix the bitcast test
Dec 18, 2022
f5b8bfe
Fix some failing tests, replace Generic -> Zero
Dec 18, 2022
f944dd9
Disable the kaleidoscope example for LLVM 15 (#2)
folkertdev Dec 18, 2022
2370df0
Update all the tests (#3)
folkertdev Dec 19, 2022
8e47a91
Merge branch 'master' into az/update-llvm-15-support
hedgar2017 Dec 21, 2022
7197862
Fix some compile errors and warnings
Dec 21, 2022
8a01251
Some types and tests fixes
Jan 15, 2023
5f978cb
Fix the LLVM 8 compile error
Jan 16, 2023
0ab9377
Try conditional compilation on doc tests
Jan 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on: [push, pull_request]

env:
CARGO_TERM_COLOR: always
DOC_LLVM_FEATURE: llvm14-0
DOC_LLVM_VERSION: '14.0'
DOC_LLVM_FEATURE: llvm15-0
DOC_LLVM_VERSION: '15.0'
DOC_PATH: target/doc

jobs:
Expand All @@ -27,6 +27,7 @@ jobs:
- ["12.0", "12-0"]
- ["13.0", "13-0"]
- ["14.0", "14-0"]
- ["15.0", "15-0"]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

# VSCode configuration folder
.vscode/
# IDE project data
/.idea/
/.vscode/
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ llvm11-0 = ["llvm-sys-110"]
llvm12-0 = ["llvm-sys-120"]
llvm13-0 = ["llvm-sys-130"]
llvm14-0 = ["llvm-sys-140"]
llvm15-0 = ["llvm-sys-150"]
# Don't link aganist LLVM libraries. This is useful if another dependency is
# installing LLVM. See llvm-sys for more details. We can't enable a single
# `no-llvm-linking` feature across the board of llvm versions, as it'll cause
Expand All @@ -41,6 +42,7 @@ llvm11-0-no-llvm-linking = ["llvm11-0", "llvm-sys-110/no-llvm-linking"]
llvm12-0-no-llvm-linking = ["llvm12-0", "llvm-sys-120/no-llvm-linking"]
llvm13-0-no-llvm-linking = ["llvm13-0", "llvm-sys-130/no-llvm-linking"]
llvm14-0-no-llvm-linking = ["llvm14-0", "llvm-sys-140/no-llvm-linking"]
llvm15-0-no-llvm-linking = ["llvm15-0", "llvm-sys-150/no-llvm-linking"]
# Don't force linking to libffi on non-windows platforms. Without this feature
# inkwell always links to libffi on non-windows platforms.
no-libffi-linking = []
Expand All @@ -60,6 +62,7 @@ target-bpf = []
target-lanai = []
target-webassembly = []
target-riscv = []
target-syncvm = []
target-all = [
"target-x86",
"target-arm",
Expand All @@ -76,7 +79,7 @@ target-all = [
"target-bpf",
"target-lanai",
"target-webassembly",
"target-riscv"
"target-riscv",
]
experimental = ["static-alloc"]
nightly = ["inkwell_internals/nightly"]
Expand All @@ -97,7 +100,8 @@ llvm-sys-110 = { package = "llvm-sys", version = "110.0.3", optional = true }
llvm-sys-120 = { package = "llvm-sys", version = "120.2.4", optional = true }
llvm-sys-130 = { package = "llvm-sys", version = "130.0.4", optional = true }
llvm-sys-140 = { package = "llvm-sys", version = "140.0.2", optional = true }
once_cell = "1.4.1"
llvm-sys-150 = { package = "llvm-sys", version = "150.0.3", optional = true }
once_cell = "1.16"
parking_lot = "0.12"
static-alloc = { version = "0.2", optional = true }

Expand Down
4 changes: 2 additions & 2 deletions internal_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use syn::{parenthesized, parse_macro_input, parse_quote};
use syn::{Attribute, Field, Ident, Item, LitFloat, Token, Variant};

// This array should match the LLVM features in the top level Cargo manifest
const FEATURE_VERSIONS: [&str; 11] = [
const FEATURE_VERSIONS: [&str; 12] = [
"llvm4-0", "llvm5-0", "llvm6-0", "llvm7-0", "llvm8-0", "llvm9-0", "llvm10-0", "llvm11-0", "llvm12-0", "llvm13-0",
"llvm14-0",
"llvm14-0", "llvm15-0",
];

/// Gets the index of the feature version that represents `latest`
Expand Down
16 changes: 14 additions & 2 deletions src/basic_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use llvm_sys::core::{
LLVMGetBasicBlockTerminator, LLVMGetFirstInstruction, LLVMGetFirstUse, LLVMGetLastInstruction,
LLVMGetNextBasicBlock, LLVMGetPreviousBasicBlock, LLVMGetTypeContext, LLVMIsABasicBlock, LLVMIsConstant,
LLVMMoveBasicBlockAfter, LLVMMoveBasicBlockBefore, LLVMPrintTypeToString, LLVMPrintValueToString,
LLVMRemoveBasicBlockFromParent, LLVMReplaceAllUsesWith, LLVMSetValueName, LLVMTypeOf,
LLVMRemoveBasicBlockFromParent, LLVMReplaceAllUsesWith, LLVMTypeOf,
};
use llvm_sys::prelude::{LLVMBasicBlockRef, LLVMValueRef};

Expand Down Expand Up @@ -424,7 +424,19 @@ impl<'ctx> BasicBlock<'ctx> {
/// Set name of the `BasicBlock`.
pub fn set_name(&self, name: &str) {
let c_string = to_c_str(name);
unsafe { LLVMSetValueName(LLVMBasicBlockAsValue(self.basic_block), c_string.as_ptr()) };

#[cfg(any(feature = "llvm4-0", feature = "llvm5-0", feature = "llvm6-0"))]
{
use llvm_sys::core::LLVMSetValueName;

unsafe { LLVMSetValueName(LLVMBasicBlockAsValue(self.basic_block), c_string.as_ptr()) };
}
#[cfg(not(any(feature = "llvm4-0", feature = "llvm5-0", feature = "llvm6-0")))]
{
use llvm_sys::core::LLVMSetValueName2;

unsafe { LLVMSetValueName2(LLVMBasicBlockAsValue(self.basic_block), c_string.as_ptr(), name.len()) };
hedgar2017 marked this conversation as resolved.
Show resolved Hide resolved
}
}

/// Replaces all uses of this basic block with another.
Expand Down
Loading