@@ -207,10 +207,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
207
207
208
208
let metadata = tcx. encode_metadata ( ) ;
209
209
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
-
214
210
let mut log = if cfg ! ( debug_assertions) {
215
211
Some ( File :: create ( concat ! ( env!( "CARGO_MANIFEST_DIR" ) , "/target/out/log.txt" ) ) . unwrap ( ) )
216
212
} else {
@@ -323,6 +319,10 @@ impl CodegenBackend for CraneliftCodegenBackend {
323
319
let mut allocator_module = new_module ( "allocator_shim.o" . to_string ( ) ) ;
324
320
let created_alloc_shim = crate :: allocator:: codegen ( tcx. sess , & mut allocator_module) ;
325
321
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
+
326
326
return Box :: new ( CodegenResults {
327
327
crate_name : tcx. crate_name ( LOCAL_CRATE ) ,
328
328
modules : vec ! [ emit_module(
@@ -469,12 +469,6 @@ fn time<R>(name: &str, f: impl FnOnce() -> R) -> R {
469
469
res
470
470
}
471
471
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
-
478
472
/// This is the entrypoint for a hot plugged rustc_codegen_cranelift
479
473
#[ no_mangle]
480
474
pub fn __rustc_codegen_backend ( ) -> Box < dyn CodegenBackend > {
0 commit comments