@@ -57,9 +57,9 @@ use builder::Builder;
5757use callee;
5858use common:: { C_bool , C_bytes_in_context , C_i32 , C_usize } ;
5959use 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} ;
6161use consts;
62- use context:: { self , LocalCrateContext , SharedCrateContext } ;
62+ use context:: { self , CrateContext } ;
6363use debuginfo;
6464use declare;
6565use meth;
@@ -232,13 +232,13 @@ pub fn unsize_thin_ptr<'a, 'tcx>(
232232 & ty:: TyRawPtr ( ty:: TypeAndMut { ty : b, .. } ) ) |
233233 ( & ty:: TyRawPtr ( ty:: TypeAndMut { ty : a, .. } ) ,
234234 & ty:: TyRawPtr ( ty:: TypeAndMut { ty : b, .. } ) ) => {
235- assert ! ( bcx. ccx. shared ( ) . type_is_sized( a) ) ;
235+ assert ! ( bcx. ccx. type_is_sized( a) ) ;
236236 let ptr_ty = bcx. ccx . layout_of ( b) . llvm_type ( bcx. ccx ) . ptr_to ( ) ;
237237 ( bcx. pointercast ( src, ptr_ty) , unsized_info ( bcx. ccx , a, b, None ) )
238238 }
239239 ( & ty:: TyAdt ( def_a, _) , & ty:: TyAdt ( def_b, _) ) if def_a. is_box ( ) && def_b. is_box ( ) => {
240240 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) ) ;
242242 let ptr_ty = bcx. ccx . layout_of ( b) . llvm_type ( bcx. ccx ) . ptr_to ( ) ;
243243 ( bcx. pointercast ( src, ptr_ty) , unsized_info ( bcx. ccx , a, b, None ) )
244244 }
@@ -721,7 +721,6 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
721721 let link_meta = link:: build_link_meta ( crate_hash) ;
722722 let exported_symbol_node_ids = find_exported_symbols ( tcx) ;
723723
724- let shared_ccx = SharedCrateContext :: new ( tcx) ;
725724 // Translate the metadata.
726725 let llmod_id = "metadata" ;
727726 let ( metadata_llcx, metadata_llmod, metadata) =
@@ -770,7 +769,7 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
770769 // Run the translation item collector and partition the collected items into
771770 // codegen units.
772771 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 ;
774773 let codegen_units = ( * codegen_units) . clone ( ) ;
775774
776775 // 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>,
910909
911910 symbol_names_test:: report_symbol_names ( tcx) ;
912911
913- if shared_ccx . sess ( ) . trans_stats ( ) {
912+ if tcx . sess . trans_stats ( ) {
914913 println ! ( "--- trans stats ---" ) ;
915914 println ! ( "n_glues_created: {}" , all_stats. n_glues_created) ;
916915 println ! ( "n_null_glues: {}" , all_stats. n_null_glues) ;
@@ -926,7 +925,7 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
926925 }
927926 }
928927
929- if shared_ccx . sess ( ) . count_llvm_insns ( ) {
928+ if tcx . sess . count_llvm_insns ( ) {
930929 for ( k, v) in all_stats. llvm_insns . iter ( ) {
931930 println ! ( "{:7} {}" , * v, * k) ;
932931 }
@@ -1204,10 +1203,8 @@ fn compile_codegen_unit<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
12041203 . to_fingerprint( ) . to_hex( ) ) ;
12051204
12061205 // 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) ;
12091207 let module = {
1210- let ccx = CrateContext :: new ( & scx, & lcx) ;
12111208 let trans_items = ccx. codegen_unit ( )
12121209 . items_in_deterministic_order ( ccx. tcx ( ) ) ;
12131210 for & ( trans_item, ( linkage, visibility) ) in & trans_items {
@@ -1268,7 +1265,7 @@ fn compile_codegen_unit<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
12681265 }
12691266 } ;
12701267
1271- ( lcx . into_stats ( ) , module)
1268+ ( ccx . into_stats ( ) , module)
12721269 }
12731270}
12741271
0 commit comments