Skip to content

Commit

Permalink
rustc_codegen_llvm: remove debuginfo::VariableKind::CapturedVariable.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed May 21, 2018
1 parent 98686ca commit a8ceab9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions src/librustc_codegen_llvm/debuginfo/mod.rs
Expand Up @@ -147,7 +147,6 @@ pub enum VariableAccess<'a> {
pub enum VariableKind {
ArgumentVariable(usize /*index*/),
LocalVariable,
CapturedVariable,
}

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

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

let (argument_index, dwarf_tag) = match variable_kind {
ArgumentVariable(index) => (index as c_uint, DW_TAG_arg_variable),
LocalVariable |
CapturedVariable => (0, DW_TAG_auto_variable)
LocalVariable => (0, DW_TAG_auto_variable)
};
let align = cx.align_of(variable_type);

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

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);
}
_ => { /* nothing to do */ }
}
}
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/mir/mod.rs
Expand Up @@ -634,7 +634,7 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>,
ty,
scope,
variable_access,
VariableKind::CapturedVariable,
VariableKind::LocalVariable,
DUMMY_SP
);
}
Expand Down

0 comments on commit a8ceab9

Please sign in to comment.