@@ -57,9 +57,9 @@ use builder::Builder;
57
57
use callee;
58
58
use common:: { C_bool , C_bytes_in_context , C_i32 , C_usize } ;
59
59
use rustc_mir:: monomorphize:: collector:: { self , MonoItemCollectionMode } ;
60
- use common:: { self , C_struct_in_context , C_array , CrateContext , val_ty} ;
60
+ use common:: { self , C_struct_in_context , C_array , val_ty} ;
61
61
use consts;
62
- use context:: { self , LocalCrateContext , SharedCrateContext } ;
62
+ use context:: { self , CrateContext } ;
63
63
use debuginfo;
64
64
use declare;
65
65
use meth;
@@ -232,13 +232,13 @@ pub fn unsize_thin_ptr<'a, 'tcx>(
232
232
& ty:: TyRawPtr ( ty:: TypeAndMut { ty : b, .. } ) ) |
233
233
( & ty:: TyRawPtr ( ty:: TypeAndMut { ty : a, .. } ) ,
234
234
& ty:: TyRawPtr ( ty:: TypeAndMut { ty : b, .. } ) ) => {
235
- assert ! ( bcx. ccx. shared ( ) . type_is_sized( a) ) ;
235
+ assert ! ( bcx. ccx. type_is_sized( a) ) ;
236
236
let ptr_ty = bcx. ccx . layout_of ( b) . llvm_type ( bcx. ccx ) . ptr_to ( ) ;
237
237
( bcx. pointercast ( src, ptr_ty) , unsized_info ( bcx. ccx , a, b, None ) )
238
238
}
239
239
( & ty:: TyAdt ( def_a, _) , & ty:: TyAdt ( def_b, _) ) if def_a. is_box ( ) && def_b. is_box ( ) => {
240
240
let ( a, b) = ( src_ty. boxed_ty ( ) , dst_ty. boxed_ty ( ) ) ;
241
- assert ! ( bcx. ccx. shared ( ) . type_is_sized( a) ) ;
241
+ assert ! ( bcx. ccx. type_is_sized( a) ) ;
242
242
let ptr_ty = bcx. ccx . layout_of ( b) . llvm_type ( bcx. ccx ) . ptr_to ( ) ;
243
243
( bcx. pointercast ( src, ptr_ty) , unsized_info ( bcx. ccx , a, b, None ) )
244
244
}
@@ -721,7 +721,6 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
721
721
let link_meta = link:: build_link_meta ( crate_hash) ;
722
722
let exported_symbol_node_ids = find_exported_symbols ( tcx) ;
723
723
724
- let shared_ccx = SharedCrateContext :: new ( tcx) ;
725
724
// Translate the metadata.
726
725
let llmod_id = "metadata" ;
727
726
let ( metadata_llcx, metadata_llmod, metadata) =
@@ -770,7 +769,7 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
770
769
// Run the translation item collector and partition the collected items into
771
770
// codegen units.
772
771
let codegen_units =
773
- shared_ccx . tcx ( ) . collect_and_partition_translation_items ( LOCAL_CRATE ) . 1 ;
772
+ tcx. collect_and_partition_translation_items ( LOCAL_CRATE ) . 1 ;
774
773
let codegen_units = ( * codegen_units) . clone ( ) ;
775
774
776
775
// Force all codegen_unit queries so they are already either red or green
@@ -910,7 +909,7 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
910
909
911
910
symbol_names_test:: report_symbol_names ( tcx) ;
912
911
913
- if shared_ccx . sess ( ) . trans_stats ( ) {
912
+ if tcx . sess . trans_stats ( ) {
914
913
println ! ( "--- trans stats ---" ) ;
915
914
println ! ( "n_glues_created: {}" , all_stats. n_glues_created) ;
916
915
println ! ( "n_null_glues: {}" , all_stats. n_null_glues) ;
@@ -926,7 +925,7 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
926
925
}
927
926
}
928
927
929
- if shared_ccx . sess ( ) . count_llvm_insns ( ) {
928
+ if tcx . sess . count_llvm_insns ( ) {
930
929
for ( k, v) in all_stats. llvm_insns . iter ( ) {
931
930
println ! ( "{:7} {}" , * v, * k) ;
932
931
}
@@ -1204,10 +1203,8 @@ fn compile_codegen_unit<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1204
1203
. to_fingerprint( ) . to_hex( ) ) ;
1205
1204
1206
1205
// Instantiate translation items without filling out definitions yet...
1207
- let scx = SharedCrateContext :: new ( tcx) ;
1208
- let lcx = LocalCrateContext :: new ( & scx, cgu, & llmod_id) ;
1206
+ let ccx = CrateContext :: new ( tcx, cgu, & llmod_id) ;
1209
1207
let module = {
1210
- let ccx = CrateContext :: new ( & scx, & lcx) ;
1211
1208
let trans_items = ccx. codegen_unit ( )
1212
1209
. items_in_deterministic_order ( ccx. tcx ( ) ) ;
1213
1210
for & ( trans_item, ( linkage, visibility) ) in & trans_items {
@@ -1268,7 +1265,7 @@ fn compile_codegen_unit<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1268
1265
}
1269
1266
} ;
1270
1267
1271
- ( lcx . into_stats ( ) , module)
1268
+ ( ccx . into_stats ( ) , module)
1272
1269
}
1273
1270
}
1274
1271
0 commit comments