Remove most LLVM::DIBuilder
functions from llvm_ext.cc
#13448
Merged
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.cc
that are required byLLVM::DIBuilder
by 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_unit
now uses language codes as they are defined in the C header, not the C++ ones.LLVM::Builder#insert_declare_at_end
now takes the debug location as aLibLLVM::MetadataRef
instead of anLLVM::Value
. There is currently no Crystal wrapper forLibLLVM::MetadataRef
. (LLVM::Metadata
is an empty struct used only as a namespace for the unusedLLVM::Metadata::Type
enum.)LLVM::Builder#create_*_type
family now takesArray
s orSlice
s of metadata elements, without having to call#get_or_create_array
or#get_or_create_type_array
first, 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::DwarfSourceLanguage
andLLVM::DIFlags
enums 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_type
is completely removed, since it is unused by Crystal and the correspondingLibLLVMExt
implementation + binding never existed.