Rollup merge of #66761 - yuyoyuppe:rust_llvm_minor_fix, r=alexcrichton
Use LLVMDisposePassManager instead of raw delete in rustllvm
LLVM has a dedicated API call which wraps the destructor invocation for the PassManager.
Rust invokes it [otherwhere](d63b24ffcc/src/librustc_codegen_llvm/back/write.rs (L446-L447)
), but not in the `LLVMRustWriteOutputFile`.
Since `LLVMDisposePassManager` might be extended to perform additional cleanup actions in the future, this change replaces raw destructor invocation with that API call.
This commit is contained in:
commit
b05f14cc40
1 changed files with 1 additions and 1 deletions
|
@ -580,7 +580,7 @@ LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, LLVMPassManagerRef PMR,
|
||||||
// Apparently `addPassesToEmitFile` adds a pointer to our on-the-stack output
|
// Apparently `addPassesToEmitFile` adds a pointer to our on-the-stack output
|
||||||
// stream (OS), so the only real safe place to delete this is here? Don't we
|
// stream (OS), so the only real safe place to delete this is here? Don't we
|
||||||
// wish this was written in Rust?
|
// wish this was written in Rust?
|
||||||
delete PM;
|
LLVMDisposePassManager(PMR);
|
||||||
return LLVMRustResult::Success;
|
return LLVMRustResult::Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue