@@ -207,10 +207,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
207207
208208 let metadata = tcx. encode_metadata ( ) ;
209209
210- // TODO: move to the end of this function when compiling libcore doesn't have unimplemented stuff anymore
211- save_incremental ( tcx) ;
212- tcx. sess . warn ( "Saved incremental data" ) ;
213-
214210 let mut log = if cfg ! ( debug_assertions) {
215211 Some ( File :: create ( concat ! ( env!( "CARGO_MANIFEST_DIR" ) , "/target/out/log.txt" ) ) . unwrap ( ) )
216212 } else {
@@ -323,6 +319,10 @@ impl CodegenBackend for CraneliftCodegenBackend {
323319 let mut allocator_module = new_module ( "allocator_shim.o" . to_string ( ) ) ;
324320 let created_alloc_shim = crate :: allocator:: codegen ( tcx. sess , & mut allocator_module) ;
325321
322+ rustc_incremental:: assert_dep_graph ( tcx) ;
323+ rustc_incremental:: save_dep_graph ( tcx) ;
324+ rustc_incremental:: finalize_session_directory ( tcx. sess , tcx. crate_hash ( LOCAL_CRATE ) ) ;
325+
326326 return Box :: new ( CodegenResults {
327327 crate_name : tcx. crate_name ( LOCAL_CRATE ) ,
328328 modules : vec ! [ emit_module(
@@ -469,12 +469,6 @@ fn time<R>(name: &str, f: impl FnOnce() -> R) -> R {
469469 res
470470}
471471
472- fn save_incremental < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ) {
473- rustc_incremental:: assert_dep_graph ( tcx) ;
474- rustc_incremental:: save_dep_graph ( tcx) ;
475- rustc_incremental:: finalize_session_directory ( tcx. sess , tcx. crate_hash ( LOCAL_CRATE ) ) ;
476- }
477-
478472/// This is the entrypoint for a hot plugged rustc_codegen_cranelift
479473#[ no_mangle]
480474pub fn __rustc_codegen_backend ( ) -> Box < dyn CodegenBackend > {
0 commit comments