Skip to content

Commit

Permalink
Revert "debuginfo: Create debuginfo for for-loop variables again."
Browse files Browse the repository at this point in the history
This reverts commit b048114.
  • Loading branch information
alexcrichton committed Dec 22, 2014
1 parent 8e2d952 commit c5aaa8c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 40 deletions.
3 changes: 0 additions & 3 deletions src/librustc_trans/trans/controlflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ pub fn trans_for<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
debug!("iterator type is {}, datum type is {}",
ppaux::ty_to_string(bcx.tcx(), iterator_type),
ppaux::ty_to_string(bcx.tcx(), iterator_datum.ty));

let lliterator = load_ty(bcx, iterator_datum.val, iterator_datum.ty);

// Create our basic blocks and set up our loop cleanups.
Expand Down Expand Up @@ -366,8 +365,6 @@ pub fn trans_for<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
llpayload,
binding_cleanup_scope_id);

debuginfo::create_for_loop_var_metadata(body_bcx_in, pat);

// Codegen the body.
body_bcx_out = trans_block(body_bcx_out, body, expr::Ignore);
body_bcx_out =
Expand Down
37 changes: 0 additions & 37 deletions src/librustc_trans/trans/debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1049,43 +1049,6 @@ pub fn create_argument_metadata(bcx: Block, arg: &ast::Arg) {
})
}

/// Creates debug information for the given for-loop variable.
///
/// Adds the created metadata nodes directly to the crate's IR.
pub fn create_for_loop_var_metadata(bcx: Block, pat: &ast::Pat) {
if fn_should_be_ignored(bcx.fcx) {
return;
}

let def_map = &bcx.tcx().def_map;

pat_util::pat_bindings(def_map, pat, |_, node_id, span, spanned_ident| {
let datum = match bcx.fcx.lllocals.borrow().get(&node_id).cloned() {
Some(datum) => datum,
None => {
bcx.sess().span_bug(span,
format!("no entry in lllocals table for {}",
node_id).as_slice());
}
};

if unsafe { llvm::LLVMIsAAllocaInst(datum.val) } == ptr::null_mut() {
bcx.sess().span_bug(span, "debuginfo::create_for_loop_var_metadata() - \
Referenced variable location is not an alloca!");
}

let scope_metadata = scope_metadata(bcx.fcx, node_id, span);

declare_local(bcx,
spanned_ident.node,
datum.ty,
scope_metadata,
DirectVariable { alloca: datum.val },
LocalVariable,
span);
})
}

pub fn get_cleanup_debug_loc_for_ast_node<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
node_id: ast::NodeId,
node_span: Span,
Expand Down
1 change: 1 addition & 0 deletions src/test/debuginfo/lexical-scope-in-for-loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// except according to those terms.

// ignore-android: FIXME(#10381)
// ignore-test: Not sure what is going on here --pcwalton
// min-lldb-version: 310

// compile-flags:-g
Expand Down

7 comments on commit c5aaa8c

@bors
Copy link
Contributor

@bors bors commented on c5aaa8c Dec 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from sfackler
at alexcrichton@c5aaa8c

@bors
Copy link
Contributor

@bors bors commented on c5aaa8c Dec 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging alexcrichton/rust/revert-20027 = c5aaa8c into auto

@bors
Copy link
Contributor

@bors bors commented on c5aaa8c Dec 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status: {"merge_sha": "2f3cff6956d56048ef7afb6d33e17cbdb2dcf038"}

@bors
Copy link
Contributor

@bors bors commented on c5aaa8c Dec 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexcrichton/rust/revert-20027 = c5aaa8c merged ok, testing candidate = 2f3cff6

@bors
Copy link
Contributor

@bors bors commented on c5aaa8c Dec 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 2f3cff6

@bors
Copy link
Contributor

@bors bors commented on c5aaa8c Dec 22, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 2f3cff6

Please sign in to comment.