@@ -157,10 +157,10 @@ use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
157
157
use rustc_middle:: mir:: mono:: { MonoItem , MonoItemData } ;
158
158
use rustc_middle:: mir:: pretty:: write_mir_pretty;
159
159
use rustc_middle:: ty:: print:: with_no_trimmed_paths;
160
- use rustc_middle:: ty:: { self , Instance , InstanceKind , TyCtxt } ;
160
+ use rustc_middle:: ty:: { InstanceKind , TyCtxt } ;
161
161
use rustc_session:: Session ;
162
162
use rustc_session:: config:: { self , OutputFilenames , OutputType } ;
163
- use rustc_span:: symbol:: { Symbol , sym } ;
163
+ use rustc_span:: symbol:: Symbol ;
164
164
use std:: any:: Any ;
165
165
use std:: fs:: { File , create_dir_all} ;
166
166
use std:: io:: Cursor ;
@@ -184,45 +184,6 @@ fn dump_mir(tcx: TyCtxt<'_>, mono_items: &[(MonoItem<'_>, MonoItemData)], path:
184
184
}
185
185
}
186
186
187
- fn is_blocklisted_fn < ' tcx > (
188
- tcx : TyCtxt < ' tcx > ,
189
- sym : & symbols:: Symbols ,
190
- instance : Instance < ' tcx > ,
191
- ) -> bool {
192
- // TODO: These sometimes have a constant value of an enum variant with a hole
193
- if let InstanceKind :: Item ( def_id) = instance. def {
194
- if let Some ( debug_trait_def_id) = tcx. get_diagnostic_item ( sym:: Debug ) {
195
- // Helper for detecting `<_ as core::fmt::Debug>::fmt` (in impls).
196
- let is_debug_fmt_method = |def_id| match tcx. opt_associated_item ( def_id) {
197
- Some ( assoc) if assoc. ident ( tcx) . name == sym:: fmt => match assoc. container {
198
- ty:: AssocItemContainer :: Impl => {
199
- let impl_def_id = assoc. container_id ( tcx) ;
200
- tcx. impl_trait_ref ( impl_def_id)
201
- . map ( |tr| tr. skip_binder ( ) . def_id )
202
- == Some ( debug_trait_def_id)
203
- }
204
- ty:: AssocItemContainer :: Trait => false ,
205
- } ,
206
- _ => false ,
207
- } ;
208
-
209
- if is_debug_fmt_method ( def_id) {
210
- return true ;
211
- }
212
-
213
- if tcx. opt_item_ident ( def_id) . map ( |i| i. name ) == Some ( sym. fmt_decimal ) {
214
- if let Some ( parent_def_id) = tcx. opt_parent ( def_id) {
215
- if is_debug_fmt_method ( parent_def_id) {
216
- return true ;
217
- }
218
- }
219
- }
220
- }
221
- }
222
-
223
- false
224
- }
225
-
226
187
// TODO: Should this store Vec or Module?
227
188
struct SpirvModuleBuffer ( Vec < u32 > ) ;
228
189
@@ -470,11 +431,6 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
470
431
}
471
432
472
433
for & ( mono_item, mono_item_data) in mono_items. iter ( ) {
473
- if let MonoItem :: Fn ( instance) = mono_item {
474
- if is_blocklisted_fn ( cx. tcx , & cx. sym , instance) {
475
- continue ;
476
- }
477
- }
478
434
mono_item. predefine :: < Builder < ' _ , ' _ > > (
479
435
& cx,
480
436
mono_item_data. linkage ,
@@ -484,11 +440,6 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
484
440
485
441
// ... and now that we have everything pre-defined, fill out those definitions.
486
442
for & ( mono_item, _) in mono_items. iter ( ) {
487
- if let MonoItem :: Fn ( instance) = mono_item {
488
- if is_blocklisted_fn ( cx. tcx , & cx. sym , instance) {
489
- continue ;
490
- }
491
- }
492
443
mono_item. define :: < Builder < ' _ , ' _ > > ( & cx) ;
493
444
}
494
445
0 commit comments