Skip to content

Commit 6b173d0

Browse files
committedOct 13, 2014
py2llvm/base_types: fix not on bool
1 parent 7c4450a commit 6b173d0

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed
 

‎artiq/py2llvm/base_types.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def o_float(self, builder):
7474
return r
7575

7676
def o_not(self, builder):
77-
return self.o_bool(builder, True)
77+
return self.o_bool(builder, inv=True)
7878

7979
def o_neg(self, builder):
8080
r = VInt(self.nbits)
@@ -185,12 +185,6 @@ def __init__(self):
185185
def set_const_value(self, builder, b):
186186
VInt.set_const_value(self, builder, int(b))
187187

188-
def o_bool(self, builder):
189-
r = VBool()
190-
if builder is not None:
191-
r.auto_store(builder, self.auto_load(builder))
192-
return r
193-
194188

195189
class VFloat(VGeneric):
196190
def get_llvm_type(self):

‎test/py2llvm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def array_test():
188188

189189

190190
def corner_cases():
191-
two = True + True - False
191+
two = True + True - (not True)
192192
three = two + True//True - False*True
193193
two_float = three - True/True
194194
one_float = two_float - (1.0 == bool(0.1))

0 commit comments

Comments
 (0)
Please sign in to comment.