Skip to content

Commit e35dfad

Browse files
committed
rustc_codegen_llvm: avoid redundant calls to span_start.
1 parent f4b7477 commit e35dfad

File tree

1 file changed

+4
-4
lines changed
  • src/librustc_codegen_llvm/debuginfo

1 file changed

+4
-4
lines changed

Diff for: src/librustc_codegen_llvm/debuginfo/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
290290
// Get the linkage_name, which is just the symbol name
291291
let linkage_name = mangled_name_of_instance(self, instance);
292292

293-
let scope_line = span_start(self, span).line;
293+
// FIXME(eddyb) does this need to be separate from `loc.line` for some reason?
294+
let scope_line = loc.line;
294295

295296
let function_name = CString::new(name).unwrap();
296297
let linkage_name = SmallCStr::new(&linkage_name.name.as_str());
@@ -547,10 +548,9 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
547548
variable_kind: VariableKind,
548549
span: Span,
549550
) -> &'ll DIVariable {
550-
let file = span_start(self, span).file;
551-
let file_metadata = file_metadata(self, &file.name, dbg_context.defining_crate);
552-
553551
let loc = span_start(self, span);
552+
let file_metadata = file_metadata(self, &loc.file.name, dbg_context.defining_crate);
553+
554554
let type_metadata = type_metadata(self, variable_type, span);
555555

556556
let (argument_index, dwarf_tag) = match variable_kind {

0 commit comments

Comments
 (0)