1
Fork 0

deduplicate a lot of code

This commit is contained in:
b-naber 2022-04-21 19:35:06 +02:00
parent 28af967bb9
commit bc698c73e9
6 changed files with 119 additions and 244 deletions

View file

@ -98,7 +98,7 @@ impl<'tcx, Tag: Provenance> Immediate<Tag> {
// as input for binary and cast operations.
#[derive(Copy, Clone, Debug)]
pub struct ImmTy<'tcx, Tag: Provenance = AllocId> {
pub imm: Immediate<Tag>,
imm: Immediate<Tag>,
pub layout: TyAndLayout<'tcx>,
}
@ -248,7 +248,7 @@ impl<'tcx, Tag: Provenance> ImmTy<'tcx, Tag> {
impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
/// Try reading an immediate in memory; this is interesting particularly for `ScalarPair`.
/// Returns `None` if the layout does not permit loading this as a value.
pub(crate) fn try_read_immediate_from_mplace(
fn try_read_immediate_from_mplace(
&self,
mplace: &MPlaceTy<'tcx, M::PointerTag>,
) -> InterpResult<'tcx, Option<ImmTy<'tcx, M::PointerTag>>> {