forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathboxes.main.GVN.panic-unwind.diff
59 lines (53 loc) · 1.58 KB
/
boxes.main.GVN.panic-unwind.diff
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
- // MIR for `main` before GVN
+ // MIR for `main` after GVN
fn main() -> () {
let mut _0: ();
let _1: i32;
let mut _2: i32;
let mut _3: std::boxed::Box<i32>;
let mut _4: usize;
let mut _5: usize;
let mut _6: *mut u8;
let mut _7: std::boxed::Box<i32>;
let mut _8: *const i32;
let mut _9: *const i32;
scope 1 {
debug x => _1;
}
bb0: {
StorageLive(_1);
- StorageLive(_2);
+ nop;
StorageLive(_3);
- _4 = SizeOf(i32);
- _5 = AlignOf(i32);
- _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> [return: bb1, unwind continue];
+ _4 = const 4_usize;
+ _5 = const 4_usize;
+ _6 = alloc::alloc::exchange_malloc(const 4_usize, const 4_usize) -> [return: bb1, unwind continue];
}
bb1: {
StorageLive(_7);
_7 = ShallowInitBox(move _6, i32);
_8 = copy ((_7.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>) as *const i32 (Transmute);
(*_8) = const 42_i32;
_3 = move _7;
StorageDead(_7);
_9 = copy ((_3.0: std::ptr::Unique<i32>).0: std::ptr::NonNull<i32>) as *const i32 (Transmute);
_2 = copy (*_9);
- _1 = Add(move _2, const 0_i32);
- StorageDead(_2);
+ _1 = copy _2;
+ nop;
drop(_3) -> [return: bb2, unwind: bb3];
}
bb2: {
StorageDead(_3);
_0 = const ();
StorageDead(_1);
return;
}
bb3 (cleanup): {
resume;
}
}