about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/debuginfo/create_scope_map.rs
diff options
context:
space:
mode:
authorArlo Siemsen <arsiem@microsoft.com>2020-04-05 01:43:44 -0700
committerArlo Siemsen <arsiem@microsoft.com>2020-04-05 01:43:44 -0700
commit4cdceda5a355ab5c4732b425b4449d9707084fdc (patch)
treee47937f3da985524e165de159cfc38968a13ae4f /src/librustc_codegen_llvm/debuginfo/create_scope_map.rs
parent853c4774e26ea97b45fe74de9a6f68e526784323 (diff)
downloadrust-4cdceda5a355ab5c4732b425b4449d9707084fdc.tar.gz
rust-4cdceda5a355ab5c4732b425b4449d9707084fdc.zip
Fix performance regression in debuginfo file_metadata.
Finding the `SourceFile` associated with a `FileName` called `get_source_file` on
the `SourceMap`, which does a linear search through all files in the `SourceMap`.

This resolves the issue by passing the SourceFile in from the caller (which already
had it available).
Diffstat (limited to 'src/librustc_codegen_llvm/debuginfo/create_scope_map.rs')
-rw-r--r--src/librustc_codegen_llvm/debuginfo/create_scope_map.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/create_scope_map.rs b/src/librustc_codegen_llvm/debuginfo/create_scope_map.rs
index e2eae4ac427..7f47b61de3f 100644
--- a/src/librustc_codegen_llvm/debuginfo/create_scope_map.rs
+++ b/src/librustc_codegen_llvm/debuginfo/create_scope_map.rs
@@ -76,7 +76,7 @@ fn make_mir_scope(
     }
 
     let loc = cx.lookup_debug_loc(scope_data.span.lo());
-    let file_metadata = file_metadata(cx, &loc.file.name, debug_context.defining_crate);
+    let file_metadata = file_metadata(cx, &loc.file, debug_context.defining_crate);
 
     let scope_metadata = unsafe {
         Some(llvm::LLVMRustDIBuilderCreateLexicalBlock(