@@ -375,8 +375,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
375
375
impl < ' gcc , ' tcx > BackendTypes for CodegenCx < ' gcc , ' tcx > {
376
376
type Value = RValue < ' gcc > ;
377
377
type Metadata = RValue < ' gcc > ;
378
- // TODO(antoyo): change to Function<'gcc>.
379
- type Function = RValue < ' gcc > ;
378
+ type Function = Function < ' gcc > ;
380
379
381
380
type BasicBlock = Block < ' gcc > ;
382
381
type Type = Type < ' gcc > ;
@@ -394,11 +393,10 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
394
393
& self . vtables
395
394
}
396
395
397
- fn get_fn ( & self , instance : Instance < ' tcx > ) -> RValue < ' gcc > {
396
+ fn get_fn ( & self , instance : Instance < ' tcx > ) -> Function < ' gcc > {
398
397
let func = get_fn ( self , instance) ;
399
398
* 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
402
400
}
403
401
404
402
fn get_fn_addr ( & self , instance : Instance < ' tcx > ) -> RValue < ' gcc > {
@@ -487,11 +485,11 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
487
485
self . codegen_unit
488
486
}
489
487
490
- fn set_frame_pointer_type ( & self , _llfn : RValue < ' gcc > ) {
488
+ fn set_frame_pointer_type ( & self , _llfn : Function < ' gcc > ) {
491
489
// TODO(antoyo)
492
490
}
493
491
494
- fn apply_target_cpu_attr ( & self , _llfn : RValue < ' gcc > ) {
492
+ fn apply_target_cpu_attr ( & self , _llfn : Function < ' gcc > ) {
495
493
// TODO(antoyo)
496
494
}
497
495
0 commit comments