diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-10-06 01:09:01 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-10-06 01:09:01 -0400 |
| commit | 07fe60ded1727d528d3ae36b892aa7c84262ed96 (patch) | |
| tree | 733a4aa3c8327d0ceb831cf122c84484b6a13d10 /src/codegen.cpp | |
| parent | cd1bd78aa9b4120ee95cd6347b7adce0d460f9d2 (diff) | |
| download | zig-07fe60ded1727d528d3ae36b892aa7c84262ed96.tar.gz zig-07fe60ded1727d528d3ae36b892aa7c84262ed96.zip | |
IR in 2 passes
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 2cf56169a6..fdf41415ae 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2921,13 +2921,12 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, static void ir_render(CodeGen *g, FnTableEntry *fn_entry) { assert(fn_entry); - IrExecutable *executable = &fn_entry->ir_executable; - assert(executable->basic_block_count > 0); - 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) - { + IrExecutable *executable = &fn_entry->analyzed_executable; + assert(executable->basic_block_list.length > 0); + for (size_t block_i = 0; block_i < executable->basic_block_list.length; block_i += 1) { + IrBasicBlock *current_block = executable->basic_block_list.at(block_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); instruction->llvm_value = ir_render_instruction(g, executable, instruction); } } |
