Add const_eval_select intrinsic

This commit is contained in:
Deadbeef 2021-10-12 05:06:37 +00:00
parent 2228c49544
commit 0134088cd2
2 changed files with 3 additions and 5 deletions

View File

@ -309,13 +309,13 @@ pub(crate) fn codegen_terminator_call<'tcx>(
span: Span,
func: &Operand<'tcx>,
args: &[Operand<'tcx>],
destination: Option<(Place<'tcx>, BasicBlock)>,
mir_dest: Option<(Place<'tcx>, BasicBlock)>,
) {
let fn_ty = fx.monomorphize(func.ty(fx.mir, fx.tcx));
let fn_sig =
fx.tcx.normalize_erasing_late_bound_regions(ParamEnv::reveal_all(), fn_ty.fn_sig(fx.tcx));
let destination = destination.map(|(place, bb)| (codegen_place(fx, place), bb));
let destination = mir_dest.map(|(place, bb)| (codegen_place(fx, place), bb));
// Handle special calls like instrinsics and empty drop glue.
let instance = if let ty::FnDef(def_id, substs) = *fn_ty.kind() {

View File

@ -407,11 +407,9 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
destination: Option<(CPlace<'tcx>, BasicBlock)>,
span: Span,
) {
let def_id = instance.def_id();
let intrinsic = fx.tcx.item_name(instance.def_id());
let substs = instance.substs;
let intrinsic = fx.tcx.item_name(def_id);
let ret = match destination {
Some((place, _)) => place,
None => {