about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/debuginfo/mod.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2019-05-02 20:34:26 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2019-05-02 20:47:20 +1000
commit6ef39e69eac42e1cc86ec8eeb1b85c6b3a8784fa (patch)
tree2ae27dc2fd60df15ec3c7361e4bcdefdefcb57ee /src/librustc_codegen_llvm/debuginfo/mod.rs
parent03122e1bac482b150844ef9664b1ad2438b43072 (diff)
downloadrust-6ef39e69eac42e1cc86ec8eeb1b85c6b3a8784fa.tar.gz
rust-6ef39e69eac42e1cc86ec8eeb1b85c6b3a8784fa.zip
Avoid repeated interning of static strings.
`file_metadata_raw` interns the strings `"<unknown>"` and `""` very
frequently. This commit avoids that, which reduces the number of symbols
interned significantly and reduces instruction counts by up to 0.5% on
some workloads.
Diffstat (limited to 'src/librustc_codegen_llvm/debuginfo/mod.rs')
-rw-r--r--src/librustc_codegen_llvm/debuginfo/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/mod.rs b/src/librustc_codegen_llvm/debuginfo/mod.rs
index 2154ac9b1d2..f3070a03b4e 100644
--- a/src/librustc_codegen_llvm/debuginfo/mod.rs
+++ b/src/librustc_codegen_llvm/debuginfo/mod.rs
@@ -63,7 +63,7 @@ pub struct CrateDebugContext<'a, 'tcx> {
     llcontext: &'a llvm::Context,
     llmod: &'a llvm::Module,
     builder: &'a mut DIBuilder<'a>,
-    created_files: RefCell<FxHashMap<(Symbol, Symbol), &'a DIFile>>,
+    created_files: RefCell<FxHashMap<(Option<Symbol>, Option<Symbol>), &'a DIFile>>,
     created_enum_disr_types: RefCell<FxHashMap<(DefId, layout::Primitive), &'a DIType>>,
 
     type_map: RefCell<TypeMap<'a, 'tcx>>,