@@ -48,7 +48,6 @@ use context::{is_pie_binary, get_reloc_model};
48
48
use common;
49
49
use jobserver:: { Client , Acquired } ;
50
50
use rustc_demangle;
51
- use std:: marker:: PhantomData ;
52
51
53
52
use std:: any:: Any ;
54
53
use std:: ffi:: { CString , CStr } ;
@@ -345,7 +344,7 @@ struct AssemblerCommand {
345
344
346
345
/// Additional resources used by optimize_and_codegen (not module specific)
347
346
#[ derive( Clone ) ]
348
- pub struct CodegenContext < ' ll > {
347
+ pub struct CodegenContext {
349
348
// Resources needed when running LTO
350
349
pub time_passes : bool ,
351
350
pub lto : Lto ,
@@ -384,13 +383,10 @@ pub struct CodegenContext<'ll> {
384
383
// measuring is disabled.
385
384
time_graph : Option < TimeGraph > ,
386
385
// The assembler command if no_integrated_as option is enabled, None otherwise
387
- assembler_cmd : Option < Arc < AssemblerCommand > > ,
388
- // This field is used to give a lifetime parameter to the struct so that it can implement
389
- // the Backend trait.
390
- phantom : PhantomData < & ' ll ( ) >
386
+ assembler_cmd : Option < Arc < AssemblerCommand > >
391
387
}
392
388
393
- impl CodegenContext < ' ll > {
389
+ impl CodegenContext {
394
390
pub fn create_diag_handler ( & self ) -> Handler {
395
391
Handler :: with_emitter ( true , false , Box :: new ( self . diag_emitter . clone ( ) ) )
396
392
}
@@ -419,12 +415,12 @@ impl CodegenContext<'ll> {
419
415
}
420
416
421
417
pub struct DiagnosticHandlers < ' a > {
422
- data : * mut ( & ' a CodegenContext < ' a > , & ' a Handler ) ,
418
+ data : * mut ( & ' a CodegenContext , & ' a Handler ) ,
423
419
llcx : & ' a llvm:: Context ,
424
420
}
425
421
426
422
impl < ' a > DiagnosticHandlers < ' a > {
427
- pub fn new ( cgcx : & ' a CodegenContext < ' a > ,
423
+ pub fn new ( cgcx : & ' a CodegenContext ,
428
424
handler : & ' a Handler ,
429
425
llcx : & ' a llvm:: Context ) -> Self {
430
426
let data = Box :: into_raw ( Box :: new ( ( cgcx, handler) ) ) ;
@@ -1625,7 +1621,6 @@ fn start_executing_work(tcx: TyCtxt,
1625
1621
target_pointer_width : tcx. sess . target . target . target_pointer_width . clone ( ) ,
1626
1622
debuginfo : tcx. sess . opts . debuginfo ,
1627
1623
assembler_cmd,
1628
- phantom : PhantomData
1629
1624
} ;
1630
1625
1631
1626
// This is the "main loop" of parallel work happening for parallel codegen.
@@ -2096,7 +2091,7 @@ pub const CODEGEN_WORK_PACKAGE_KIND: time_graph::WorkPackageKind =
2096
2091
const LLVM_WORK_PACKAGE_KIND : time_graph:: WorkPackageKind =
2097
2092
time_graph:: WorkPackageKind ( & [ "#7DB67A" , "#C6EEC4" , "#ACDAAA" , "#579354" , "#3E6F3C" ] ) ;
2098
2093
2099
- fn spawn_work ( cgcx : CodegenContext < ' static > , work : WorkItem ) {
2094
+ fn spawn_work ( cgcx : CodegenContext , work : WorkItem ) {
2100
2095
let depth = time_depth ( ) ;
2101
2096
2102
2097
thread:: spawn ( move || {
0 commit comments