Skip to content

Commit 54ba238

Browse files
committed
Remove implementation of intrinsics that are now lowered
See #80040
1 parent 32f92aa commit 54ba238

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

src/intrinsics/mod.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,6 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
444444
"abort" => {
445445
trap_abort(fx, "Called intrinsic::abort.");
446446
}
447-
"unreachable" => {
448-
trap_unreachable(fx, "[corruption] Called intrinsic::unreachable.");
449-
}
450447
"transmute" => {
451448
crate::base::codegen_panic(fx, "Transmuting to uninhabited type.", span);
452449
}
@@ -559,12 +556,6 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
559556
fx.bcx.call_memmove(fx.cx.module.target_config(), dst, src, byte_amount);
560557
}
561558
};
562-
discriminant_value, (c ptr) {
563-
let pointee_layout = fx.layout_of(ptr.layout().ty.builtin_deref(true).unwrap().ty);
564-
let val = CValue::by_ref(Pointer::new(ptr.load_scalar(fx)), pointee_layout);
565-
let discr = crate::discriminant::codegen_get_discriminant(fx, val, ret.layout());
566-
ret.write_cvalue(fx, discr);
567-
};
568559
size_of_val, <T> (c ptr) {
569560
let layout = fx.layout_of(T);
570561
let size = if layout.is_unsized() {
@@ -625,22 +616,6 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
625616
);
626617
ret.write_cvalue(fx, res);
627618
};
628-
_ if intrinsic.starts_with("wrapping_"), (c x, c y) {
629-
assert_eq!(x.layout().ty, y.layout().ty);
630-
let bin_op = match intrinsic {
631-
"wrapping_add" => BinOp::Add,
632-
"wrapping_sub" => BinOp::Sub,
633-
"wrapping_mul" => BinOp::Mul,
634-
_ => unreachable!("intrinsic {}", intrinsic),
635-
};
636-
let res = crate::num::codegen_int_binop(
637-
fx,
638-
bin_op,
639-
x,
640-
y,
641-
);
642-
ret.write_cvalue(fx, res);
643-
};
644619
_ if intrinsic.starts_with("saturating_"), <T> (c lhs, c rhs) {
645620
assert_eq!(lhs.layout().ty, rhs.layout().ty);
646621
let bin_op = match intrinsic {
@@ -900,7 +875,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
900875
dest.write_cvalue(fx, val);
901876
};
902877

903-
size_of | pref_align_of | min_align_of | needs_drop | type_id | type_name | variant_count, () {
878+
pref_align_of | min_align_of | needs_drop | type_id | type_name | variant_count, () {
904879
let const_val =
905880
fx.tcx.const_eval_instance(ParamEnv::reveal_all(), instance, None).unwrap();
906881
let val = crate::constant::codegen_const_value(

0 commit comments

Comments
 (0)