From 6b173d0a9a34e27d9638ef94e8c744fab8563ba5 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 13 Oct 2014 19:49:29 +0800 Subject: [PATCH] py2llvm/base_types: fix not on bool --- artiq/py2llvm/base_types.py | 8 +------- test/py2llvm.py | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/artiq/py2llvm/base_types.py b/artiq/py2llvm/base_types.py index 2da9541e3..fe214748e 100644 --- a/artiq/py2llvm/base_types.py +++ b/artiq/py2llvm/base_types.py @@ -74,7 +74,7 @@ class VInt(VGeneric): return r def o_not(self, builder): - return self.o_bool(builder, True) + return self.o_bool(builder, inv=True) def o_neg(self, builder): r = VInt(self.nbits) @@ -185,12 +185,6 @@ class VBool(VInt): def set_const_value(self, builder, 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): def get_llvm_type(self): diff --git a/test/py2llvm.py b/test/py2llvm.py index e149329b9..cbfcb22c7 100644 --- a/test/py2llvm.py +++ b/test/py2llvm.py @@ -188,7 +188,7 @@ def array_test(): def corner_cases(): - two = True + True - False + two = True + True - (not True) three = two + True//True - False*True two_float = three - True/True one_float = two_float - (1.0 == bool(0.1))