@@ -202,12 +202,7 @@ impl CodegenBackend for LlbcCodegenBackend {
202
202
DEFAULT_LOCALE_RESOURCE
203
203
}
204
204
205
- fn codegen_crate (
206
- & self ,
207
- tcx : TyCtxt ,
208
- rustc_metadata : EncodedMetadata ,
209
- _need_metadata_module : bool ,
210
- ) -> Box < dyn Any > {
205
+ fn codegen_crate ( & self , tcx : TyCtxt ) -> Box < dyn Any > {
211
206
let ret_val = rustc_internal:: run ( tcx, || {
212
207
// Queries shouldn't change today once codegen starts.
213
208
let queries = self . queries . lock ( ) . unwrap ( ) . clone ( ) ;
@@ -286,7 +281,7 @@ impl CodegenBackend for LlbcCodegenBackend {
286
281
// To avoid overriding the metadata for its verification, we skip this step when
287
282
// reachability is None, even because there is nothing to record.
288
283
}
289
- codegen_results ( tcx, rustc_metadata )
284
+ codegen_results ( tcx)
290
285
} ) ;
291
286
ret_val. unwrap ( )
292
287
}
@@ -318,10 +313,16 @@ impl CodegenBackend for LlbcCodegenBackend {
318
313
/// For cases where no metadata file was requested, we stub the file requested by writing the
319
314
/// path of the `kani-metadata.json` file so `kani-driver` can safely find the latest metadata.
320
315
/// See <https://github.com/model-checking/kani/issues/2234> for more details.
321
- fn link ( & self , sess : & Session , codegen_results : CodegenResults , outputs : & OutputFilenames ) {
316
+ fn link (
317
+ & self ,
318
+ sess : & Session ,
319
+ codegen_results : CodegenResults ,
320
+ rustc_metadata : EncodedMetadata ,
321
+ outputs : & OutputFilenames ,
322
+ ) {
322
323
let requested_crate_types = & codegen_results. crate_info . crate_types . clone ( ) ;
323
324
let local_crate_name = codegen_results. crate_info . local_crate_name ;
324
- link_binary ( sess, & ArArchiveBuilderBuilder , codegen_results, outputs) ;
325
+ link_binary ( sess, & ArArchiveBuilderBuilder , codegen_results, rustc_metadata , outputs) ;
325
326
for crate_type in requested_crate_types {
326
327
let out_fname = out_filename ( sess, * crate_type, outputs, local_crate_name) ;
327
328
let out_path = out_fname. as_path ( ) ;
@@ -356,14 +357,12 @@ fn contract_metadata_for_harness(
356
357
}
357
358
358
359
/// Return a struct that contains information about the codegen results as expected by `rustc`.
359
- fn codegen_results ( tcx : TyCtxt , rustc_metadata : EncodedMetadata ) -> Box < dyn Any > {
360
+ fn codegen_results ( tcx : TyCtxt ) -> Box < dyn Any > {
360
361
let work_products = FxIndexMap :: < WorkProductId , WorkProduct > :: default ( ) ;
361
362
Box :: new ( (
362
363
CodegenResults {
363
364
modules : vec ! [ ] ,
364
365
allocator_module : None ,
365
- metadata_module : None ,
366
- metadata : rustc_metadata,
367
366
crate_info : CrateInfo :: new ( tcx, tcx. sess . target . arch . clone ( ) . to_string ( ) ) ,
368
367
} ,
369
368
work_products,
0 commit comments