Skip to content

Commit c5aaa8c

Browse files
committed
Revert "debuginfo: Create debuginfo for for-loop variables again."
This reverts commit b048114.
1 parent 8e2d952 commit c5aaa8c

File tree

3 files changed

+1
-40
lines changed

3 files changed

+1
-40
lines changed

src/librustc_trans/trans/controlflow.rs

-3
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ pub fn trans_for<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
286286
debug!("iterator type is {}, datum type is {}",
287287
ppaux::ty_to_string(bcx.tcx(), iterator_type),
288288
ppaux::ty_to_string(bcx.tcx(), iterator_datum.ty));
289-
290289
let lliterator = load_ty(bcx, iterator_datum.val, iterator_datum.ty);
291290

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

369-
debuginfo::create_for_loop_var_metadata(body_bcx_in, pat);
370-
371368
// Codegen the body.
372369
body_bcx_out = trans_block(body_bcx_out, body, expr::Ignore);
373370
body_bcx_out =

src/librustc_trans/trans/debuginfo.rs

-37
Original file line numberDiff line numberDiff line change
@@ -1049,43 +1049,6 @@ pub fn create_argument_metadata(bcx: Block, arg: &ast::Arg) {
10491049
})
10501050
}
10511051

1052-
/// Creates debug information for the given for-loop variable.
1053-
///
1054-
/// Adds the created metadata nodes directly to the crate's IR.
1055-
pub fn create_for_loop_var_metadata(bcx: Block, pat: &ast::Pat) {
1056-
if fn_should_be_ignored(bcx.fcx) {
1057-
return;
1058-
}
1059-
1060-
let def_map = &bcx.tcx().def_map;
1061-
1062-
pat_util::pat_bindings(def_map, pat, |_, node_id, span, spanned_ident| {
1063-
let datum = match bcx.fcx.lllocals.borrow().get(&node_id).cloned() {
1064-
Some(datum) => datum,
1065-
None => {
1066-
bcx.sess().span_bug(span,
1067-
format!("no entry in lllocals table for {}",
1068-
node_id).as_slice());
1069-
}
1070-
};
1071-
1072-
if unsafe { llvm::LLVMIsAAllocaInst(datum.val) } == ptr::null_mut() {
1073-
bcx.sess().span_bug(span, "debuginfo::create_for_loop_var_metadata() - \
1074-
Referenced variable location is not an alloca!");
1075-
}
1076-
1077-
let scope_metadata = scope_metadata(bcx.fcx, node_id, span);
1078-
1079-
declare_local(bcx,
1080-
spanned_ident.node,
1081-
datum.ty,
1082-
scope_metadata,
1083-
DirectVariable { alloca: datum.val },
1084-
LocalVariable,
1085-
span);
1086-
})
1087-
}
1088-
10891052
pub fn get_cleanup_debug_loc_for_ast_node<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
10901053
node_id: ast::NodeId,
10911054
node_span: Span,

src/test/debuginfo/lexical-scope-in-for-loop.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

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

1415
// compile-flags:-g

0 commit comments

Comments
 (0)