From a4525b21cf4e02417ba4b63eeea922e2334505a2 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 23 Nov 2015 23:55:12 +0800 Subject: [PATCH] compiler.ir: print even blocks without predecessors. --- artiq/compiler/ir.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/artiq/compiler/ir.py b/artiq/compiler/ir.py index 055d0f2ed..6a363ef43 100644 --- a/artiq/compiler/ir.py +++ b/artiq/compiler/ir.py @@ -479,8 +479,12 @@ class Function: type_printer.name(self.type.ret), self.name, ", ".join([arg.as_operand(type_printer) for arg in self.arguments]), type_printer.name(self.type))) - for block in reversed(postorder): + + postorder_blocks = list(reversed(postorder)) + orphan_blocks = [block for block in self.basic_blocks if block not in postorder] + for block in postorder_blocks + orphan_blocks: lines.append(block.as_entity(type_printer)) + lines.append("}") return "\n".join(lines)