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,
294294 } ] )
295295}
296296
297- struct Linker ( llvm:: LinkerRef ) ;
297+ struct Linker < ' a > ( & ' a mut llvm:: Linker < ' a > ) ;
298298
299- impl Linker {
300- fn new ( llmod : & llvm:: Module ) -> Linker {
299+ impl Linker < ' a > {
300+ fn new ( llmod : & ' a llvm:: Module ) -> Self {
301301 unsafe { Linker ( llvm:: LLVMRustLinkerNew ( llmod) ) }
302302 }
303303
@@ -314,9 +314,9 @@ impl Linker {
314314 }
315315}
316316
317- impl Drop for Linker {
317+ impl Drop for Linker < ' a > {
318318 fn drop ( & mut self ) {
319- unsafe { llvm:: LLVMRustLinkerFree ( self . 0 ) ; }
319+ unsafe { llvm:: LLVMRustLinkerFree ( & mut * ( self . 0 as * mut _ ) ) ; }
320320 }
321321}
322322
Original file line number Diff line number Diff line change @@ -414,8 +414,7 @@ extern { pub type SMDiagnostic; }
414414extern { pub type RustArchiveMember ; }
415415pub type RustArchiveMemberRef = * mut RustArchiveMember ;
416416pub struct OperandBundleDef < ' a > ( InvariantOpaque < ' a > ) ;
417- extern { pub type Linker ; }
418- pub type LinkerRef = * mut Linker ;
417+ pub struct Linker < ' a > ( InvariantOpaque < ' a > ) ;
419418
420419pub type DiagnosticHandler = unsafe extern "C" fn ( & DiagnosticInfo , * mut c_void ) ;
421420pub type InlineAsmDiagHandler = unsafe extern "C" fn ( & SMDiagnostic , * const c_void , c_uint ) ;
@@ -1580,9 +1579,9 @@ extern "C" {
15801579 CU2 : & mut * mut c_void ) ;
15811580 pub fn LLVMRustThinLTOPatchDICompileUnit ( M : & Module , CU : * mut c_void ) ;
15821581
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 ,
15851584 bytecode : * const c_char ,
15861585 bytecode_len : usize ) -> bool ;
1587- pub fn LLVMRustLinkerFree ( linker : LinkerRef ) ;
1586+ pub fn LLVMRustLinkerFree ( linker : & ' a mut Linker < ' a > ) ;
15881587}
You can’t perform that action at this time.
0 commit comments