From 37811f690babdf97749e606f28c94f30fd319418 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 28 Aug 2015 05:14:52 -0500 Subject: [PATCH] ARTIQIRGenerator: support comparisons against None. --- artiq/compiler/transforms/artiq_ir_generator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/artiq/compiler/transforms/artiq_ir_generator.py b/artiq/compiler/transforms/artiq_ir_generator.py index f2b8ae062..bca40580b 100644 --- a/artiq/compiler/transforms/artiq_ir_generator.py +++ b/artiq/compiler/transforms/artiq_ir_generator.py @@ -1134,7 +1134,9 @@ class ARTIQIRGenerator(algorithm.Visitor): assert False def polymorphic_compare_pair_order(self, op, lhs, rhs): - if builtins.is_numeric(lhs.type) and builtins.is_numeric(rhs.type): + if builtins.is_none(lhs.type) and builtins.is_none(rhs.type): + return self.append(ir.Compare(op, lhs, rhs)) + elif builtins.is_numeric(lhs.type) and builtins.is_numeric(rhs.type): return self.append(ir.Compare(op, lhs, rhs)) elif builtins.is_bool(lhs.type) and builtins.is_bool(rhs.type): return self.append(ir.Compare(op, lhs, rhs))