@@ -37,7 +37,7 @@ use std::any::Any;
37
37
use rustc_codegen_ssa:: traits:: CodegenBackend ;
38
38
use rustc_codegen_ssa:: CodegenResults ;
39
39
use rustc_errors:: ErrorReported ;
40
- use rustc_middle:: dep_graph:: { DepGraph , WorkProduct , WorkProductId } ;
40
+ use rustc_middle:: dep_graph:: { WorkProduct , WorkProductId } ;
41
41
use rustc_middle:: middle:: cstore:: { EncodedMetadata , MetadataLoader } ;
42
42
use rustc_middle:: ty:: query:: Providers ;
43
43
use rustc_session:: config:: OutputFilenames ;
@@ -190,23 +190,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
190
190
Box :: new ( crate :: metadata:: CraneliftMetadataLoader )
191
191
}
192
192
193
- fn provide ( & self , providers : & mut Providers ) {
194
- providers. supported_target_features = |tcx, cnum| {
195
- assert_eq ! ( cnum, LOCAL_CRATE ) ;
196
- if tcx. sess . opts . actually_rustdoc {
197
- // rustdoc needs to be able to document functions that use all the features, so
198
- // whitelist them all
199
- rustc_codegen_ssa:: target_features:: all_known_features ( )
200
- . map ( |( a, b) | ( a. to_string ( ) , b) )
201
- . collect ( )
202
- } else {
203
- rustc_codegen_ssa:: target_features:: supported_target_features ( tcx. sess )
204
- . iter ( )
205
- . map ( |& ( a, b) | ( a. to_string ( ) , b) )
206
- . collect ( )
207
- }
208
- } ;
209
- }
193
+ fn provide ( & self , _providers : & mut Providers ) { }
210
194
fn provide_extern ( & self , _providers : & mut Providers ) { }
211
195
212
196
fn target_features ( & self , _sess : & Session ) -> Vec < rustc_span:: Symbol > {
@@ -229,34 +213,21 @@ impl CodegenBackend for CraneliftCodegenBackend {
229
213
fn join_codegen (
230
214
& self ,
231
215
ongoing_codegen : Box < dyn Any > ,
232
- sess : & Session ,
233
- dep_graph : & DepGraph ,
234
- ) -> Result < Box < dyn Any > , ErrorReported > {
235
- let ( codegen_results, work_products) = * ongoing_codegen
216
+ _sess : & Session ,
217
+ ) -> Result < ( CodegenResults , FxHashMap < WorkProductId , WorkProduct > ) , ErrorReported > {
218
+ Ok ( * ongoing_codegen
236
219
. downcast :: < ( CodegenResults , FxHashMap < WorkProductId , WorkProduct > ) > ( )
237
- . unwrap ( ) ;
238
-
239
- sess. time ( "serialize_work_products" , move || {
240
- rustc_incremental:: save_work_product_index ( sess, & dep_graph, work_products)
241
- } ) ;
242
-
243
- Ok ( Box :: new ( codegen_results) )
220
+ . unwrap ( ) )
244
221
}
245
222
246
223
fn link (
247
224
& self ,
248
225
sess : & Session ,
249
- res : Box < dyn Any > ,
226
+ codegen_results : CodegenResults ,
250
227
outputs : & OutputFilenames ,
251
228
) -> Result < ( ) , ErrorReported > {
252
229
use rustc_codegen_ssa:: back:: link:: link_binary;
253
230
254
- sess. abort_if_errors ( ) ;
255
-
256
- let codegen_results = * res
257
- . downcast :: < CodegenResults > ( )
258
- . expect ( "Expected CraneliftCodegenBackend's CodegenResult, found Box<Any>" ) ;
259
-
260
231
let _timer = sess. prof . generic_activity ( "link_crate" ) ;
261
232
262
233
sess. time ( "linking" , || {
@@ -270,8 +241,6 @@ impl CodegenBackend for CraneliftCodegenBackend {
270
241
) ;
271
242
} ) ;
272
243
273
- rustc_incremental:: finalize_session_directory ( sess, codegen_results. crate_hash ) ;
274
-
275
244
Ok ( ( ) )
276
245
}
277
246
}
0 commit comments