From 1953e7ff4c24f6f41a4c9693aa60b97864db64fe Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 8 Jul 2024 18:58:53 +0200 Subject: Hardcode i1 for bools --- src/codegen.c | 4 ++-- 1 file 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); } -- cgit v1.2.3