@@ -66,7 +66,7 @@ impl<'tcx> MirPass<'tcx> for DataflowConstProp {
66
66
}
67
67
68
68
struct ConstAnalysis < ' a , ' tcx > {
69
- map : Map ,
69
+ map : Map < ' tcx > ,
70
70
tcx : TyCtxt < ' tcx > ,
71
71
local_decls : & ' a LocalDecls < ' tcx > ,
72
72
ecx : InterpCx < ' tcx , DummyMachine > ,
@@ -78,7 +78,7 @@ impl<'tcx> ValueAnalysis<'tcx> for ConstAnalysis<'_, 'tcx> {
78
78
79
79
const NAME : & ' static str = "ConstAnalysis" ;
80
80
81
- fn map ( & self ) -> & Map {
81
+ fn map ( & self ) -> & Map < ' tcx > {
82
82
& self . map
83
83
}
84
84
@@ -335,7 +335,7 @@ impl<'tcx> ValueAnalysis<'tcx> for ConstAnalysis<'_, 'tcx> {
335
335
}
336
336
337
337
impl < ' a , ' tcx > ConstAnalysis < ' a , ' tcx > {
338
- pub fn new ( tcx : TyCtxt < ' tcx > , body : & ' a Body < ' tcx > , map : Map ) -> Self {
338
+ pub fn new ( tcx : TyCtxt < ' tcx > , body : & ' a Body < ' tcx > , map : Map < ' tcx > ) -> Self {
339
339
let param_env = tcx. param_env_reveal_all_normalized ( body. source . def_id ( ) ) ;
340
340
Self {
341
341
map,
@@ -565,12 +565,13 @@ impl<'tcx, 'locals> Collector<'tcx, 'locals> {
565
565
Self { patch : Patch :: new ( tcx) , local_decls }
566
566
}
567
567
568
+ #[ instrument( level = "trace" , skip( self , ecx, map) , ret) ]
568
569
fn try_make_constant (
569
570
& self ,
570
571
ecx : & mut InterpCx < ' tcx , DummyMachine > ,
571
572
place : Place < ' tcx > ,
572
573
state : & State < FlatSet < Scalar > > ,
573
- map : & Map ,
574
+ map : & Map < ' tcx > ,
574
575
) -> Option < Const < ' tcx > > {
575
576
let ty = place. ty ( self . local_decls , self . patch . tcx ) . ty ;
576
577
let layout = ecx. layout_of ( ty) . ok ( ) ?;
@@ -603,10 +604,11 @@ impl<'tcx, 'locals> Collector<'tcx, 'locals> {
603
604
}
604
605
}
605
606
607
+ #[ instrument( level = "trace" , skip( map) , ret) ]
606
608
fn propagatable_scalar (
607
609
place : PlaceIndex ,
608
610
state : & State < FlatSet < Scalar > > ,
609
- map : & Map ,
611
+ map : & Map < ' _ > ,
610
612
) -> Option < Scalar > {
611
613
if let FlatSet :: Elem ( value) = state. get_idx ( place, map)
612
614
&& value. try_to_scalar_int ( ) . is_ok ( )
@@ -618,14 +620,14 @@ fn propagatable_scalar(
618
620
}
619
621
}
620
622
621
- #[ instrument( level = "trace" , skip( ecx, state, map) ) ]
623
+ #[ instrument( level = "trace" , skip( ecx, state, map) , ret ) ]
622
624
fn try_write_constant < ' tcx > (
623
625
ecx : & mut InterpCx < ' tcx , DummyMachine > ,
624
626
dest : & PlaceTy < ' tcx > ,
625
627
place : PlaceIndex ,
626
628
ty : Ty < ' tcx > ,
627
629
state : & State < FlatSet < Scalar > > ,
628
- map : & Map ,
630
+ map : & Map < ' tcx > ,
629
631
) -> InterpResult < ' tcx > {
630
632
let layout = ecx. layout_of ( ty) ?;
631
633
@@ -724,6 +726,7 @@ impl<'mir, 'tcx>
724
726
{
725
727
type FlowState = State < FlatSet < Scalar > > ;
726
728
729
+ #[ instrument( level = "trace" , skip( self , results, statement) ) ]
727
730
fn visit_statement_before_primary_effect (
728
731
& mut self ,
729
732
results : & mut Results < ' tcx , ValueAnalysisWrapper < ConstAnalysis < ' _ , ' tcx > > > ,
@@ -745,6 +748,7 @@ impl<'mir, 'tcx>
745
748
}
746
749
}
747
750
751
+ #[ instrument( level = "trace" , skip( self , results, statement) ) ]
748
752
fn visit_statement_after_primary_effect (
749
753
& mut self ,
750
754
results : & mut Results < ' tcx , ValueAnalysisWrapper < ConstAnalysis < ' _ , ' tcx > > > ,
@@ -839,7 +843,7 @@ struct OperandCollector<'tcx, 'map, 'locals, 'a> {
839
843
state : & ' a State < FlatSet < Scalar > > ,
840
844
visitor : & ' a mut Collector < ' tcx , ' locals > ,
841
845
ecx : & ' map mut InterpCx < ' tcx , DummyMachine > ,
842
- map : & ' map Map ,
846
+ map : & ' map Map < ' tcx > ,
843
847
}
844
848
845
849
impl < ' tcx > Visitor < ' tcx > for OperandCollector < ' tcx , ' _ , ' _ , ' _ > {
0 commit comments