Remove obsolete functions from llvm_ext.cc#13177
Merged
straight-shoota merged 11 commits intocrystal-lang:masterfrom Mar 15, 2023
Merged
Remove obsolete functions from llvm_ext.cc#13177straight-shoota merged 11 commits intocrystal-lang:masterfrom
llvm_ext.cc#13177straight-shoota merged 11 commits intocrystal-lang:masterfrom
Conversation
straight-shoota
approved these changes
Mar 11, 2023
llvm_ext.ccllvm_ext.cc
This was referenced May 5, 2023
6 tasks
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.
Removes the functions that are known to be present since LLVM 8. No public interfaces are affected.
Here is a breakdown of the remaining functions in
llvm_ext.cc:DIBuilderfunctionsAll of them exist on LLVM 8, butLLVM claims that the C interface is still experimental, and I haven't verified that the API remains unchanged in all versions up to 15. Alsofun LLVMDisposeDIBuilder(builder : DIBuilderRef)was missing so it probably doesn't make sense forLLVM::DIBuilderto be a struct anymore. EDIT:LLVMExtDIBuilderCreateEnumeratordid not exist in LLVM 8.0.LLVMExtSetCurrentDebugLocationThis can be replaced by
LLVMSetCurrentDebugLocationin LLVM 8, andLLVMSetCurrentDebugLocation2in LLVM 9+. The first one accepts a non-nilLibLLVM::ValueRef, the second a nilableLibLLVM::MetadataRef(passing nil clears the debug location).LLVMDIBuilderCreateDebugLocationcan create the correspondingLibLLVM::MetadataRef, but it also requires aLibLLVM::ContextRef.So far I haven't found a good way to pass the context around without causing any breaking changes in our "public" LLVM API.EDIT: I think this is just@llvm_module.contextLLVMExtWriteBitcodeWithSummaryToFile5 arguments are passed to
llvm::WriteBitcodeToFilehere, whereas the LLVM C API can only accept the first 2. Two of the extra arguments are only relevant for the now removed ThinLTO support. I have no idea if the other extra argument,ShouldPreserveUseListOrder, must betrue; if not then this function can be replaced byLLVMWriteBitcodeToFile.LLVMExtBuildOperandBundleDef,LLVMExtBuildCall2,LLVMExtBuildInvoke2The LLVM C API still doesn't expose functions that deal with operand bundles, which are apparently needed for exception handling. There is a stale LLVM revision for this.
LLVMExtTargetMachineEnableGlobalIsel,LLVMExtCreateMCJITCompilerForModuleThe LLVM C API still doesn't expose functions that deal with global instruction selection. See also Disable LLVM Global Isel #9401.