summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/ptr_offset.demo_byte_add_fat.PreCodegen.after.panic-unwind.mir
blob: db0c84bd560fd72a93131b4b2c9853fee0fac981 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// MIR for `demo_byte_add_fat` after PreCodegen

fn demo_byte_add_fat(_1: *const [u32], _2: usize) -> *const [u32] {
    debug p => _1;
    debug n => _2;
    let mut _0: *const [u32];
    scope 1 (inlined std::ptr::const_ptr::<impl *const [u32]>::byte_add) {
        let mut _3: *const u8;
        let mut _4: *const u8;
        scope 2 (inlined std::ptr::const_ptr::<impl *const [u32]>::cast::<u8>) {
        }
        scope 3 (inlined std::ptr::const_ptr::<impl *const u8>::add) {
        }
        scope 4 (inlined std::ptr::const_ptr::<impl *const u8>::with_metadata_of::<[u32]>) {
            let mut _5: *const ();
            let mut _7: usize;
            scope 5 (inlined std::ptr::metadata::<[u32]>) {
                let mut _6: std::ptr::metadata::PtrRepr<[u32]>;
            }
            scope 6 (inlined std::ptr::from_raw_parts::<[u32]>) {
            }
        }
    }

    bb0: {
        StorageLive(_4);
        StorageLive(_3);
        _3 = _1 as *const u8 (PtrToPtr);
        _4 = Offset(_3, _2);
        StorageDead(_3);
        StorageLive(_5);
        _5 = _4 as *const () (PtrToPtr);
        StorageLive(_7);
        StorageLive(_6);
        _6 = std::ptr::metadata::PtrRepr::<[u32]> { const_ptr: _1 };
        _7 = ((_6.2: std::ptr::metadata::PtrComponents<[u32]>).1: usize);
        StorageDead(_6);
        _0 = *const [u32] from (_5, _7);
        StorageDead(_7);
        StorageDead(_5);
        StorageDead(_4);
        return;
    }
}