diff options
| author | bors <bors@rust-lang.org> | 2016-02-15 14:57:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-02-15 14:57:44 +0000 |
| commit | 7ce4afbddaa2e58378d8a61a4f6f96dc53acd956 (patch) | |
| tree | 1826a0c33403e19f9f1909019ece1d2c34a0c4fa /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 3a254fe4bd10f630da76e89cbdc1275413a189d8 (diff) | |
| parent | 67aa7b2389a6dcea97d3d5f05fe3be8ece3acc6c (diff) | |
| download | rust-7ce4afbddaa2e58378d8a61a4f6f96dc53acd956.tar.gz rust-7ce4afbddaa2e58378d8a61a4f6f96dc53acd956.zip | |
Auto merge of #31656 - jonas-schievink:mirdump, r=nrc
This allows obtaining a textual MIR dump for individual items or all items in the crate.
I haven't added any tests since ~~I'm too lazy~~ this is an unstable debugging option, but I'll add one if required.
MIR for a single function can now be dumped using `rustc -Zunstable-options --unpretty mir=my_function` and no longer requires the use of in-source `#[rustc_mir]` attributes.
Blocks rust-lang/rust-playpen#154 (if MIR dump support from the playpen is even wanted).
Example output:
```rust
fn main() {
let x = Some(0);
x.unwrap_or_else(|| 1);
}
```
```
MIR for expr || 1 (id=16)
fn(arg0: [closure@test.rs:3:22: 3:26]) -> i32 {
let mut tmp0: ();
bb0: {
return = const 1;
goto -> bb1;
}
bb1: {
return;
}
}
MIR for fn main::main (id=4)
fn() -> () {
let var0: core::option::Option<i32>; // x
let mut tmp0: ();
let mut tmp1: i32;
let mut tmp2: core::option::Option<i32>;
let mut tmp3: [closure@test.rs:3:22: 3:26];
bb0: {
var0 = core::option::Option::Some(const 0);
tmp2 = var0;
tmp3 = [closure@test.rs:3:22: 3:26];
tmp1 = core::option::Option<T>::unwrap_or_else(tmp2, tmp3) -> bb2;
}
bb1: {
return;
}
bb2: {
drop(tmp1) -> bb3;
}
bb3: {
return = ();
goto -> bb1;
}
}
```
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
