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 {
95
95
// SAFETY: constructing ensures we have a valid pointer created by
96
96
// llvm::LLVMRustCreateTargetMachine OwnedTargetMachine is not copyable so there is no
97
97
// double free or use after free.
98
- unsafe {
99
- llvm:: LLVMRustDisposeTargetMachine ( self . tm_unique . as_ptr ( ) ) ;
100
- }
98
+ unsafe { llvm:: LLVMDisposeTargetMachine ( self . tm_unique ) } ;
101
99
}
102
100
}
Original file line number Diff line number Diff line change @@ -1053,6 +1053,8 @@ unsafe extern "C" {
1053
1053
SLen : c_uint ,
1054
1054
) -> MetadataKindId ;
1055
1055
1056
+ pub ( crate ) fn LLVMDisposeTargetMachine ( T : ptr:: NonNull < TargetMachine > ) ;
1057
+
1056
1058
// Create modules.
1057
1059
pub ( crate ) fn LLVMModuleCreateWithNameInContext (
1058
1060
ModuleID : * const c_char ,
@@ -2499,7 +2501,6 @@ unsafe extern "C" {
2499
2501
UseWasmEH : bool ,
2500
2502
) -> * mut TargetMachine ;
2501
2503
2502
- pub ( crate ) fn LLVMRustDisposeTargetMachine ( T : * mut TargetMachine ) ;
2503
2504
pub ( crate ) fn LLVMRustAddLibraryInfo < ' a > (
2504
2505
PM : & PassManager < ' a > ,
2505
2506
M : & ' a Module ,
Original file line number Diff line number Diff line change @@ -359,10 +359,6 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
359
359
return wrap (TM);
360
360
}
361
361
362
- extern " C" void LLVMRustDisposeTargetMachine (LLVMTargetMachineRef TM) {
363
- delete unwrap (TM);
364
- }
365
-
366
362
// Unfortunately, the LLVM C API doesn't provide a way to create the
367
363
// TargetLibraryInfo pass, so we use this method to do so.
368
364
extern " C" void LLVMRustAddLibraryInfo (LLVMPassManagerRef PMR, LLVMModuleRef M,
You can’t perform that action at this time.
0 commit comments