MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / lower_block

Method lower_block

crates/hll-to-ir/src/compiler/compiler/control_flow.rs:41–53  ·  view source on GitHub ↗
(&mut self, ir_program: &mut IrProgram, block: &Block)

Source from the content-addressed store, hash-verified

39 statements: rewrite_continue_with_step(&then_block.statements, step),
40 stmt_lines: then_block.stmt_lines.clone(),
41 },
42 else_branch: else_branch
43 .as_ref()
44 .map(|branch| Box::new(rewrite_stmt(branch, step))),
45 },
46 // Nested `while`/`for` own their own `continue`; do not descend.
47 other => other.clone(),
48 }
49}
50
51impl HighLevelCompiler {
52 pub(super) fn lower_block(&mut self, ir_program: &mut IrProgram, block: &Block) {
53 for (index, statement) in block.statements.iter().enumerate() {
54 if let Some(b) = &self.current_block
55 && b.terminator.is_some()
56 {

Callers 9

lower_statementMethod · 0.80
lower_ifMethod · 0.80
lower_whileMethod · 0.80
lower_for_rangeMethod · 0.80
lower_for_eachMethod · 0.80
lower_for_each_sliceMethod · 0.80
lower_declarationMethod · 0.80
lower_match_coreMethod · 0.80
lower_match_scalarMethod · 0.80

Calls 2

lower_statementMethod · 0.80
warnMethod · 0.45

Tested by

no test coverage detected