@@ -13,7 +13,7 @@ use rustc_middle::mir::mono::CodegenUnit;
1313use rustc_middle:: ty:: { self , Instance , ParamEnv , PolyExistentialTraitRef , Ty , TyCtxt } ;
1414use rustc_middle:: ty:: layout:: { FnAbiError , FnAbiOfHelpers , FnAbiRequest , HasParamEnv , HasTyCtxt , LayoutError , TyAndLayout , LayoutOfHelpers } ;
1515use rustc_session:: Session ;
16- use rustc_span:: Span ;
16+ use rustc_span:: { Span , source_map :: respan } ;
1717use rustc_target:: abi:: { call:: FnAbi , HasDataLayout , PointeeInfo , Size , TargetDataLayout , VariantIdx } ;
1818use rustc_target:: spec:: { HasTargetSpec , Target , TlsModel } ;
1919
@@ -293,7 +293,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
293293 self . is_native_int_type ( typ) || self . is_non_native_int_type ( typ) || typ. is_compatible_with ( self . bool_type )
294294 }
295295
296- pub fn sess ( & self ) -> & Session {
296+ pub fn sess ( & self ) -> & ' tcx Session {
297297 & self . tcx . sess
298298 }
299299
@@ -416,10 +416,6 @@ impl<'gcc, 'tcx> MiscMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
416416 self . codegen_unit
417417 }
418418
419- fn used_statics ( & self ) -> & RefCell < Vec < RValue < ' gcc > > > {
420- unimplemented ! ( ) ;
421- }
422-
423419 fn set_frame_pointer_type ( & self , _llfn : RValue < ' gcc > ) {
424420 // TODO(antoyo)
425421 }
@@ -428,10 +424,6 @@ impl<'gcc, 'tcx> MiscMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
428424 // TODO(antoyo)
429425 }
430426
431- fn create_used_variable ( & self ) {
432- unimplemented ! ( ) ;
433- }
434-
435427 fn declare_c_main ( & self , fn_type : Self :: Type ) -> Option < Self :: Function > {
436428 if self . get_declared_value ( "main" ) . is_none ( ) {
437429 Some ( self . declare_cfn ( "main" , fn_type) )
@@ -443,14 +435,6 @@ impl<'gcc, 'tcx> MiscMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
443435 None
444436 }
445437 }
446-
447- fn compiler_used_statics ( & self ) -> & RefCell < Vec < RValue < ' gcc > > > {
448- unimplemented ! ( )
449- }
450-
451- fn create_compiler_used_variable ( & self ) {
452- unimplemented ! ( )
453- }
454438}
455439
456440impl < ' gcc , ' tcx > HasTyCtxt < ' tcx > for CodegenCx < ' gcc , ' tcx > {
@@ -477,7 +461,7 @@ impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
477461 #[ inline]
478462 fn handle_layout_err ( & self , err : LayoutError < ' tcx > , span : Span , ty : Ty < ' tcx > ) -> ! {
479463 if let LayoutError :: SizeOverflow ( _) = err {
480- self . sess ( ) . span_fatal ( span, & err. to_string ( ) )
464+ self . sess ( ) . emit_fatal ( respan ( span, err) )
481465 } else {
482466 span_bug ! ( span, "failed to get layout for `{}`: {}" , ty, err)
483467 }
@@ -495,7 +479,7 @@ impl<'gcc, 'tcx> FnAbiOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
495479 fn_abi_request : FnAbiRequest < ' tcx > ,
496480 ) -> ! {
497481 if let FnAbiError :: Layout ( LayoutError :: SizeOverflow ( _) ) = err {
498- self . sess ( ) . span_fatal ( span, & err. to_string ( ) )
482+ self . sess ( ) . emit_fatal ( respan ( span, err) )
499483 } else {
500484 match fn_abi_request {
501485 FnAbiRequest :: OfFnPtr { sig, extra_args } => {
0 commit comments