1
Fork 0

Add rustc_mir::interpret::Machine::enforce_abi()

This commit is contained in:
hyd-dev 2021-05-21 22:19:37 +08:00
parent f36b137074
commit c69fba929b
No known key found for this signature in database
GPG key ID: 74FA7FD5B8DA14B8
2 changed files with 29 additions and 19 deletions

View file

@ -132,6 +132,9 @@ pub trait Machine<'mir, 'tcx>: Sized {
/// Whether to enforce the validity invariant
fn enforce_validity(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
/// Whether function calls should be [ABI](Abi)-checked.
fn enforce_abi(ecx: &InterpCx<'mir, 'tcx, Self>) -> bool;
/// Entry point for obtaining the MIR of anything that should get evaluated.
/// So not just functions and shims, but also const/static initializers, anonymous
/// constants, ...
@ -444,6 +447,11 @@ pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) {
false // for now, we don't enforce validity
}
#[inline(always)]
fn enforce_abi(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
true
}
#[inline(always)]
fn call_extra_fn(
_ecx: &mut InterpCx<$mir, $tcx, Self>,