Support LLVM 19.1#14842
Conversation
| LibLLVM.di_builder_insert_declare_at_end(self, storage, var_info, expr, dl, block) | ||
| {% else %} | ||
| LibLLVM.di_builder_insert_declare_record_at_end(self, storage, var_info, expr, dl, block) | ||
| {% end %} |
There was a problem hiding this comment.
Oh my, we're returning a raw Void* from LLVM here, which may be a LibLLVM::ValueRef or a LibLLVM::DbgRecordRef now 😞
There was a problem hiding this comment.
There's only a single call to this method in the compiler, and the return value is ignored. Maybe we should tack on a type restriction to Nil? 🤷
There was a problem hiding this comment.
For the crystal compiler we may not care, but the method is public...
There was a problem hiding this comment.
Or we do the sensible thing of wrapping those pointers into an actual LLVM::Metadata or LLVM::DebugRecord struct
There was a problem hiding this comment.
Also LLVM::DIBuilder is marked as @[Experimental], so we are free to make breaking changes here, and probably not in a hurry to do so
|
19.1.0 stable has been released; awaiting the volunteer packages for CI |
|
It appears there are now official binaries by release managers and all the third-party ones are only on their forum: https://discourse.llvm.org/t/rfc-improve-binary-security/78121/56 |
| LibLLVM.di_builder_insert_declare_at_end(self, storage, var_info, expr, dl, block) | ||
| {% else %} | ||
| LibLLVM.di_builder_insert_declare_record_at_end(self, storage, var_info, expr, dl, block) | ||
| {% end %} |
There was a problem hiding this comment.
There's only a single call to this method in the compiler, and the return value is ignored. Maybe we should tack on a type restriction to Nil? 🤷
|
I think it's fine to still add this into 1.14.0 even though we're already in the freeze period. The changes only have an effect when linking against LLVM 1.19, so this should not affect any existing configuration. |
Closes #14840. Tested on Debian using
1:19.1.0~++20240730073008+404746b9f21b-1~exp1~20240730073118.4.The return type of
LLVM::DIBuilder#insert_declare_at_endnow differs betweenLibLLVM::ValueRefandLibLLVM::DbgRecordRefdepending on whether LLVM is new enough (both are typedefs toVoid*), although this return value is never used in the compiler itself.