Skip to content

Commit a8ceab9

Browse files
committed
rustc_codegen_llvm: remove debuginfo::VariableKind::CapturedVariable.
1 parent 98686ca commit a8ceab9

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/librustc_codegen_llvm/debuginfo/mod.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ pub enum VariableAccess<'a> {
147147
pub enum VariableKind {
148148
ArgumentVariable(usize /*index*/),
149149
LocalVariable,
150-
CapturedVariable,
151150
}
152151

153152
/// Create any deferred debug metadata nodes
@@ -478,6 +477,7 @@ pub fn declare_local<'a, 'tcx>(bx: &Builder<'a, 'tcx>,
478477
variable_access: VariableAccess,
479478
variable_kind: VariableKind,
480479
span: Span) {
480+
assert!(!dbg_context.get_ref(span).source_locations_enabled.get());
481481
let cx = bx.cx;
482482

483483
let file = span_start(cx, span).file;
@@ -490,8 +490,7 @@ pub fn declare_local<'a, 'tcx>(bx: &Builder<'a, 'tcx>,
490490

491491
let (argument_index, dwarf_tag) = match variable_kind {
492492
ArgumentVariable(index) => (index as c_uint, DW_TAG_arg_variable),
493-
LocalVariable |
494-
CapturedVariable => (0, DW_TAG_auto_variable)
493+
LocalVariable => (0, DW_TAG_auto_variable)
495494
};
496495
let align = cx.align_of(variable_type);
497496

@@ -529,14 +528,7 @@ pub fn declare_local<'a, 'tcx>(bx: &Builder<'a, 'tcx>,
529528

530529
llvm::LLVMSetInstDebugLocation(bx.llbuilder, instr);
531530
}
532-
}
533-
}
534-
535-
match variable_kind {
536-
ArgumentVariable(_) | CapturedVariable => {
537-
assert!(!dbg_context.get_ref(span).source_locations_enabled.get());
538531
source_loc::set_debug_location(bx, UnknownLocation);
539532
}
540-
_ => { /* nothing to do */ }
541533
}
542534
}

src/librustc_codegen_llvm/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>,
634634
ty,
635635
scope,
636636
variable_access,
637-
VariableKind::CapturedVariable,
637+
VariableKind::LocalVariable,
638638
DUMMY_SP
639639
);
640640
}

0 commit comments

Comments
 (0)