@@ -872,28 +872,14 @@ pub struct ThinLTOImports {
872872
873873impl ThinLTOImports {
874874 /// Records `llvm_module_name` as importing `prev_imports` rather than what
875- /// we have currently computed. Ensures that the previous imports are a
876- /// superset of what imports LLVM currently computed.
875+ /// we have currently computed.
877876 fn overwrite_with_past_import_state ( & mut self ,
878877 llvm_module_name : & str ,
879878 prev_imports : & [ String ] ) {
880- // There were imports used to previous LTO optimize the module; make
881- // sure they are a superset of whatever we have in our current state,
882- // and then store them as our new current state.
883- let curr_imports_for_mod = self . modules_imported_by ( llvm_module_name) ;
884- for imported in curr_imports_for_mod {
885- assert ! ( prev_imports. contains( imported) ) ;
886- }
887- // We can avoid doing the insertion entirely if the sets are equivalent,
888- // and we can determine equivalence cheaply via a length comparison,
889- // since we have already asserted the past state to be a superset of the
890- // current state.
891- if prev_imports. len ( ) != curr_imports_for_mod. len ( ) {
892- debug ! ( "ThinLTOImports::restore_past_import_state \
893- mod: {:?} replacing curr state: {:?} with prev state: {:?}",
894- llvm_module_name, curr_imports_for_mod, prev_imports) ;
895- self . imports . insert ( llvm_module_name. to_owned ( ) , prev_imports. to_vec ( ) ) ;
896- }
879+ debug ! ( "ThinLTOImports::overwrite_with_past_import_state \
880+ mod: {:?} replacing curr state: {:?} with prev state: {:?}",
881+ llvm_module_name, self . modules_imported_by( llvm_module_name) , prev_imports) ;
882+ self . imports . insert ( llvm_module_name. to_owned ( ) , prev_imports. to_vec ( ) ) ;
897883 }
898884
899885 fn modules_imported_by ( & self , llvm_module_name : & str ) -> & [ String ] {
0 commit comments