aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 5c07b34097..e0a2784e95 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -530,6 +530,11 @@ static LLVMValueRef gen_cast_expr(CodeGen *g, AstNode *node) {
return LLVMBuildFPToUI(g->builder, expr_val, wanted_type->type_ref, "");
}
+ case CastOpBoolToInt:
+ assert(wanted_type->id == TypeTableEntryIdInt);
+ assert(actual_type->id == TypeTableEntryIdBool);
+ return LLVMBuildZExt(g->builder, expr_val, wanted_type->type_ref, "");
+
}
zig_unreachable();
}