LLVM codegen for constants in enums could fail.

This commit is contained in:
Christoffer Lerno
2024-08-06 00:28:03 +02:00
parent 387d7d5508
commit b1785606cc
6 changed files with 68 additions and 7 deletions

View File

@@ -7043,6 +7043,12 @@ static void llvm_emit_default_arg(GenContext *c, BEValue *value, Expr *expr)
}
}
void llvm_emit_expr_global_value(GenContext *c, BEValue *value, Expr *expr)
{
sema_cast_const(expr);
llvm_emit_expr(c, value, expr);
assert(!llvm_value_is_addr(value));
}
void llvm_emit_expr(GenContext *c, BEValue *value, Expr *expr)
{
EMIT_LOC(c, expr);