@@ -2751,6 +2751,7 @@ impl<'tcx> ty::Instance<'tcx> {
27512751 // for `Instance` (e.g. typeck would use `Ty::fn_sig` instead),
27522752 // or should go through `FnAbi` instead, to avoid losing any
27532753 // adjustments `fn_abi_of_instance` might be performing.
2754+ #[ tracing:: instrument( level = "debug" , skip( tcx, param_env) ) ]
27542755 fn fn_sig_for_fn_abi (
27552756 & self ,
27562757 tcx : TyCtxt < ' tcx > ,
@@ -2897,6 +2898,7 @@ impl<'tcx> ty::Instance<'tcx> {
28972898/// with `-Cpanic=abort` will look like they can't unwind when in fact they
28982899/// might (from a foreign exception or similar).
28992900#[ inline]
2901+ #[ tracing:: instrument( level = "debug" , skip( tcx) ) ]
29002902pub fn fn_can_unwind < ' tcx > ( tcx : TyCtxt < ' tcx > , fn_def_id : Option < DefId > , abi : SpecAbi ) -> bool {
29012903 if let Some ( did) = fn_def_id {
29022904 // Special attribute for functions which can't unwind.
@@ -3113,6 +3115,7 @@ pub trait FnAbiOf<'tcx>: FnAbiOfHelpers<'tcx> {
31133115 /// NB: that includes virtual calls, which are represented by "direct calls"
31143116 /// to an `InstanceDef::Virtual` instance (of `<dyn Trait as Trait>::fn`).
31153117 #[ inline]
3118+ #[ tracing:: instrument( level = "debug" , skip( self ) ) ]
31163119 fn fn_abi_of_instance (
31173120 & self ,
31183121 instance : ty:: Instance < ' tcx > ,
@@ -3259,6 +3262,10 @@ pub fn adjust_for_rust_scalar<'tcx>(
32593262impl < ' tcx > LayoutCx < ' tcx , TyCtxt < ' tcx > > {
32603263 // FIXME(eddyb) perhaps group the signature/type-containing (or all of them?)
32613264 // arguments of this method, into a separate `struct`.
3265+ #[ tracing:: instrument(
3266+ level = "debug" ,
3267+ skip( self , caller_location, fn_def_id, force_thin_self_ptr)
3268+ ) ]
32623269 fn fn_abi_new_uncached (
32633270 & self ,
32643271 sig : ty:: PolyFnSig < ' tcx > ,
@@ -3268,8 +3275,6 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
32683275 // FIXME(eddyb) replace this with something typed, like an `enum`.
32693276 force_thin_self_ptr : bool ,
32703277 ) -> Result < & ' tcx FnAbi < ' tcx , Ty < ' tcx > > , FnAbiError < ' tcx > > {
3271- debug ! ( "fn_abi_new_uncached({:?}, {:?})" , sig, extra_args) ;
3272-
32733278 let sig = self . tcx . normalize_erasing_late_bound_regions ( self . param_env , sig) ;
32743279
32753280 let conv = conv_from_spec_abi ( self . tcx ( ) , sig. abi ) ;
@@ -3312,6 +3317,8 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
33123317 let rust_abi = matches ! ( sig. abi, RustIntrinsic | PlatformIntrinsic | Rust | RustCall ) ;
33133318
33143319 let arg_of = |ty : Ty < ' tcx > , arg_idx : Option < usize > | -> Result < _ , FnAbiError < ' tcx > > {
3320+ let span = tracing:: debug_span!( "arg_of" ) ;
3321+ let _entered = span. enter ( ) ;
33153322 let is_return = arg_idx. is_none ( ) ;
33163323
33173324 let layout = self . layout_of ( ty) ?;
@@ -3368,6 +3375,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
33683375 Ok ( self . tcx . arena . alloc ( fn_abi) )
33693376 }
33703377
3378+ #[ tracing:: instrument( level = "debug" , skip( self ) ) ]
33713379 fn fn_abi_adjust_for_abi (
33723380 & self ,
33733381 fn_abi : & mut FnAbi < ' tcx , Ty < ' tcx > > ,
@@ -3442,6 +3450,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
34423450 }
34433451}
34443452
3453+ #[ tracing:: instrument( level = "debug" , skip( cx) ) ]
34453454fn make_thin_self_ptr < ' tcx > (
34463455 cx : & ( impl HasTyCtxt < ' tcx > + HasParamEnv < ' tcx > ) ,
34473456 layout : TyAndLayout < ' tcx > ,
@@ -3453,7 +3462,7 @@ fn make_thin_self_ptr<'tcx>(
34533462 tcx. mk_mut_ptr ( layout. ty )
34543463 } else {
34553464 match layout. abi {
3456- Abi :: ScalarPair ( ..) => ( ) ,
3465+ Abi :: ScalarPair ( ..) | Abi :: Scalar ( .. ) => ( ) ,
34573466 _ => bug ! ( "receiver type has unsupported layout: {:?}" , layout) ,
34583467 }
34593468
0 commit comments