@@ -375,8 +375,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
375375impl < ' gcc , ' tcx > BackendTypes for CodegenCx < ' gcc , ' tcx > {
376376 type Value = RValue < ' gcc > ;
377377 type Metadata = RValue < ' gcc > ;
378- // TODO(antoyo): change to Function<'gcc>.
379- type Function = RValue < ' gcc > ;
378+ type Function = Function < ' gcc > ;
380379
381380 type BasicBlock = Block < ' gcc > ;
382381 type Type = Type < ' gcc > ;
@@ -394,11 +393,10 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
394393 & self . vtables
395394 }
396395
397- fn get_fn ( & self , instance : Instance < ' tcx > ) -> RValue < ' gcc > {
396+ fn get_fn ( & self , instance : Instance < ' tcx > ) -> Function < ' gcc > {
398397 let func = get_fn ( self , instance) ;
399398 * self . current_func . borrow_mut ( ) = Some ( func) ;
400- // FIXME(antoyo): this is a wrong cast. That requires changing the compiler API.
401- unsafe { std:: mem:: transmute ( func) }
399+ func
402400 }
403401
404402 fn get_fn_addr ( & self , instance : Instance < ' tcx > ) -> RValue < ' gcc > {
@@ -487,11 +485,11 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
487485 self . codegen_unit
488486 }
489487
490- fn set_frame_pointer_type ( & self , _llfn : RValue < ' gcc > ) {
488+ fn set_frame_pointer_type ( & self , _llfn : Function < ' gcc > ) {
491489 // TODO(antoyo)
492490 }
493491
494- fn apply_target_cpu_attr ( & self , _llfn : RValue < ' gcc > ) {
492+ fn apply_target_cpu_attr ( & self , _llfn : Function < ' gcc > ) {
495493 // TODO(antoyo)
496494 }
497495
0 commit comments