File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
compiler/rustc_mir_transform/src Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,12 @@ impl<'tcx> crate::MirPass<'tcx> for CtfeLimit {
28
28
}
29
29
} )
30
30
. collect ( ) ;
31
+
32
+ let basic_blocks = body. basic_blocks . as_mut_preserves_cfg ( ) ;
31
33
for index in indices {
32
- insert_counter (
33
- body. basic_blocks_mut ( )
34
- . get_mut ( index)
35
- . expect ( "basic_blocks index {index} should exist" ) ,
36
- ) ;
34
+ let bbdata = & mut basic_blocks[ index] ;
35
+ let source_info = bbdata. terminator ( ) . source_info ;
36
+ bbdata. statements . push ( Statement :: new ( source_info, StatementKind :: ConstEvalCounter ) ) ;
37
37
}
38
38
}
39
39
@@ -53,10 +53,3 @@ fn has_back_edge(
53
53
// Check if any of the dominators of the node are also the node's successor.
54
54
node_data. terminator ( ) . successors ( ) . any ( |succ| doms. dominates ( succ, node) )
55
55
}
56
-
57
- fn insert_counter ( basic_block_data : & mut BasicBlockData < ' _ > ) {
58
- basic_block_data. statements . push ( Statement :: new (
59
- basic_block_data. terminator ( ) . source_info ,
60
- StatementKind :: ConstEvalCounter ,
61
- ) ) ;
62
- }
You can’t perform that action at this time.
0 commit comments