forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbox_expr.main.ElaborateDrops.before.mir
80 lines (69 loc) · 4.33 KB
/
box_expr.main.ElaborateDrops.before.mir
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// MIR for `main` before ElaborateDrops
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/box_expr.rs:6:11: 6:11
let _1: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:9: 7:10
let mut _2: usize; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _3: usize; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _4: *mut u8; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let mut _5: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:7:13: 7:25
let _6: (); // in scope 0 at $DIR/box_expr.rs:8:5: 8:12
let mut _7: std::boxed::Box<S>; // in scope 0 at $DIR/box_expr.rs:8:10: 8:11
scope 1 {
debug x => _1; // in scope 1 at $DIR/box_expr.rs:7:9: 7:10
}
scope 2 {
}
bb0: { // preds: []
StorageLive(_1); // scope 0 at $DIR/box_expr.rs:7:9: 7:10
_2 = SizeOf(S); // scope 2 at $DIR/box_expr.rs:7:13: 7:25
_3 = AlignOf(S); // scope 2 at $DIR/box_expr.rs:7:13: 7:25
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 2 at $DIR/box_expr.rs:7:13: 7:25
// mir::Constant
// + span: $DIR/box_expr.rs:7:13: 7:25
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(Scalar(<ZST>)) }
}
bb1: { // preds: [bb0]
StorageLive(_5); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
_5 = ShallowInitBox(move _4, S); // scope 0 at $DIR/box_expr.rs:7:13: 7:25
(*_5) = S::new() -> [return: bb2, unwind: bb8]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
// mir::Constant
// + span: $DIR/box_expr.rs:7:17: 7:23
// + literal: Const { ty: fn() -> S {S::new}, val: Value(Scalar(<ZST>)) }
}
bb2: { // preds: [bb1]
_1 = move _5; // scope 0 at $DIR/box_expr.rs:7:13: 7:25
drop(_5) -> bb3; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}
bb3: { // preds: [bb2]
StorageDead(_5); // scope 0 at $DIR/box_expr.rs:7:24: 7:25
StorageLive(_6); // scope 1 at $DIR/box_expr.rs:8:5: 8:12
StorageLive(_7); // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_7 = move _1; // scope 1 at $DIR/box_expr.rs:8:10: 8:11
_6 = std::mem::drop::<Box<S>>(move _7) -> [return: bb4, unwind: bb6]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
// mir::Constant
// + span: $DIR/box_expr.rs:8:5: 8:9
// + literal: Const { ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}, val: Value(Scalar(<ZST>)) }
}
bb4: { // preds: [bb3]
StorageDead(_7); // scope 1 at $DIR/box_expr.rs:8:11: 8:12
StorageDead(_6); // scope 1 at $DIR/box_expr.rs:8:12: 8:13
_0 = const (); // scope 0 at $DIR/box_expr.rs:6:11: 9:2
drop(_1) -> bb5; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}
bb5: { // preds: [bb4]
StorageDead(_1); // scope 0 at $DIR/box_expr.rs:9:1: 9:2
return; // scope 0 at $DIR/box_expr.rs:9:2: 9:2
}
bb6 (cleanup): { // preds: [bb3]
drop(_7) -> bb7; // scope 1 at $DIR/box_expr.rs:8:11: 8:12
}
bb7 (cleanup): { // preds: [bb6]
drop(_1) -> bb9; // scope 0 at $DIR/box_expr.rs:9:1: 9:2
}
bb8 (cleanup): { // preds: [bb1]
drop(_5) -> bb9; // scope 0 at $DIR/box_expr.rs:7:24: 7:25
}
bb9 (cleanup): { // preds: [bb7, bb8]
resume; // scope 0 at $DIR/box_expr.rs:6:1: 9:2
}
}