Skip to content

Commit 1071c4c

Browse files
committed
Replace Body::basic_blocks() with field access
1 parent d9bbac0 commit 1071c4c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/analyze.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(crate) fn analyze(fx: &FunctionCx<'_, '_, '_>) -> IndexVec<Local, SsaKind> {
2626
})
2727
.collect::<IndexVec<Local, SsaKind>>();
2828

29-
for bb in fx.mir.basic_blocks().iter() {
29+
for bb in fx.mir.basic_blocks.iter() {
3030
for stmt in bb.statements.iter() {
3131
match &stmt.kind {
3232
Assign(place_and_rval) => match &place_and_rval.1 {

src/base.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub(crate) fn codegen_fn<'tcx>(
7373
// Predefine blocks
7474
let start_block = bcx.create_block();
7575
let block_map: IndexVec<BasicBlock, Block> =
76-
(0..mir.basic_blocks().len()).map(|_| bcx.create_block()).collect();
76+
(0..mir.basic_blocks.len()).map(|_| bcx.create_block()).collect();
7777

7878
// Make FunctionCx
7979
let target_config = module.target_config();
@@ -271,7 +271,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
271271
}
272272
fx.tcx.sess.time("codegen prelude", || crate::abi::codegen_fn_prelude(fx, start_block));
273273

274-
for (bb, bb_data) in fx.mir.basic_blocks().iter_enumerated() {
274+
for (bb, bb_data) in fx.mir.basic_blocks.iter_enumerated() {
275275
let block = fx.get_block(bb);
276276
fx.bcx.switch_to_block(block);
277277

src/constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
505505
return None;
506506
}
507507
let mut computed_const_val = None;
508-
for bb_data in fx.mir.basic_blocks() {
508+
for bb_data in fx.mir.basic_blocks.iter() {
509509
for stmt in &bb_data.statements {
510510
match &stmt.kind {
511511
StatementKind::Assign(local_and_rvalue) if &local_and_rvalue.0 == place => {

0 commit comments

Comments
 (0)