add overflow_checks intrinsic

This commit is contained in:
Peter Jaszkowiak 2024-08-03 22:57:10 -06:00
parent 2e5d395f2b
commit cc8b95cc54
12 changed files with 81 additions and 10 deletions

View file

@ -1033,6 +1033,8 @@ pub enum RuntimeChecks {
UbChecks,
/// cfg!(contract_checks), but at codegen time
ContractChecks,
/// cfg!(overflow_checks), but at codegen time
OverflowChecks,
}
impl Operand {

View file

@ -330,6 +330,7 @@ impl<'tcx> Stable<'tcx> for mir::NullOp<'tcx> {
RuntimeChecks(op) => crate::mir::NullOp::RuntimeChecks(match op {
UbChecks => crate::mir::RuntimeChecks::UbChecks,
ContractChecks => crate::mir::RuntimeChecks::ContractChecks,
OverflowChecks => crate::mir::RuntimeChecks::OverflowChecks,
}),
}
}