@@ -382,8 +382,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
382382impl < ' gcc , ' tcx > BackendTypes for CodegenCx < ' gcc , ' tcx > {
383383 type Value = RValue < ' gcc > ;
384384 type Metadata = RValue < ' gcc > ;
385- // TODO(antoyo): change to Function<'gcc>.
386- type Function = RValue < ' gcc > ;
385+ type Function = Function < ' gcc > ;
387386
388387 type BasicBlock = Block < ' gcc > ;
389388 type Type = Type < ' gcc > ;
@@ -401,11 +400,10 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
401400 & self . vtables
402401 }
403402
404- fn get_fn ( & self , instance : Instance < ' tcx > ) -> RValue < ' gcc > {
403+ fn get_fn ( & self , instance : Instance < ' tcx > ) -> Function < ' gcc > {
405404 let func = get_fn ( self , instance) ;
406405 * self . current_func . borrow_mut ( ) = Some ( func) ;
407- // FIXME(antoyo): this is a wrong cast. That requires changing the compiler API.
408- unsafe { std:: mem:: transmute ( func) }
406+ func
409407 }
410408
411409 fn get_fn_addr ( & self , instance : Instance < ' tcx > ) -> RValue < ' gcc > {
@@ -494,11 +492,11 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
494492 self . codegen_unit
495493 }
496494
497- fn set_frame_pointer_type ( & self , _llfn : RValue < ' gcc > ) {
495+ fn set_frame_pointer_type ( & self , _llfn : Function < ' gcc > ) {
498496 // TODO(antoyo)
499497 }
500498
501- fn apply_target_cpu_attr ( & self , _llfn : RValue < ' gcc > ) {
499+ fn apply_target_cpu_attr ( & self , _llfn : Function < ' gcc > ) {
502500 // TODO(antoyo)
503501 }
504502
0 commit comments