rollup merge of #21197: michaelwoerister/linestablesonly-forloop

Fixes #21067.
This commit is contained in:
Alex Crichton 2015-01-15 14:12:06 -08:00
commit 6dc94f744e
5 changed files with 28 additions and 32 deletions

View file

@ -856,16 +856,9 @@ fn insert_lllocals<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
bcx.fcx.schedule_lifetime_end(cs, binding_info.llmatch);
}
debug!("binding {} to {}",
binding_info.id,
bcx.val_to_string(llval));
debug!("binding {} to {}", binding_info.id, bcx.val_to_string(llval));
bcx.fcx.lllocals.borrow_mut().insert(binding_info.id, datum);
if bcx.sess().opts.debuginfo == FullDebugInfo {
debuginfo::create_match_binding_metadata(bcx,
ident,
binding_info);
}
debuginfo::create_match_binding_metadata(bcx, ident, binding_info);
}
bcx
}

View file

@ -44,7 +44,7 @@ use middle::subst;
use middle::weak_lang_items;
use middle::subst::{Subst, Substs};
use middle::ty::{self, Ty, UnboxedClosureTyper};
use session::config::{self, NoDebugInfo, FullDebugInfo};
use session::config::{self, NoDebugInfo};
use session::Session;
use trans::_match;
use trans::adt;
@ -1617,9 +1617,8 @@ fn create_datums_for_fn_args_under_call_abi<'blk, 'tcx>(
result
}
fn copy_args_to_allocas<'blk, 'tcx>(fcx: &FunctionContext<'blk, 'tcx>,
fn copy_args_to_allocas<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
arg_scope: cleanup::CustomScopeIndex,
bcx: Block<'blk, 'tcx>,
args: &[ast::Arg],
arg_datums: Vec<RvalueDatum<'tcx>>)
-> Block<'blk, 'tcx> {
@ -1640,10 +1639,7 @@ fn copy_args_to_allocas<'blk, 'tcx>(fcx: &FunctionContext<'blk, 'tcx>,
// the event it's not truly needed.
bcx = _match::store_arg(bcx, &*args[i].pat, arg_datum, arg_scope_id);
if fcx.ccx.sess().opts.debuginfo == FullDebugInfo {
debuginfo::create_argument_metadata(bcx, &args[i]);
}
debuginfo::create_argument_metadata(bcx, &args[i]);
}
bcx
@ -1693,9 +1689,7 @@ fn copy_unboxed_closure_args_to_allocas<'blk, 'tcx>(
tuple_element_datum,
arg_scope_id);
if bcx.fcx.ccx.sess().opts.debuginfo == FullDebugInfo {
debuginfo::create_argument_metadata(bcx, &args[j]);
}
debuginfo::create_argument_metadata(bcx, &args[j]);
}
bcx
@ -1868,9 +1862,8 @@ pub fn trans_closure<'a, 'b, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
bcx = match closure_env.kind {
closure::NotClosure | closure::BoxedClosure(..) => {
copy_args_to_allocas(&fcx,
copy_args_to_allocas(bcx,
arg_scope,
bcx,
&decl.inputs[],
arg_datums)
}

View file

@ -28,7 +28,6 @@ use trans::type_::Type;
use trans;
use middle::ty;
use middle::ty::MethodCall;
use session::config::FullDebugInfo;
use util::ppaux::Repr;
use util::ppaux;
@ -66,10 +65,7 @@ pub fn trans_stmt<'blk, 'tcx>(cx: Block<'blk, 'tcx>,
match d.node {
ast::DeclLocal(ref local) => {
bcx = init_local(bcx, &**local);
if cx.sess().opts.debuginfo == FullDebugInfo {
trans::debuginfo::create_local_var_metadata(bcx,
&**local);
}
debuginfo::create_local_var_metadata(bcx, &**local);
}
// Inner items are visited by `trans_item`/`trans_meth`.
ast::DeclItem(_) => {},

View file

@ -854,7 +854,9 @@ pub fn create_global_var_metadata(cx: &CrateContext,
/// local in `bcx.fcx.lllocals`.
/// Adds the created metadata nodes directly to the crate's IR.
pub fn create_local_var_metadata(bcx: Block, local: &ast::Local) {
if bcx.unreachable.get() || fn_should_be_ignored(bcx.fcx) {
if bcx.unreachable.get() ||
fn_should_be_ignored(bcx.fcx) ||
bcx.sess().opts.debuginfo != FullDebugInfo {
return;
}
@ -898,7 +900,9 @@ pub fn create_captured_var_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
env_index: uint,
captured_by_ref: bool,
span: Span) {
if bcx.unreachable.get() || fn_should_be_ignored(bcx.fcx) {
if bcx.unreachable.get() ||
fn_should_be_ignored(bcx.fcx) ||
bcx.sess().opts.debuginfo != FullDebugInfo {
return;
}
@ -981,7 +985,9 @@ pub fn create_captured_var_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
pub fn create_match_binding_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
variable_ident: ast::Ident,
binding: BindingInfo<'tcx>) {
if bcx.unreachable.get() || fn_should_be_ignored(bcx.fcx) {
if bcx.unreachable.get() ||
fn_should_be_ignored(bcx.fcx) ||
bcx.sess().opts.debuginfo != FullDebugInfo {
return;
}
@ -1021,7 +1027,9 @@ pub fn create_match_binding_metadata<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
/// argument in `bcx.fcx.lllocals`.
/// Adds the created metadata nodes directly to the crate's IR.
pub fn create_argument_metadata(bcx: Block, arg: &ast::Arg) {
if bcx.unreachable.get() || fn_should_be_ignored(bcx.fcx) {
if bcx.unreachable.get() ||
fn_should_be_ignored(bcx.fcx) ||
bcx.sess().opts.debuginfo != FullDebugInfo {
return;
}
@ -1075,7 +1083,9 @@ pub fn create_argument_metadata(bcx: Block, arg: &ast::Arg) {
/// loop variable in `bcx.fcx.lllocals`.
/// Adds the created metadata nodes directly to the crate's IR.
pub fn create_for_loop_var_metadata(bcx: Block, pat: &ast::Pat) {
if bcx.unreachable.get() || fn_should_be_ignored(bcx.fcx) {
if bcx.unreachable.get() ||
fn_should_be_ignored(bcx.fcx) ||
bcx.sess().opts.debuginfo != FullDebugInfo {
return;
}

View file

@ -48,7 +48,11 @@ fn zzz() {()}
fn some_function(a: int, b: int) {
let some_variable = Struct { a: 11, b: 22 };
let some_other_variable = 23i;
zzz(); // #break
for x in range(0, 1) {
zzz(); // #break
}
}
fn some_other_function(a: int, b: int) -> bool { true }