| 538 | } |
| 539 | |
| 540 | fn inline_fn(&mut self, function: &mut Function) { |
| 541 | let mut block_idx = 0; |
| 542 | while block_idx < function.blocks.len() { |
| 543 | // If we successfully inlined a block, then repeat processing on the same block, in |
| 544 | // case the newly inlined block has more inlined calls. |
| 545 | // TODO: This is quadratic |
| 546 | if !self.inline_block(function, block_idx) { |
| 547 | block_idx += 1; |
| 548 | } |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | fn inline_block(&mut self, caller: &mut Function, block_idx: usize) -> bool { |
| 553 | // Find the first inlined OpFunctionCall |