aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-07-08 18:58:53 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-07-08 18:58:53 +0200
commit1953e7ff4c24f6f41a4c9693aa60b97864db64fe (patch)
treefda017d947b23fd81d7e5cf60927ff542863ffb8 /src
parent8fa5a373f234b8b7b6080cfc3379a066ccf00a04 (diff)
Hardcode i1 for bools
Diffstat (limited to 'src')
-rw-r--r--src/codegen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen.c b/src/codegen.c
index d9f7640..2f640e2 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -198,8 +198,8 @@ codegentypedexpr(struct cgctx ctx, idx_t i, type_t *T, LLVMValueRef *outv)
mpf_clear(x);
return fwdnode(ctx.ast, i);
} else if (T->kind == TYPE_BOOL && TESTBIT(ctx.cnst, i)) {
- *outv = LLVMConstInt(type2llvm(ctx, ctx.types[i]), ctx.folds[i].b,
- false);
+ LLVMTypeRef T = LLVMInt1TypeInContext(ctx.ctx);
+ *outv = LLVMConstInt(T, ctx.folds[i].b, false);
return fwdnode(ctx.ast, i);
}