Closed woodruffw closed 1 year ago
Yes, I will work on LLVM 15 support (or if you want to take the first stab, feel free). LLVM 15 has some major changes which will affect us -- in particular the move to opaque pointers, but also the removal of a number of constant expressions.
I'm happy to take a first stab! I can at least do the boilerplate bits, and I'm somewhat familiar with the IR-level opaque pointer changes.
Opened #25 as a start.
@woodruffw thank you for start adding support for LLVM 15. I may need this sooner or later. But because of this I'm interested: What is the current state of the LLVM 15 branch?
More discussion at #25. I've added a bunch to @woodruffw's start, and there is now an llvm-15
branch in this repo which represents the latest progress as far as I'm aware. Unfortunately there is a segfault when running our test suite on the llvm-15
branch, which I haven't had time to track down yet. (My time for this project is limited, apologies.)
Spent some time looking into this, the segfault seems to be caused by this line:
because in llvm15 now uses opaque pointers by default: https://releases.llvm.org/15.0.0/docs/ReleaseNotes.html#changes-to-the-llvm-ir
Following the migration doc I replaced that line with:
let functy = unsafe { LLVMGlobalGetValueType(func) };
which seems to work.
Most of the tests still need to be migrated, and still need to replace the LLVMGetElementType
usages in types.rs
.
Thanks @another-rex! I pushed this to the llvm-15
branch and am working on the remaining test failures.
Merged and also published to crates.io as 0.9.0. Tests are passing (for all LLVM versions) in --release
mode; in debug mode I believe they're afflicted by #15, which is just a known-bug at this point. Thanks for everyone's contributions!
Thanks @cdisselkoen, and everyone else as well! I'm excited to use these changes on our tools 🙂
First of all, thank you for maintaining this crate -- it's been incredibly useful on some of our projects!
Recent versions of
rustc
have upgraded to LLVM 15, meaning that the IR generated byrustc
can't be used with this crate's bindings by default.Would it be possible to add LLVM 15 support to this crate? I'm happy to take a stab at it first as well, if it's easier for you to review changes 🙂