diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2019-11-27 15:28:45 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-27 15:28:45 -0600 |
| commit | b05f14cc40d4820bb53f2637aaab76a0c1415fe4 (patch) | |
| tree | a73fe804382f843cbfa793bb97cc2dd84586c8f7 /src/rustllvm/PassWrapper.cpp | |
| parent | a3a8ee0636aa2f586241f87f76074c4abc49a77e (diff) | |
| parent | e846ea1112ba3176d3141163c86dda5bfd8cd5eb (diff) | |
| download | rust-b05f14cc40d4820bb53f2637aaab76a0c1415fe4.tar.gz rust-b05f14cc40d4820bb53f2637aaab76a0c1415fe4.zip | |
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](https://github.com/rust-lang/rust/blob/d63b24ffcc48f44ef09e0369e6516d6f2dec3520/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.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
| -rw-r--r-- | src/rustllvm/PassWrapper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 062a8265cc6..e2bb49699e9 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -580,7 +580,7 @@ LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, LLVMPassManagerRef PMR, // 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 // wish this was written in Rust? - delete PM; + LLVMDisposePassManager(PMR); return LLVMRustResult::Success; } |
