forked from M-Labs/artiq
1
0
Fork 0

py2llvm/base_types: fix not on bool

This commit is contained in:
Sebastien Bourdeauducq 2014-10-13 19:49:29 +08:00
parent 7c4450a963
commit 6b173d0a9a
2 changed files with 2 additions and 8 deletions

View File

@ -74,7 +74,7 @@ class VInt(VGeneric):
return r return r
def o_not(self, builder): def o_not(self, builder):
return self.o_bool(builder, True) return self.o_bool(builder, inv=True)
def o_neg(self, builder): def o_neg(self, builder):
r = VInt(self.nbits) r = VInt(self.nbits)
@ -185,12 +185,6 @@ class VBool(VInt):
def set_const_value(self, builder, b): def set_const_value(self, builder, b):
VInt.set_const_value(self, builder, int(b)) VInt.set_const_value(self, builder, int(b))
def o_bool(self, builder):
r = VBool()
if builder is not None:
r.auto_store(builder, self.auto_load(builder))
return r
class VFloat(VGeneric): class VFloat(VGeneric):
def get_llvm_type(self): def get_llvm_type(self):

View File

@ -188,7 +188,7 @@ def array_test():
def corner_cases(): def corner_cases():
two = True + True - False two = True + True - (not True)
three = two + True//True - False*True three = two + True//True - False*True
two_float = three - True/True two_float = three - True/True
one_float = two_float - (1.0 == bool(0.1)) one_float = two_float - (1.0 == bool(0.1))