From 2a82eb72191ffac3d7d5cfb87466804d0db9ca16 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 24 Nov 2015 00:01:10 +0800 Subject: [PATCH] compiler.ir: return dict from Delay.substs, not pair iterable. --- artiq/compiler/ir.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/artiq/compiler/ir.py b/artiq/compiler/ir.py index 513849268..54c6f0500 100644 --- a/artiq/compiler/ir.py +++ b/artiq/compiler/ir.py @@ -1339,13 +1339,14 @@ class Delay(Terminator): self.operands[1].uses.add(self) def substs(self): - return zip(self.var_names, self.operands[2:]) + return {key: value for key, value in zip(self.var_names, self.operands[2:])} def _operands_as_string(self, type_printer): - substs = [] - for var_name, operand in self.substs(): - substs.append("{}={}".format(var_name, operand)) - result = "[{}]".format(", ".join(substs)) + substs = self.substs() + substs_as_strings = [] + for var_name in substs: + substs_as_strings.append("{} = {}".format(var_name, substs[var_name])) + result = "[{}]".format(", ".join(substs_as_strings)) result += ", decomp {}, to {}".format(self.decomposition().as_operand(type_printer), self.target().as_operand(type_printer)) return result