@@ -267,12 +267,13 @@ pub fn compile_input<Trans: TransCrate>(sess: &Session,
267267 let ( phase5_result, trans) =
268268 phase_5_run_llvm_passes :: < Trans > ( sess, & dep_graph, trans) ;
269269
270- controller_entry_point ! ( after_llvm,
271- sess,
272- CompileState :: state_after_llvm( input, sess, outdir, output, & trans) ,
273- phase5_result) ;
274270 phase5_result?;
275271
272+ if !sess. opts . output_types . keys ( ) . any ( |& i| i == OutputType :: Exe ||
273+ i == OutputType :: Metadata ) {
274+ return Ok ( ( ) ) ;
275+ }
276+
276277 // Run the linker on any artifacts that resulted from the LLVM run.
277278 // This should produce either a finished executable or library.
278279 time ( sess. time_passes ( ) , "linking" , || {
@@ -336,7 +337,6 @@ pub struct CompileController<'a> {
336337 pub after_expand : PhaseController < ' a > ,
337338 pub after_hir_lowering : PhaseController < ' a > ,
338339 pub after_analysis : PhaseController < ' a > ,
339- pub after_llvm : PhaseController < ' a > ,
340340 pub compilation_done : PhaseController < ' a > ,
341341
342342 // FIXME we probably want to group the below options together and offer a
@@ -355,7 +355,6 @@ impl<'a> CompileController<'a> {
355355 after_expand : PhaseController :: basic ( ) ,
356356 after_hir_lowering : PhaseController :: basic ( ) ,
357357 after_analysis : PhaseController :: basic ( ) ,
358- after_llvm : PhaseController :: basic ( ) ,
359358 compilation_done : PhaseController :: basic ( ) ,
360359 make_glob_map : MakeGlobMap :: No ,
361360 keep_ast : false ,
@@ -385,7 +384,7 @@ impl<'a> PhaseController<'a> {
385384/// State that is passed to a callback. What state is available depends on when
386385/// during compilation the callback is made. See the various constructor methods
387386/// (`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 > {
389388 pub input : & ' a Input ,
390389 pub session : & ' tcx Session ,
391390 pub krate : Option < ast:: Crate > ,
@@ -403,10 +402,9 @@ pub struct CompileState<'a, 'tcx: 'a, Trans: TransCrate> {
403402 pub resolutions : Option < & ' a Resolutions > ,
404403 pub analysis : Option < & ' a ty:: CrateAnalysis > ,
405404 pub tcx : Option < TyCtxt < ' a , ' tcx , ' tcx > > ,
406- pub trans : Option < & ' a <Trans as TransCrate >:: TranslatedCrate > ,
407405}
408406
409- impl < ' a , ' tcx , Trans : TransCrate > CompileState < ' a , ' tcx , Trans > {
407+ impl < ' a , ' tcx > CompileState < ' a , ' tcx > {
410408 fn empty ( input : & ' a Input ,
411409 session : & ' tcx Session ,
412410 out_dir : & ' a Option < PathBuf > )
@@ -429,7 +427,6 @@ impl<'a, 'tcx, Trans: TransCrate> CompileState<'a, 'tcx, Trans> {
429427 resolutions : None ,
430428 analysis : None ,
431429 tcx : None ,
432- trans : None ,
433430 }
434431 }
435432
@@ -519,19 +516,6 @@ impl<'a, 'tcx, Trans: TransCrate> CompileState<'a, 'tcx, Trans> {
519516 }
520517 }
521518
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-
535519 fn state_when_compilation_done ( input : & ' a Input ,
536520 session : & ' tcx Session ,
537521 out_dir : & ' a Option < PathBuf > ,
0 commit comments