-
Notifications
You must be signed in to change notification settings - Fork 239
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 16 #407
Merged
Merged
Support LLVM 16 #407
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following functions are now disabled if the `llvm16-0` feature flag is set: `PassRegistry`: - `initialize_aggressive_inst_combiner()` - `initialize_instrumentation()` - `initialize_obj_carc_opts()` `PassManager`: - `add_aggressive_inst_combiner_pass()` - `add_prune_eh_pass()`
This patch disables `FloatValue::const_neg()` for LLVM 16 and beyond.
Added feature flags to pointer type checks in `Builder::build_atomicrmw()` and `Builder::build_cmpxchg()`.
This patch adds `llvm16-0` to feature gates in the call to `LLVMDIBuilderCreateCompileUnit` in `DebugInfoBuilder::create_compile_unit()`. It also adds the flag to the arguments `sysroot` and `sdk` in the function declaration and to all of the calls to it, as well as to `DebugInfoBuilder::new()`. Furthermore, it adds the following enum values to `flags::DwarfSourceLanguage`: - `Kotlin` - `Zig` - `Crystal` - `CPlusPlus17` - `CPlusPlus20` - `C17` - `Fortran18` - `Ada2005` - `Ada2012`
This patch adds the `FIRST_CUSTOM_METADATA_KIND_ID` value for LLVM 16.
This patch adds `llvm16-0` to the feature gate for `callable_value`.
This patch adds `llvm16-0` to the feature flag set that adds the `sysroot` and `sdk` arguments to `Module::create_debug_info_builder()` and passes them in to `debug_info::DebugInfoBuilder::new()`.
This patch adds `llvm16-0` to feature gates in `AnyTypeEnum` and `BasicTypeEnum`. It also adds and gates the new `LLVMTargetExtTypeKind` to both of these enums.
This patch exposes `LLVMGetVersion`, a function added in LLVM 16, as `get_llvm_version()`, which returns a `(u32, u32, u32)` of the major, minor, and patch version numbers, respectively.
This example is broken for LLVM 15 and is for LLVM 16 too. So continue to disable it.
This patch just adds the `llvm16-0` feature to the feature gates on the `sysroot` and `sdk` arguments for calls to `module::Module::create_debug_info_builder()`
This patch just modifies some feature gates to properly handle LLVM 16
This patch disables tests for the passes that have been removed in LLVM 16 as well as updates some already-existing gates to account for LLVM 16.
This patch disables a series of assertions in `test_floats()` that rely on the `FloatValue::const_neg()` function that has been removed in an earlier patch. It also updates various feature gates to account for LLVM 16.
Sorry for the delay, I should be able to finish reviewing this soon |
TheDan64
approved these changes
Apr 28, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the crate to support building and using LLVM 16. The LLVM changelog can be found here, and the llvm-sys MR is here. The commit messages contain a more detailed explanation of what was done in each patch, so I recommend reviewing commit-by-commit.
This closes #400.
This was tested by running the CI on the development fork. I also wrote a small test package to verify
support::get_llvm_version()
, but I don't believe it is feasible to test it using the test suite.