Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obk
Replace `Body::basic_blocks()` with field access Since the refactoring in #98930, it is possible to borrow the basic blocks independently from other parts of MIR by accessing the `basic_blocks` field directly. Replace unnecessary `Body::basic_blocks()` method with a direct field access, which has an additional benefit of borrowing the basic blocks only.
This commit is contained in:
commit
d182081de1
65 changed files with 131 additions and 140 deletions
|
@ -348,7 +348,7 @@ fn instance_def_size_estimate<'tcx>(
|
|||
match instance_def {
|
||||
InstanceDef::Item(..) | InstanceDef::DropGlue(..) => {
|
||||
let mir = tcx.instance_mir(instance_def);
|
||||
mir.basic_blocks().iter().map(|bb| bb.statements.len() + 1).sum()
|
||||
mir.basic_blocks.iter().map(|bb| bb.statements.len() + 1).sum()
|
||||
}
|
||||
// Estimate the size of other compiler-generated shims to be 1.
|
||||
_ => 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue