@@ -120,7 +120,7 @@ pub struct CodegenCx<'gcc, 'tcx> {
120
120
/// A counter that is used for generating local symbol names
121
121
local_gen_sym_counter : Cell < usize > ,
122
122
123
- eh_personality : Cell < Option < RValue < ' gcc > > > ,
123
+ eh_personality : Cell < Option < Function < ' gcc > > > ,
124
124
#[ cfg( feature = "master" ) ]
125
125
pub rust_try_fn : Cell < Option < ( Type < ' gcc > , Function < ' gcc > ) > > ,
126
126
@@ -428,7 +428,7 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
428
428
ptr
429
429
}
430
430
431
- fn eh_personality ( & self ) -> RValue < ' gcc > {
431
+ fn eh_personality ( & self ) -> Function < ' gcc > {
432
432
// The exception handling personality function.
433
433
//
434
434
// If our compilation unit has the `eh_personality` lang item somewhere
@@ -466,18 +466,15 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
466
466
let symbol_name = tcx. symbol_name ( instance) . name ;
467
467
let fn_abi = self . fn_abi_of_instance ( instance, ty:: List :: empty ( ) ) ;
468
468
self . linkage . set ( FunctionType :: Extern ) ;
469
- let func = self . declare_fn ( symbol_name, fn_abi) ;
470
- let func: RValue < ' gcc > = unsafe { std:: mem:: transmute ( func) } ;
471
- func
469
+ self . declare_fn ( symbol_name, fn_abi)
472
470
}
473
471
_ => {
474
472
let name = if wants_msvc_seh ( self . sess ( ) ) {
475
473
"__CxxFrameHandler3"
476
474
} else {
477
475
"rust_eh_personality"
478
476
} ;
479
- let func = self . declare_func ( name, self . type_i32 ( ) , & [ ] , true ) ;
480
- unsafe { std:: mem:: transmute :: < Function < ' gcc > , RValue < ' gcc > > ( func) }
477
+ self . declare_func ( name, self . type_i32 ( ) , & [ ] , true )
481
478
}
482
479
} ;
483
480
// TODO(antoyo): apply target cpu attributes.
0 commit comments