debuginfo: argument and upvar names for MIR.

This commit is contained in:
Eduard Burtescu 2016-04-16 21:51:26 +03:00
parent 7fd2881ed4
commit f06bab7758
9 changed files with 176 additions and 58 deletions

View file

@ -251,7 +251,7 @@
#![omit_gdb_pretty_printer_section]
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn immediate_args(a: isize, b: bool, c: f64) {
println!("");
}
@ -268,51 +268,51 @@ struct BigStruct {
}
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn non_immediate_args(a: BigStruct, b: BigStruct) {
println!("");
}
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn binding(a: i64, b: u64, c: f64) {
let x = 0;
println!("");
}
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn assignment(mut a: u64, b: u64, c: f64) {
a = b;
println!("");
}
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn function_call(x: u64, y: u64, z: f64) {
println!("Hi!")
}
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn identifier(x: u64, y: u64, z: f64) -> u64 {
x
}
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn return_expr(x: u64, y: u64, z: f64) -> u64 {
return x;
}
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
x + y
}
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn if_expr(x: u64, y: u64, z: f64) -> u64 {
if x + y < 1000 {
x
@ -322,7 +322,7 @@ fn if_expr(x: u64, y: u64, z: f64) -> u64 {
}
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
while x + y < 1000 {
x += z
@ -331,7 +331,7 @@ fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
}
#[no_stack_check]
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing argument names.
#[rustc_no_mir] // FIXME(#32949) MIR debuginfo shadows arguments with uninit vars.
fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
loop {
x += z;

View file

@ -78,7 +78,7 @@
// lldb-command:continue
#![allow(unused_variables)]
#![feature(box_syntax, rustc_attrs, stmt_expr_attributes)]
#![feature(box_syntax)]
#![feature(omit_gdb_pretty_printer_section)]
#![omit_gdb_pretty_printer_section]
@ -88,7 +88,6 @@ struct Struct {
c: usize
}
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
fn main() {
let mut variable = 1;
let constant = 2;
@ -102,14 +101,10 @@ fn main() {
let struct_ref = &a_struct;
let owned: Box<_> = box 6;
let mut closure =
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
|| {
let mut closure = || {
let closure_local = 8;
let mut nested_closure =
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
|| {
let mut nested_closure = || {
zzz(); // #break
variable = constant + a_struct.a + struct_ref.a + *owned + closure_local;
};

View file

@ -40,7 +40,7 @@
// lldb-check:[...]$2 = 5
#![allow(unused_variables)]
#![feature(unboxed_closures, box_syntax, rustc_attrs, stmt_expr_attributes)]
#![feature(unboxed_closures, box_syntax)]
#![feature(omit_gdb_pretty_printer_section)]
#![omit_gdb_pretty_printer_section]
@ -50,7 +50,6 @@ struct Struct {
c: usize
}
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
fn main() {
let constant = 1;
@ -62,9 +61,7 @@ fn main() {
let owned: Box<_> = box 5;
let closure =
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
move || {
let closure = move || {
zzz(); // #break
do_something(&constant, &a_struct.a, &*owned);
};
@ -76,9 +73,7 @@ fn main() {
// The `self` argument of the following closure should be passed by value
// to FnOnce::call_once(self, args), which gets translated a bit differently
// than the regular case. Let's make sure this is supported too.
let immedate_env =
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
move || {
let immedate_env = move || {
zzz(); // #break
return constant2;
};

View file

@ -69,7 +69,7 @@
// lldb-command:print *owned
// lldb-check:[...]$9 = 6
#![feature(unboxed_closures, box_syntax, rustc_attrs, stmt_expr_attributes)]
#![feature(unboxed_closures, box_syntax)]
#![allow(unused_variables)]
#![feature(omit_gdb_pretty_printer_section)]
#![omit_gdb_pretty_printer_section]
@ -80,7 +80,6 @@ struct Struct {
c: usize
}
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
fn main() {
let mut variable = 1;
let constant = 2;
@ -95,9 +94,7 @@ fn main() {
let owned: Box<_> = box 6;
{
let mut first_closure =
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
|| {
let mut first_closure = || {
zzz(); // #break
variable = constant + a_struct.a + struct_ref.a + *owned;
};
@ -106,9 +103,7 @@ fn main() {
}
{
let mut second_closure =
#[rustc_no_mir] // FIXME(#31005) MIR debuginfo is missing captures.
|| {
let mut second_closure = || {
zzz(); // #break
variable = constant + a_struct.a + struct_ref.a + *owned;
};