import LLVM.AST.FloatingPointPredicate hiding (False, True)
import LLVM.AST.Operand
import LLVM.AST.Type as Type
+import LLVM.AST.Typed
import LLVM.Pretty
import Debug.Trace
buildExpr binds (AST.If cond thenE elseE) = mdo
_ifB <- block `named` "if"
+
condV <- buildExpr binds cond
+ when (typeOf condV /= i1) $ lift $ lift $ Left "Not a boolean"
condBr condV thenB elseB
thenB <- block `named` "then"