cdisselkoen / llvm-ir

LLVM IR in natural Rust data structures
MIT License
539 stars 45 forks source link

Support for LLVM 15 #25

Closed woodruffw closed 1 year ago

woodruffw commented 1 year ago

Here's my initial stab at support for LLVM 15. Still a WIP, but I've done a bit of the chore work.

TODO:

See #24.

woodruffw commented 1 year ago

Tests are now building as well, although I currently get a concerning segfault:

 RUST_BACKTRACE=1 LLVM_SYS_150_PREFIX=/usr/local/opt/llvm@15/ cargo test --features=llvm-15
    Finished test [unoptimized + debuginfo] target(s) in 0.08s
     Running unittests src/lib.rs (target/debug/deps/llvm_ir-c574cd98f2e1983e)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/basic_tests.rs (target/debug/deps/basic_tests-4517b5e8bf645091)

running 15 tests
error: test failed, to rerun pass `--test basic_tests`

Caused by:
  process didn't exit successfully: `/Users/william/devel/llvm-ir/target/debug/deps/basic_tests-4517b5e8bf645091` (signal: 11, SIGSEGV: invalid memory reference)

I'll have a chance to look more into it tonight or tomorrow.

woodruffw commented 1 year ago

NB: LLVM_SYS_140_PREFIX=/usr/local/opt/llvm@14/ cargo test --features=llvm-14 does not fault, so it's definitely a regression on my part.

cdisselkoen commented 1 year ago

Started a branch llvm-15 in this repo based on this PR, and added a few things, including a start on opaque pointer types (tests not building yet). Feel free to pull into your own branch.

woodruffw commented 1 year ago

Cheers! I'll have some time to work on the tests in a day or so.

cdisselkoen commented 1 year ago

Pushed to my llvm-15 branch again. Removed the constexpr cases that no longer exist. Fixed tests to the extent that they now at least build again; I'm observing the segfault you mentioned though.

cdisselkoen commented 1 year ago

pushed to this repo's llvm-15 branch, mostly just rebasing on main. Tests still have a segfault.

cdisselkoen commented 1 year ago

Thanks to @another-rex (see #24), the segfault is resolved and I'm working on the remaining test failures

cdisselkoen commented 1 year ago

Pushed to llvm-15 again. Many more tests are passing, which involved a couple more fixes to the non-test code. A couple failures remaining

cdisselkoen commented 1 year ago

Pushed to llvm-15 again. Tests are now passing in --release mode; in debug mode I believe they're afflicted by #15. I'm happy to consider that a known-bug and merge this, so I'll go ahead and merge to main.

cdisselkoen commented 1 year ago

Merged and also published to crates.io as 0.9.0. Thanks for everyone's contributions!