1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[ORC] Make LLVMOrcLLJITBuilderSetJITTargetMachineBuilder consume as advertised.

This should fix some of the memory leaks seen in the ORC C API test case.
This commit is contained in:
Lang Hames 2021-04-26 22:25:26 -07:00
parent 84d50c8446
commit 53ce1eab3b
2 changed files with 5 additions and 3 deletions

View File

@ -635,8 +635,9 @@ LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(
*
* This operation takes ownership of the given TargetMachine and destroys it
* before returing. The resulting JITTargetMachineBuilder is owned by the client
* and must be passed to a consuming operation (e.g. LLVMOrcCreateLLJITBuilder)
* or disposed of by calling LLVMOrcDisposeJITTargetMachineBuilder.
* and must be passed to a consuming operation (e.g.
* LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling
* LLVMOrcDisposeJITTargetMachineBuilder.
*/
LLVMOrcJITTargetMachineBuilderRef
LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM);

View File

@ -513,7 +513,8 @@ void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder) {
void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(
LLVMOrcLLJITBuilderRef Builder, LLVMOrcJITTargetMachineBuilderRef JTMB) {
unwrap(Builder)->setJITTargetMachineBuilder(*unwrap(JTMB));
unwrap(Builder)->setJITTargetMachineBuilder(std::move(*unwrap(JTMB)));
LLVMOrcDisposeJITTargetMachineBuilder(JTMB);
}
void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(