Small change
This commit is contained in:
parent
16593d264c
commit
deeae2fce4
@ -49,12 +49,7 @@ fn clif_sig_from_fn_sig<'tcx>(tcx: TyCtxt<'tcx>, sig: FnSig<'tcx>, is_vtable_fn:
|
||||
// See https://github.com/rust-lang/rust/blob/37b6a5e5e82497caf5353d9d856e4eb5d14cbe06/src/librustc/ty/layout.rs#L2519-L2572 for more info
|
||||
layout = tcx.layout_of(ParamEnv::reveal_all().and(tcx.mk_mut_ptr(tcx.mk_unit()))).unwrap();
|
||||
}
|
||||
match get_pass_mode(tcx, layout) {
|
||||
PassMode::NoPass => Empty,
|
||||
PassMode::ByVal(clif_ty) => Single(clif_ty),
|
||||
PassMode::ByValPair(clif_ty_a, clif_ty_b) => Pair(clif_ty_a, clif_ty_b),
|
||||
PassMode::ByRef => Single(pointer_ty(tcx)),
|
||||
}.into_iter()
|
||||
get_pass_mode(tcx, layout).get_param_ty(tcx).into_iter()
|
||||
}).flatten();
|
||||
|
||||
let (params, returns) = match get_pass_mode(tcx, tcx.layout_of(ParamEnv::reveal_all().and(output)).unwrap()) {
|
||||
|
@ -65,12 +65,12 @@ pub fn assert_pair(self) -> (T, T) {
|
||||
pub use EmptySinglePair::*;
|
||||
|
||||
impl PassMode {
|
||||
pub fn get_param_ty(self, fx: &FunctionCx<impl Backend>) -> EmptySinglePair<Type> {
|
||||
pub fn get_param_ty(self, tcx: TyCtxt<'_>) -> EmptySinglePair<Type> {
|
||||
match self {
|
||||
PassMode::NoPass => Empty,
|
||||
PassMode::ByVal(clif_type) => Single(clif_type),
|
||||
PassMode::ByValPair(a, b) => Pair(a, b),
|
||||
PassMode::ByRef => Single(fx.pointer_type),
|
||||
PassMode::ByRef => Single(pointer_ty(tcx)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -141,7 +141,7 @@ pub fn cvalue_for_param<'tcx>(
|
||||
return None;
|
||||
}
|
||||
|
||||
let clif_types = pass_mode.get_param_ty(fx);
|
||||
let clif_types = pass_mode.get_param_ty(fx.tcx);
|
||||
let ebb_params = clif_types.map(|t| fx.bcx.append_ebb_param(start_ebb, t));
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
|
Loading…
Reference in New Issue
Block a user