@@ -267,12 +267,13 @@ pub fn compile_input<Trans: TransCrate>(sess: &Session,
267
267
let ( phase5_result, trans) =
268
268
phase_5_run_llvm_passes :: < Trans > ( sess, & dep_graph, trans) ;
269
269
270
- controller_entry_point ! ( after_llvm,
271
- sess,
272
- CompileState :: state_after_llvm( input, sess, outdir, output, & trans) ,
273
- phase5_result) ;
274
270
phase5_result?;
275
271
272
+ if !sess. opts . output_types . keys ( ) . any ( |& i| i == OutputType :: Exe ||
273
+ i == OutputType :: Metadata ) {
274
+ return Ok ( ( ) ) ;
275
+ }
276
+
276
277
// Run the linker on any artifacts that resulted from the LLVM run.
277
278
// This should produce either a finished executable or library.
278
279
time ( sess. time_passes ( ) , "linking" , || {
@@ -336,7 +337,6 @@ pub struct CompileController<'a> {
336
337
pub after_expand : PhaseController < ' a > ,
337
338
pub after_hir_lowering : PhaseController < ' a > ,
338
339
pub after_analysis : PhaseController < ' a > ,
339
- pub after_llvm : PhaseController < ' a > ,
340
340
pub compilation_done : PhaseController < ' a > ,
341
341
342
342
// FIXME we probably want to group the below options together and offer a
@@ -355,7 +355,6 @@ impl<'a> CompileController<'a> {
355
355
after_expand : PhaseController :: basic ( ) ,
356
356
after_hir_lowering : PhaseController :: basic ( ) ,
357
357
after_analysis : PhaseController :: basic ( ) ,
358
- after_llvm : PhaseController :: basic ( ) ,
359
358
compilation_done : PhaseController :: basic ( ) ,
360
359
make_glob_map : MakeGlobMap :: No ,
361
360
keep_ast : false ,
@@ -385,7 +384,7 @@ impl<'a> PhaseController<'a> {
385
384
/// State that is passed to a callback. What state is available depends on when
386
385
/// during compilation the callback is made. See the various constructor methods
387
386
/// (`state_*`) in the impl to see which data is provided for any given entry point.
388
- pub struct CompileState < ' a , ' tcx : ' a , Trans : TransCrate > {
387
+ pub struct CompileState < ' a , ' tcx : ' a > {
389
388
pub input : & ' a Input ,
390
389
pub session : & ' tcx Session ,
391
390
pub krate : Option < ast:: Crate > ,
@@ -403,10 +402,9 @@ pub struct CompileState<'a, 'tcx: 'a, Trans: TransCrate> {
403
402
pub resolutions : Option < & ' a Resolutions > ,
404
403
pub analysis : Option < & ' a ty:: CrateAnalysis > ,
405
404
pub tcx : Option < TyCtxt < ' a , ' tcx , ' tcx > > ,
406
- pub trans : Option < & ' a <Trans as TransCrate >:: TranslatedCrate > ,
407
405
}
408
406
409
- impl < ' a , ' tcx , Trans : TransCrate > CompileState < ' a , ' tcx , Trans > {
407
+ impl < ' a , ' tcx > CompileState < ' a , ' tcx > {
410
408
fn empty ( input : & ' a Input ,
411
409
session : & ' tcx Session ,
412
410
out_dir : & ' a Option < PathBuf > )
@@ -429,7 +427,6 @@ impl<'a, 'tcx, Trans: TransCrate> CompileState<'a, 'tcx, Trans> {
429
427
resolutions : None ,
430
428
analysis : None ,
431
429
tcx : None ,
432
- trans : None ,
433
430
}
434
431
}
435
432
@@ -519,19 +516,6 @@ impl<'a, 'tcx, Trans: TransCrate> CompileState<'a, 'tcx, Trans> {
519
516
}
520
517
}
521
518
522
- fn state_after_llvm ( input : & ' a Input ,
523
- session : & ' tcx Session ,
524
- out_dir : & ' a Option < PathBuf > ,
525
- out_file : & ' a Option < PathBuf > ,
526
- trans : & ' a <Trans as TransCrate >:: TranslatedCrate )
527
- -> Self {
528
- CompileState {
529
- trans : Some ( trans) ,
530
- out_file : out_file. as_ref ( ) . map ( |s| & * * s) ,
531
- ..CompileState :: empty ( input, session, out_dir)
532
- }
533
- }
534
-
535
519
fn state_when_compilation_done ( input : & ' a Input ,
536
520
session : & ' tcx Session ,
537
521
out_dir : & ' a Option < PathBuf > ,
0 commit comments