2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-20 08:56:28 +08:00

ARTIQIRGenerator: support comparisons against None.

This commit is contained in:
whitequark 2015-08-28 05:14:52 -05:00
parent bcba86de7e
commit 37811f690b

View File

@ -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))