11use crate :: transform:: { InnerTransform , Transformed , Transformer } ;
22use crate :: visit:: { InnerVisit , Visitor } ;
33use crate :: {
4- AttrSet , Const , Context , DataInstForm , DeclDef , ExportKey , Exportee , Func , FxIndexSet ,
5- GlobalVar , Import , Module , Type ,
4+ AttrSet , Const , Context , DeclDef , ExportKey , Exportee , Func , FxIndexSet , GlobalVar , Import ,
5+ Module , Type ,
66} ;
77use rustc_hash:: { FxHashMap , FxHashSet } ;
88use std:: collections:: VecDeque ;
@@ -33,7 +33,6 @@ pub fn minimize_exports(module: &mut Module, is_root: impl Fn(&ExportKey) -> boo
3333
3434 seen_types : FxHashSet :: default ( ) ,
3535 seen_consts : FxHashSet :: default ( ) ,
36- seen_data_inst_forms : FxHashSet :: default ( ) ,
3736 seen_global_vars : FxHashSet :: default ( ) ,
3837 seen_funcs : FxHashSet :: default ( ) ,
3938 } ;
@@ -61,7 +60,6 @@ struct LiveExportCollector<'a> {
6160 // FIXME(eddyb) build some automation to avoid ever repeating these.
6261 seen_types : FxHashSet < Type > ,
6362 seen_consts : FxHashSet < Const > ,
64- seen_data_inst_forms : FxHashSet < DataInstForm > ,
6563 seen_global_vars : FxHashSet < GlobalVar > ,
6664 seen_funcs : FxHashSet < Func > ,
6765}
@@ -81,11 +79,6 @@ impl Visitor<'_> for LiveExportCollector<'_> {
8179 self . visit_const_def ( & self . cx [ ct] ) ;
8280 }
8381 }
84- fn visit_data_inst_form_use ( & mut self , data_inst_form : DataInstForm ) {
85- if self . seen_data_inst_forms . insert ( data_inst_form) {
86- self . visit_data_inst_form_def ( & self . cx [ data_inst_form] ) ;
87- }
88- }
8982
9083 fn visit_global_var_use ( & mut self , gv : GlobalVar ) {
9184 if self . seen_global_vars . insert ( gv) {
@@ -128,7 +121,6 @@ pub fn resolve_imports(module: &mut Module) {
128121
129122 seen_types : FxHashSet :: default ( ) ,
130123 seen_consts : FxHashSet :: default ( ) ,
131- seen_data_inst_forms : FxHashSet :: default ( ) ,
132124 seen_global_vars : FxHashSet :: default ( ) ,
133125 seen_funcs : FxHashSet :: default ( ) ,
134126 } ;
@@ -144,7 +136,6 @@ pub fn resolve_imports(module: &mut Module) {
144136
145137 transformed_types : FxHashMap :: default ( ) ,
146138 transformed_consts : FxHashMap :: default ( ) ,
147- transformed_data_inst_forms : FxHashMap :: default ( ) ,
148139 transformed_global_vars : FxHashMap :: default ( ) ,
149140 global_var_queue : VecDeque :: new ( ) ,
150141 transformed_funcs : FxHashMap :: default ( ) ,
@@ -179,7 +170,6 @@ struct ImportResolutionCollector<'a> {
179170 // FIXME(eddyb) build some automation to avoid ever repeating these.
180171 seen_types : FxHashSet < Type > ,
181172 seen_consts : FxHashSet < Const > ,
182- seen_data_inst_forms : FxHashSet < DataInstForm > ,
183173 seen_global_vars : FxHashSet < GlobalVar > ,
184174 seen_funcs : FxHashSet < Func > ,
185175}
@@ -199,11 +189,6 @@ impl Visitor<'_> for ImportResolutionCollector<'_> {
199189 self . visit_const_def ( & self . cx [ ct] ) ;
200190 }
201191 }
202- fn visit_data_inst_form_use ( & mut self , data_inst_form : DataInstForm ) {
203- if self . seen_data_inst_forms . insert ( data_inst_form) {
204- self . visit_data_inst_form_def ( & self . cx [ data_inst_form] ) ;
205- }
206- }
207192
208193 fn visit_global_var_use ( & mut self , gv : GlobalVar ) {
209194 if self . seen_global_vars . insert ( gv) {
@@ -250,7 +235,6 @@ struct ImportResolver<'a> {
250235 // FIXME(eddyb) build some automation to avoid ever repeating these.
251236 transformed_types : FxHashMap < Type , Transformed < Type > > ,
252237 transformed_consts : FxHashMap < Const , Transformed < Const > > ,
253- transformed_data_inst_forms : FxHashMap < DataInstForm , Transformed < DataInstForm > > ,
254238 transformed_global_vars : FxHashMap < GlobalVar , Transformed < GlobalVar > > ,
255239 global_var_queue : VecDeque < GlobalVar > ,
256240 transformed_funcs : FxHashMap < Func , Transformed < Func > > ,
@@ -277,19 +261,6 @@ impl Transformer for ImportResolver<'_> {
277261 self . transformed_consts . insert ( ct, transformed) ;
278262 transformed
279263 }
280- fn transform_data_inst_form_use (
281- & mut self ,
282- data_inst_form : DataInstForm ,
283- ) -> Transformed < DataInstForm > {
284- if let Some ( & cached) = self . transformed_data_inst_forms . get ( & data_inst_form) {
285- return cached;
286- }
287- let transformed = self
288- . transform_data_inst_form_def ( & self . cx [ data_inst_form] )
289- . map ( |data_inst_form_def| self . cx . intern ( data_inst_form_def) ) ;
290- self . transformed_data_inst_forms . insert ( data_inst_form, transformed) ;
291- transformed
292- }
293264
294265 fn transform_global_var_use ( & mut self , gv : GlobalVar ) -> Transformed < GlobalVar > {
295266 if let Some ( & cached) = self . transformed_global_vars . get ( & gv) {
0 commit comments