1- use  crate :: abi:: FnAbi ; 
21use  crate :: attributes; 
32use  crate :: debuginfo; 
43use  crate :: llvm; 
@@ -15,23 +14,20 @@ use rustc::mir::mono::CodegenUnit;
1514use  rustc:: session:: config:: { self ,  CFGuard ,  DebugInfo } ; 
1615use  rustc:: session:: Session ; 
1716use  rustc:: ty:: layout:: { 
18-     FnAbiExt ,   HasParamEnv ,  LayoutError ,  LayoutOf ,  PointeeInfo ,  Size ,  TyLayout ,  VariantIdx , 
17+     HasParamEnv ,  LayoutError ,  LayoutOf ,  PointeeInfo ,  Size ,  TyLayout ,  VariantIdx , 
1918} ; 
2019use  rustc:: ty:: { self ,  Instance ,  Ty ,  TyCtxt } ; 
2120use  rustc_codegen_ssa:: base:: wants_msvc_seh; 
2221use  rustc_data_structures:: base_n; 
2322use  rustc_data_structures:: const_cstr; 
2423use  rustc_data_structures:: fx:: FxHashMap ; 
2524use  rustc_data_structures:: small_c_str:: SmallCStr ; 
26- use  rustc_hir:: Unsafety ; 
2725use  rustc_target:: spec:: { HasTargetSpec ,  Target } ; 
2826
29- use  crate :: abi:: Abi ; 
3027use  rustc_span:: source_map:: { Span ,  DUMMY_SP } ; 
3128use  rustc_span:: symbol:: Symbol ; 
3229use  std:: cell:: { Cell ,  RefCell } ; 
3330use  std:: ffi:: CStr ; 
34- use  std:: iter; 
3531use  std:: str; 
3632use  std:: sync:: Arc ; 
3733
@@ -87,7 +83,6 @@ pub struct CodegenCx<'ll, 'tcx> {
8783    pub  dbg_cx :  Option < debuginfo:: CrateDebugContext < ' ll ,  ' tcx > > , 
8884
8985    eh_personality :  Cell < Option < & ' ll  Value > > , 
90-     eh_unwind_resume :  Cell < Option < & ' ll  Value > > , 
9186    pub  rust_try_fn :  Cell < Option < & ' ll  Value > > , 
9287
9388    intrinsics :  RefCell < FxHashMap < & ' static  str ,  & ' ll  Value > > , 
@@ -328,7 +323,6 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
328323            isize_ty, 
329324            dbg_cx, 
330325            eh_personality :  Cell :: new ( None ) , 
331-             eh_unwind_resume :  Cell :: new ( None ) , 
332326            rust_try_fn :  Cell :: new ( None ) , 
333327            intrinsics :  Default :: default ( ) , 
334328            local_gen_sym_counter :  Cell :: new ( 0 ) , 
@@ -406,45 +400,6 @@ impl MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> {
406400        llfn
407401    } 
408402
409-     // Returns a Value of the "eh_unwind_resume" lang item if one is defined, 
410-     // otherwise declares it as an external function. 
411-     fn  eh_unwind_resume ( & self )  -> & ' ll  Value  { 
412-         let  unwresume = & self . eh_unwind_resume ; 
413-         if  let  Some ( llfn)  = unwresume. get ( )  { 
414-             return  llfn; 
415-         } 
416- 
417-         let  tcx = self . tcx ; 
418-         assert ! ( self . sess( ) . target. target. options. custom_unwind_resume) ; 
419-         if  let  Some ( def_id)  = tcx. lang_items ( ) . eh_unwind_resume ( )  { 
420-             let  llfn = self . get_fn_addr ( 
421-                 ty:: Instance :: resolve ( 
422-                     tcx, 
423-                     ty:: ParamEnv :: reveal_all ( ) , 
424-                     def_id, 
425-                     tcx. intern_substs ( & [ ] ) , 
426-                 ) 
427-                 . unwrap ( ) , 
428-             ) ; 
429-             unwresume. set ( Some ( llfn) ) ; 
430-             return  llfn; 
431-         } 
432- 
433-         let  sig = ty:: Binder :: bind ( tcx. mk_fn_sig ( 
434-             iter:: once ( tcx. mk_mut_ptr ( tcx. types . u8 ) ) , 
435-             tcx. types . never , 
436-             false , 
437-             Unsafety :: Unsafe , 
438-             Abi :: C , 
439-         ) ) ; 
440- 
441-         let  fn_abi = FnAbi :: of_fn_ptr ( self ,  sig,  & [ ] ) ; 
442-         let  llfn = self . declare_fn ( "rust_eh_unwind_resume" ,  & fn_abi) ; 
443-         attributes:: apply_target_cpu_attr ( self ,  llfn) ; 
444-         unwresume. set ( Some ( llfn) ) ; 
445-         llfn
446-     } 
447- 
448403    fn  sess ( & self )  -> & Session  { 
449404        & self . tcx . sess 
450405    } 
0 commit comments