Remove most LLVM::DIBuilder functions from llvm_ext.cc#13448
Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom May 10, 2023
Merged
Remove most LLVM::DIBuilder functions from llvm_ext.cc#13448straight-shoota merged 1 commit intocrystal-lang:masterfrom
LLVM::DIBuilder functions from llvm_ext.cc#13448straight-shoota merged 1 commit intocrystal-lang:masterfrom
Conversation
straight-shoota
approved these changes
May 9, 2023
This file contains hidden or 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
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 removes all functions in
llvm_ext.ccthat are required byLLVM::DIBuilderby using their official counterparts, except forLLVMExtDIBuilderCreateEnumerator, which did not exist in LLVM 8.0. For the remaining functions see #13177.There are some breaking changes to align our LLVM API to the official one for debug info generation:
LLVM::Builder#create_compile_unitnow uses language codes as they are defined in the C header, not the C++ ones.LLVM::Builder#insert_declare_at_endnow takes the debug location as aLibLLVM::MetadataRefinstead of anLLVM::Value. There is currently no Crystal wrapper forLibLLVM::MetadataRef. (LLVM::Metadatais an empty struct used only as a namespace for the unusedLLVM::Metadata::Typeenum.)LLVM::Builder#create_*_typefamily now takesArrays orSlices of metadata elements, without having to call#get_or_create_arrayor#get_or_create_type_arrayfirst, because LLVM does it for us. Conversely, Crystal itself no longer calls those array conversion functions, but it does unpack the metadata returned by them to maintain API compatibility; this is of course more expensive, so those overloads are deprecated.LLVM::DwarfSourceLanguageandLLVM::DIFlagsenums now change depending on the LLVM version. In practice this isn't a huge problem because the LLVM version must be selected at build time.There is also a workaround for #13250. It is internal to Crystal and not part of the breaking changes.
LLVM::DIBuilder#create_reference_typeis completely removed, since it is unused by Crystal and the correspondingLibLLVMExtimplementation + binding never existed.