add bool literals

This commit is contained in:
Josh Wolfe
2015-12-03 12:15:07 -07:00
parent 6494cf208e
commit f1aaf1353e
8 changed files with 52 additions and 2 deletions

View File

@@ -487,6 +487,11 @@ static LLVMValueRef gen_expr(CodeGen *g, AstNode *node) {
return LLVMBuildUnreachable(g->builder);
case NodeTypeVoid:
return nullptr;
case NodeTypeBoolLiteral:
if (node->data.bool_literal)
return LLVMConstAllOnes(LLVMInt1Type());
else
return LLVMConstNull(LLVMInt1Type());
case NodeTypeIfExpr:
return gen_if_expr(g, node);
case NodeTypeNumberLiteral: