about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/context.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2020-07-10 15:45:05 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2020-07-15 14:37:55 +1000
commit7c4d431c067308ae79b902fe0d0e7b9c6958d0e9 (patch)
treec964535c7342e0f4d9f2a0fd5684c7b21b51d231 /src/librustc_codegen_llvm/context.rs
parent567ad7455d5f25f6b38d2fded1cb621e0c34a48b (diff)
Change `SymbolName::name` to a `&str`.
This eliminates a bunch of `Symbol::intern()` and `Symbol::as_str()`
calls, which is good, because they require locking the interner.

Note that the unsafety in `from_cycle_error()` is identical to the
unsafety on other adjacent impls.
Diffstat (limited to 'src/librustc_codegen_llvm/context.rs')
-rw-r--r--src/librustc_codegen_llvm/context.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc_codegen_llvm/context.rs b/src/librustc_codegen_llvm/context.rs
index 21ba97d15a4..0a415d12166 100644
--- a/src/librustc_codegen_llvm/context.rs
+++ b/src/librustc_codegen_llvm/context.rs
@@ -16,11 +16,10 @@ use rustc_data_structures::small_c_str::SmallCStr;
 use rustc_middle::bug;
 use rustc_middle::mir::mono::CodegenUnit;
 use rustc_middle::ty::layout::{HasParamEnv, LayoutError, TyAndLayout};
-use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
+use rustc_middle::ty::{self, Instance, SymbolName, Ty, TyCtxt};
 use rustc_session::config::{CFGuard, CrateType, DebugInfo};
 use rustc_session::Session;
 use rustc_span::source_map::{Span, DUMMY_SP};
-use rustc_span::symbol::Symbol;
 use rustc_target::abi::{HasDataLayout, LayoutOf, PointeeInfo, Size, TargetDataLayout, VariantIdx};
 use rustc_target::spec::{HasTargetSpec, RelocModel, Target, TlsModel};
 
@@ -47,7 +46,7 @@ pub struct CodegenCx<'ll, 'tcx> {
     pub vtables:
         RefCell<FxHashMap<(Ty<'tcx>, Option<ty::PolyExistentialTraitRef<'tcx>>), &'ll Value>>,
     /// Cache of constant strings,
-    pub const_cstr_cache: RefCell<FxHashMap<Symbol, &'ll Value>>,
+    pub const_cstr_cache: RefCell<FxHashMap<SymbolName<'tcx>, &'ll Value>>,
 
     /// Reverse-direction for const ptrs cast from globals.
     ///