Remove obsolete functions from llvm_ext.cc
#13177
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.
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
:DIBuilder
functionsAll 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::DIBuilder
to be a struct anymore. EDIT:LLVMExtDIBuilderCreateEnumerator
did not exist in LLVM 8.0.LLVMExtSetCurrentDebugLocation
This can be replaced by
LLVMSetCurrentDebugLocation
in LLVM 8, andLLVMSetCurrentDebugLocation2
in LLVM 9+. The first one accepts a non-nilLibLLVM::ValueRef
, the second a nilableLibLLVM::MetadataRef
(passing nil clears the debug location).LLVMDIBuilderCreateDebugLocation
can 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.context
LLVMExtWriteBitcodeWithSummaryToFile
5 arguments are passed to
llvm::WriteBitcodeToFile
here, 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
,LLVMExtBuildInvoke2
The 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
,LLVMExtCreateMCJITCompilerForModule
The LLVM C API still doesn't expose functions that deal with global instruction selection. See also Disable LLVM Global Isel #9401.