@@ -382,8 +382,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
382
382
impl < ' gcc , ' tcx > BackendTypes for CodegenCx < ' gcc , ' tcx > {
383
383
type Value = RValue < ' gcc > ;
384
384
type Metadata = RValue < ' gcc > ;
385
- // TODO(antoyo): change to Function<'gcc>.
386
- type Function = RValue < ' gcc > ;
385
+ type Function = Function < ' gcc > ;
387
386
388
387
type BasicBlock = Block < ' gcc > ;
389
388
type Type = Type < ' gcc > ;
@@ -401,11 +400,10 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
401
400
& self . vtables
402
401
}
403
402
404
- fn get_fn ( & self , instance : Instance < ' tcx > ) -> RValue < ' gcc > {
403
+ fn get_fn ( & self , instance : Instance < ' tcx > ) -> Function < ' gcc > {
405
404
let func = get_fn ( self , instance) ;
406
405
* 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
409
407
}
410
408
411
409
fn get_fn_addr ( & self , instance : Instance < ' tcx > ) -> RValue < ' gcc > {
@@ -494,11 +492,11 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
494
492
self . codegen_unit
495
493
}
496
494
497
- fn set_frame_pointer_type ( & self , _llfn : RValue < ' gcc > ) {
495
+ fn set_frame_pointer_type ( & self , _llfn : Function < ' gcc > ) {
498
496
// TODO(antoyo)
499
497
}
500
498
501
- fn apply_target_cpu_attr ( & self , _llfn : RValue < ' gcc > ) {
499
+ fn apply_target_cpu_attr ( & self , _llfn : Function < ' gcc > ) {
502
500
// TODO(antoyo)
503
501
}
504
502
0 commit comments