diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-05-06 11:47:03 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-05-20 18:56:53 +1000 |
| commit | c5d94017569713c12a7e3d260cb4cd0a02b26372 (patch) | |
| tree | 7df7cdc63a9f1db64163458e4ebc8abc941c1bea /src/librustc_codegen_llvm/debuginfo/mod.rs | |
| parent | 128b4c8035fc788b78157d4e1975cda0f25ce599 (diff) | |
| download | rust-c5d94017569713c12a7e3d260cb4cd0a02b26372.tar.gz rust-c5d94017569713c12a7e3d260cb4cd0a02b26372.zip | |
Avoid symbol interning in `file_metadata`.
This commit changes `created_files` so it uses strings directly as keys, rather than symbols derived from the strings. This avoids the cost of having to do the hash table lookups to produce the symbols from the strings. The commit also uses `entry` to avoid doing a repeated hash table lookup (`get` + `insert`). Note that PR #60467 improved this code somewhat; this is a further improvement.
Diffstat (limited to 'src/librustc_codegen_llvm/debuginfo/mod.rs')
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/mod.rs b/src/librustc_codegen_llvm/debuginfo/mod.rs index f3070a03b4e..527290392ff 100644 --- a/src/librustc_codegen_llvm/debuginfo/mod.rs +++ b/src/librustc_codegen_llvm/debuginfo/mod.rs @@ -37,7 +37,7 @@ use std::ffi::CString; use syntax_pos::{self, Span, Pos}; use syntax::ast; -use syntax::symbol::{Symbol, InternedString}; +use syntax::symbol::InternedString; use rustc::ty::layout::{self, LayoutOf, HasTyCtxt}; use rustc_codegen_ssa::traits::*; @@ -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<(Option<Symbol>, Option<Symbol>), &'a DIFile>>, + created_files: RefCell<FxHashMap<(Option<String>, Option<String>), &'a DIFile>>, created_enum_disr_types: RefCell<FxHashMap<(DefId, layout::Primitive), &'a DIType>>, type_map: RefCell<TypeMap<'a, 'tcx>>, |
