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

Drop support for LLVM < 8 #12906

Merged

Conversation

straight-shoota
Copy link
Member

Resolves #8725

Closes #11403

@HertzDevil
Copy link
Contributor

A big chunk of LLVM version checks in the standard library that call compare_versions(Crystal::LLVM_VERSION, ...) can probably be dropped too (most notably intrinsics.cr)

@straight-shoota
Copy link
Member Author

Oh, I completely missed those. 🤦‍♂️

src/llvm.cr Show resolved Hide resolved
src/llvm/lib_llvm.cr Outdated Show resolved Hide resolved
Comment on lines +168 to +169
{% else %}
fun create_type_attribute = LLVMCreateTypeAttribute(ctx : LibLLVM::ContextRef, kind_id : LibC::UInt, ty : LibLLVM::TypeRef) : LibLLVM::AttributeRef
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go into LibLLVM, not here. Same for the LLVMDIBuilder* functions above

Copy link
Member Author

@straight-shoota straight-shoota Jan 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But in libllvm it's only defined in version >= 13. So we'd have to switch at the callsite. IMO it's easier this way, switching the bindings. Even though it's a bit sloppy.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the DIBuilder functions still use LibLLVMExt::DIBuilder type, hence I opted to leave the bindings here where all the other DIBuilder functions are defined as well.

src/llvm/lib_llvm.cr Outdated Show resolved Hide resolved
Copy link
Member

@bcardiff bcardiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we make this for LLVM < 9 there will be some nice cleanups on fiber/context !

@straight-shoota straight-shoota added this to the 1.8.0 milestone Jan 18, 2023
@straight-shoota straight-shoota merged commit 8cc61e4 into crystal-lang:master Jan 19, 2023
@straight-shoota straight-shoota deleted the refactor/drop-llvm-support branch January 19, 2023 12:06
@rdp rdp mentioned this pull request Jan 20, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LLVM supported versions
3 participants