MCPcopy Index your code
hub / github.com/RustPython/RustPython / next_nonempty_block

Function next_nonempty_block

crates/codegen/src/ir.rs:2627–2635  ·  view source on GitHub ↗

Follow chain of empty blocks to find first non-empty block.

(blocks: &[Block], mut idx: BlockIdx)

Source from the content-addressed store, hash-verified

2625
2626/// Follow chain of empty blocks to find first non-empty block.
2627fn next_nonempty_block(blocks: &[Block], mut idx: BlockIdx) -> BlockIdx {
2628 while idx != BlockIdx::NULL
2629 && blocks[idx.idx()].instructions.is_empty()
2630 && blocks[idx.idx()].next != BlockIdx::NULL
2631 {
2632 idx = blocks[idx.idx()].next;
2633 }
2634 idx
2635}
2636
2637fn instruction_lineno(instr: &InstructionInfo) -> i32 {
2638 instr

Callers 4

compute_predecessorsFunction · 0.85
propagate_line_numbersFunction · 0.85
duplicate_end_returnsFunction · 0.85

Calls 2

idxMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected