@@ -25,7 +25,7 @@ use monomorphize::Instance;
25
25
26
26
use partitioning:: CodegenUnit ;
27
27
use trans_item:: TransItem ;
28
- use type_:: { Type , TypeNames } ;
28
+ use type_:: Type ;
29
29
use rustc:: ty:: subst:: Substs ;
30
30
use rustc:: ty:: { self , Ty , TyCtxt } ;
31
31
use session:: config:: NoDebugInfo ;
@@ -87,7 +87,6 @@ pub struct LocalCrateContext<'tcx> {
87
87
llmod : ModuleRef ,
88
88
llcx : ContextRef ,
89
89
previous_work_product : Option < WorkProduct > ,
90
- tn : TypeNames , // FIXME: This seems to be largely unused.
91
90
codegen_unit : CodegenUnit < ' tcx > ,
92
91
needs_unwind_cleanup_cache : RefCell < FxHashMap < Ty < ' tcx > , bool > > ,
93
92
fn_pointer_shims : RefCell < FxHashMap < Ty < ' tcx > , ValueRef > > ,
@@ -137,6 +136,7 @@ pub struct LocalCrateContext<'tcx> {
137
136
type_hashcodes : RefCell < FxHashMap < Ty < ' tcx > , String > > ,
138
137
int_type : Type ,
139
138
opaque_vec_type : Type ,
139
+ str_slice_type : Type ,
140
140
builder : BuilderRef_res ,
141
141
142
142
/// Holds the LLVM values for closure IDs.
@@ -611,7 +611,6 @@ impl<'tcx> LocalCrateContext<'tcx> {
611
611
llcx : llcx,
612
612
previous_work_product : previous_work_product,
613
613
codegen_unit : codegen_unit,
614
- tn : TypeNames :: new ( ) ,
615
614
needs_unwind_cleanup_cache : RefCell :: new ( FxHashMap ( ) ) ,
616
615
fn_pointer_shims : RefCell :: new ( FxHashMap ( ) ) ,
617
616
drop_glues : RefCell :: new ( FxHashMap ( ) ) ,
@@ -631,6 +630,7 @@ impl<'tcx> LocalCrateContext<'tcx> {
631
630
type_hashcodes : RefCell :: new ( FxHashMap ( ) ) ,
632
631
int_type : Type :: from_ref ( ptr:: null_mut ( ) ) ,
633
632
opaque_vec_type : Type :: from_ref ( ptr:: null_mut ( ) ) ,
633
+ str_slice_type : Type :: from_ref ( ptr:: null_mut ( ) ) ,
634
634
builder : BuilderRef_res ( llvm:: LLVMCreateBuilderInContext ( llcx) ) ,
635
635
closure_vals : RefCell :: new ( FxHashMap ( ) ) ,
636
636
dbg_cx : dbg_cx,
@@ -662,7 +662,7 @@ impl<'tcx> LocalCrateContext<'tcx> {
662
662
663
663
local_ccx. int_type = int_type;
664
664
local_ccx. opaque_vec_type = opaque_vec_type;
665
- local_ccx. tn . associate_type ( "str_slice" , & str_slice_ty) ;
665
+ local_ccx. str_slice_type = str_slice_ty;
666
666
667
667
if shared. tcx . sess . count_llvm_insns ( ) {
668
668
base:: init_insn_ctxt ( )
@@ -778,10 +778,6 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> {
778
778
unsafe { llvm:: LLVMRustGetModuleDataLayout ( self . llmod ( ) ) }
779
779
}
780
780
781
- pub fn tn < ' a > ( & ' a self ) -> & ' a TypeNames {
782
- & self . local ( ) . tn
783
- }
784
-
785
781
pub fn export_map < ' a > ( & ' a self ) -> & ' a ExportMap {
786
782
& self . shared . export_map
787
783
}
@@ -885,6 +881,10 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> {
885
881
self . local ( ) . opaque_vec_type
886
882
}
887
883
884
+ pub fn str_slice_type ( & self ) -> Type {
885
+ self . local ( ) . str_slice_type
886
+ }
887
+
888
888
pub fn closure_vals < ' a > ( & ' a self ) -> & ' a RefCell < FxHashMap < Instance < ' tcx > , ValueRef > > {
889
889
& self . local ( ) . closure_vals
890
890
}
0 commit comments