rustc_codegen_llvm: remove debuginfo::VariableKind::CapturedVariable.

This commit is contained in:
Eduard-Mihai Burtescu 2018-05-21 18:30:55 +03:00
parent 98686ca294
commit a8ceab9cd7
2 changed files with 3 additions and 11 deletions

View file

@ -147,7 +147,6 @@ pub enum VariableAccess<'a> {
pub enum VariableKind { pub enum VariableKind {
ArgumentVariable(usize /*index*/), ArgumentVariable(usize /*index*/),
LocalVariable, LocalVariable,
CapturedVariable,
} }
/// Create any deferred debug metadata nodes /// Create any deferred debug metadata nodes
@ -478,6 +477,7 @@ pub fn declare_local<'a, 'tcx>(bx: &Builder<'a, 'tcx>,
variable_access: VariableAccess, variable_access: VariableAccess,
variable_kind: VariableKind, variable_kind: VariableKind,
span: Span) { span: Span) {
assert!(!dbg_context.get_ref(span).source_locations_enabled.get());
let cx = bx.cx; let cx = bx.cx;
let file = span_start(cx, span).file; let file = span_start(cx, span).file;
@ -490,8 +490,7 @@ pub fn declare_local<'a, 'tcx>(bx: &Builder<'a, 'tcx>,
let (argument_index, dwarf_tag) = match variable_kind { let (argument_index, dwarf_tag) = match variable_kind {
ArgumentVariable(index) => (index as c_uint, DW_TAG_arg_variable), ArgumentVariable(index) => (index as c_uint, DW_TAG_arg_variable),
LocalVariable | LocalVariable => (0, DW_TAG_auto_variable)
CapturedVariable => (0, DW_TAG_auto_variable)
}; };
let align = cx.align_of(variable_type); let align = cx.align_of(variable_type);
@ -529,14 +528,7 @@ pub fn declare_local<'a, 'tcx>(bx: &Builder<'a, 'tcx>,
llvm::LLVMSetInstDebugLocation(bx.llbuilder, instr); llvm::LLVMSetInstDebugLocation(bx.llbuilder, instr);
} }
}
}
match variable_kind {
ArgumentVariable(_) | CapturedVariable => {
assert!(!dbg_context.get_ref(span).source_locations_enabled.get());
source_loc::set_debug_location(bx, UnknownLocation); source_loc::set_debug_location(bx, UnknownLocation);
} }
_ => { /* nothing to do */ }
} }
} }

View file

@ -634,7 +634,7 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>,
ty, ty,
scope, scope,
variable_access, variable_access,
VariableKind::CapturedVariable, VariableKind::LocalVariable,
DUMMY_SP DUMMY_SP
); );
} }