about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-24 20:36:44 +0000
committerbors <bors@rust-lang.org>2023-09-24 20:36:44 +0000
commit37390d65636dd67e263753a3c04fbc60dcc4348e (patch)
treeaf4b235a3e66ba529247f3f64ac917ce6f552ed1 /compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
parenta1c7a1c89f61adc43e9674af3c9c120eb6271a91 (diff)
parent3409ca65d835b858d9cefbe8949552f0f5ad0788 (diff)
downloadrust-37390d65636dd67e263753a3c04fbc60dcc4348e.tar.gz
rust-37390d65636dd67e263753a3c04fbc60dcc4348e.zip
Auto merge of #115911 - nebulark:refactor_targetmachine, r=Nilstrieb
Add OwnedTargetMachine to manage llvm:TargetMachine

LLVMRustDisposeTargetMachine taking a &mut could be undefined behaviour.
Wrapping it with a struct and using pointers instead avoids this problem.
In addition the TargetMachine is now automatically freed via the Wrappers drop impl. This should fix some memory leaks when
create_informational_target_machine was used, e.g. https://github.com/rust-lang/rust/blob/327e6cf55cc5211e19ed46e92e05eef29dc75dd0/compiler/rustc_codegen_llvm/src/llvm_util.rs#L291-L314

r? `@Nilstrieb`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp')
0 files changed, 0 insertions, 0 deletions