@@ -18,11 +18,11 @@ pub(crate) use self::returning::codegen_return;
18
18
19
19
fn clif_sig_from_fn_abi < ' tcx > (
20
20
tcx : TyCtxt < ' tcx > ,
21
- triple : & target_lexicon :: Triple ,
21
+ default_call_conv : CallConv ,
22
22
fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
23
23
) -> Signature {
24
24
let call_conv = match fn_abi. conv {
25
- Conv :: Rust | Conv :: C => CallConv :: triple_default ( triple ) ,
25
+ Conv :: Rust | Conv :: C => default_call_conv ,
26
26
Conv :: X86_64SysV => CallConv :: SystemV ,
27
27
Conv :: X86_64Win64 => CallConv :: WindowsFastcall ,
28
28
Conv :: ArmAapcs
@@ -55,7 +55,7 @@ pub(crate) fn get_function_sig<'tcx>(
55
55
assert ! ( !inst. substs. needs_infer( ) ) ;
56
56
clif_sig_from_fn_abi (
57
57
tcx,
58
- triple,
58
+ CallConv :: triple_default ( triple) ,
59
59
& RevealAllLayoutCx ( tcx) . fn_abi_of_instance ( inst, ty:: List :: empty ( ) ) ,
60
60
)
61
61
}
@@ -91,7 +91,7 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
91
91
returns : Vec < AbiParam > ,
92
92
args : & [ Value ] ,
93
93
) -> & [ Value ] {
94
- let sig = Signature { params, returns, call_conv : CallConv :: triple_default ( self . triple ( ) ) } ;
94
+ let sig = Signature { params, returns, call_conv : self . target_config . default_call_conv } ;
95
95
let func_id = self . module . declare_function ( name, Linkage :: Import , & sig) . unwrap ( ) ;
96
96
let func_ref = self . module . declare_func_in_func ( func_id, & mut self . bcx . func ) ;
97
97
let call_inst = self . bcx . ins ( ) . call ( func_ref, args) ;
@@ -420,7 +420,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
420
420
}
421
421
422
422
let ( ptr, method) = crate :: vtable:: get_ptr_and_method_ref ( fx, args[ 0 ] . value , idx) ;
423
- let sig = clif_sig_from_fn_abi ( fx. tcx , fx. triple ( ) , & fn_abi) ;
423
+ let sig = clif_sig_from_fn_abi ( fx. tcx , fx. target_config . default_call_conv , & fn_abi) ;
424
424
let sig = fx. bcx . import_signature ( sig) ;
425
425
426
426
( CallTarget :: Indirect ( sig, method) , Some ( ptr) )
@@ -440,7 +440,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
440
440
}
441
441
442
442
let func = codegen_operand ( fx, func) . load_scalar ( fx) ;
443
- let sig = clif_sig_from_fn_abi ( fx. tcx , fx. triple ( ) , & fn_abi) ;
443
+ let sig = clif_sig_from_fn_abi ( fx. tcx , fx. target_config . default_call_conv , & fn_abi) ;
444
444
let sig = fx. bcx . import_signature ( sig) ;
445
445
446
446
( CallTarget :: Indirect ( sig, func) , None )
@@ -531,7 +531,7 @@ pub(crate) fn codegen_drop<'tcx>(
531
531
let fn_abi =
532
532
RevealAllLayoutCx ( fx. tcx ) . fn_abi_of_instance ( virtual_drop, ty:: List :: empty ( ) ) ;
533
533
534
- let sig = clif_sig_from_fn_abi ( fx. tcx , fx. triple ( ) , & fn_abi) ;
534
+ let sig = clif_sig_from_fn_abi ( fx. tcx , fx. target_config . default_call_conv , & fn_abi) ;
535
535
let sig = fx. bcx . import_signature ( sig) ;
536
536
fx. bcx . ins ( ) . call_indirect ( sig, drop_fn, & [ ptr] ) ;
537
537
}
0 commit comments