From 07fe60ded1727d528d3ae36b892aa7c84262ed96 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 6 Oct 2016 01:09:01 -0400 Subject: IR in 2 passes --- src/ir_print.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/ir_print.cpp') diff --git a/src/ir_print.cpp b/src/ir_print.cpp index 852ea7b9d6..75ebf27eb6 100644 --- a/src/ir_print.cpp +++ b/src/ir_print.cpp @@ -173,11 +173,10 @@ void ir_print(FILE *f, IrExecutable *executable, int indent_size) { irp->indent = indent_size; irp->indent_size = indent_size; - for (size_t i = 0; i < executable->basic_block_count; i += 1) { - IrBasicBlock *current_block = executable->basic_block_list[i]; - for (IrInstruction *instruction = current_block->first; instruction != nullptr; - instruction = instruction->next) - { + for (size_t bb_i = 0; bb_i < executable->basic_block_list.length; bb_i += 1) { + IrBasicBlock *current_block = executable->basic_block_list.at(bb_i); + for (size_t instr_i = 0; instr_i < current_block->instruction_list.length; instr_i += 1) { + IrInstruction *instruction = current_block->instruction_list.at(instr_i); ir_print_instruction(irp, instruction); } } -- cgit v1.2.3