From 0efd0f573157a70d3b936ab6e758da6a2806fa27 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 11 Jun 2024 21:24:33 +0200 Subject: Add some unreachables in places --- src/codegen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/codegen.c') diff --git a/src/codegen.c b/src/codegen.c index ec7a3ef..fd9b0d2 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -27,8 +27,10 @@ codegen(struct ast ast, struct lexemes toks) err("codegen: Expected constant declaration"); size_t expr = ast.kids[i].rhs; - if (ast.kinds[expr] != ASTFN) + if (ast.kinds[expr] != ASTFN) { assert(!"not implemented"); + __builtin_unreachable(); + } size_t proto = ast.kids[expr].lhs, body = ast.kids[expr].rhs; @@ -91,6 +93,7 @@ codegenstmt(LLVMBuilderRef builder, struct ast ast, struct lexemes toks, } assert(!"unreachable"); + __builtin_unreachable(); } size_t @@ -108,4 +111,5 @@ codegenexpr(LLVMBuilderRef builder, struct ast ast, struct lexemes toks, } assert(!"unreachable"); + __builtin_unreachable(); } -- cgit v1.2.3