File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
src/librustc_codegen_llvm Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -294,10 +294,10 @@ fn fat_lto(cgcx: &CodegenContext,
294
294
} ] )
295
295
}
296
296
297
- struct Linker ( llvm:: LinkerRef ) ;
297
+ struct Linker < ' a > ( & ' a mut llvm:: Linker < ' a > ) ;
298
298
299
- impl Linker {
300
- fn new ( llmod : & llvm:: Module ) -> Linker {
299
+ impl Linker < ' a > {
300
+ fn new ( llmod : & ' a llvm:: Module ) -> Self {
301
301
unsafe { Linker ( llvm:: LLVMRustLinkerNew ( llmod) ) }
302
302
}
303
303
@@ -314,9 +314,9 @@ impl Linker {
314
314
}
315
315
}
316
316
317
- impl Drop for Linker {
317
+ impl Drop for Linker < ' a > {
318
318
fn drop ( & mut self ) {
319
- unsafe { llvm:: LLVMRustLinkerFree ( self . 0 ) ; }
319
+ unsafe { llvm:: LLVMRustLinkerFree ( & mut * ( self . 0 as * mut _ ) ) ; }
320
320
}
321
321
}
322
322
Original file line number Diff line number Diff line change @@ -414,8 +414,7 @@ extern { pub type SMDiagnostic; }
414
414
extern { pub type RustArchiveMember ; }
415
415
pub type RustArchiveMemberRef = * mut RustArchiveMember ;
416
416
pub struct OperandBundleDef < ' a > ( InvariantOpaque < ' a > ) ;
417
- extern { pub type Linker ; }
418
- pub type LinkerRef = * mut Linker ;
417
+ pub struct Linker < ' a > ( InvariantOpaque < ' a > ) ;
419
418
420
419
pub type DiagnosticHandler = unsafe extern "C" fn ( & DiagnosticInfo , * mut c_void ) ;
421
420
pub type InlineAsmDiagHandler = unsafe extern "C" fn ( & SMDiagnostic , * const c_void , c_uint ) ;
@@ -1580,9 +1579,9 @@ extern "C" {
1580
1579
CU2 : & mut * mut c_void ) ;
1581
1580
pub fn LLVMRustThinLTOPatchDICompileUnit ( M : & Module , CU : * mut c_void ) ;
1582
1581
1583
- pub fn LLVMRustLinkerNew ( M : & Module ) -> LinkerRef ;
1584
- pub fn LLVMRustLinkerAdd ( linker : LinkerRef ,
1582
+ pub fn LLVMRustLinkerNew ( M : & ' a Module ) -> & ' a mut Linker < ' a > ;
1583
+ pub fn LLVMRustLinkerAdd ( linker : & Linker ,
1585
1584
bytecode : * const c_char ,
1586
1585
bytecode_len : usize ) -> bool ;
1587
- pub fn LLVMRustLinkerFree ( linker : LinkerRef ) ;
1586
+ pub fn LLVMRustLinkerFree ( linker : & ' a mut Linker < ' a > ) ;
1588
1587
}
You can’t perform that action at this time.
0 commit comments