forked from M-Labs/artiq
ARTIQIRGenerator: support comparisons against None.
This commit is contained in:
parent
bcba86de7e
commit
37811f690b
|
@ -1134,7 +1134,9 @@ class ARTIQIRGenerator(algorithm.Visitor):
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
def polymorphic_compare_pair_order(self, op, lhs, rhs):
|
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))
|
return self.append(ir.Compare(op, lhs, rhs))
|
||||||
elif builtins.is_bool(lhs.type) and builtins.is_bool(rhs.type):
|
elif builtins.is_bool(lhs.type) and builtins.is_bool(rhs.type):
|
||||||
return self.append(ir.Compare(op, lhs, rhs))
|
return self.append(ir.Compare(op, lhs, rhs))
|
||||||
|
|
Loading…
Reference in New Issue