File tree Expand file tree Collapse file tree 3 files changed +3
-8
lines changed Expand file tree Collapse file tree 3 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -95,8 +95,6 @@ impl Drop for OwnedTargetMachine {
9595 // SAFETY: constructing ensures we have a valid pointer created by
9696 // llvm::LLVMRustCreateTargetMachine OwnedTargetMachine is not copyable so there is no
9797 // double free or use after free.
98- unsafe {
99- llvm:: LLVMRustDisposeTargetMachine ( self . tm_unique . as_ptr ( ) ) ;
100- }
98+ unsafe { llvm:: LLVMDisposeTargetMachine ( self . tm_unique ) } ;
10199 }
102100}
Original file line number Diff line number Diff line change @@ -1053,6 +1053,8 @@ unsafe extern "C" {
10531053 SLen : c_uint ,
10541054 ) -> MetadataKindId ;
10551055
1056+ pub ( crate ) fn LLVMDisposeTargetMachine ( T : ptr:: NonNull < TargetMachine > ) ;
1057+
10561058 // Create modules.
10571059 pub ( crate ) fn LLVMModuleCreateWithNameInContext (
10581060 ModuleID : * const c_char ,
@@ -2499,7 +2501,6 @@ unsafe extern "C" {
24992501 UseWasmEH : bool ,
25002502 ) -> * mut TargetMachine ;
25012503
2502- pub ( crate ) fn LLVMRustDisposeTargetMachine ( T : * mut TargetMachine ) ;
25032504 pub ( crate ) fn LLVMRustAddLibraryInfo < ' a > (
25042505 PM : & PassManager < ' a > ,
25052506 M : & ' a Module ,
Original file line number Diff line number Diff line change @@ -359,10 +359,6 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
359359 return wrap (TM);
360360}
361361
362- extern " C" void LLVMRustDisposeTargetMachine (LLVMTargetMachineRef TM) {
363- delete unwrap (TM);
364- }
365-
366362// Unfortunately, the LLVM C API doesn't provide a way to create the
367363// TargetLibraryInfo pass, so we use this method to do so.
368364extern " C" void LLVMRustAddLibraryInfo (LLVMPassManagerRef PMR, LLVMModuleRef M,
You can’t perform that action at this time.
0 commit comments