Do not elide memory storage on variable for debug.

This commit is contained in:
Christoffer Lerno
2024-05-17 19:51:35 +02:00
parent ff8b78fc99
commit a16d41a1e1
4 changed files with 51 additions and 19 deletions

View File

@@ -6246,13 +6246,12 @@ static inline void llvm_emit_macro_block(GenContext *c, BEValue *be_value, Expr
Expr *init_expr = val->var.init_expr;
BEValue value;
llvm_emit_expr(c, &value, init_expr);
if (llvm_value_is_addr(&value) || val->var.is_written || val->var.is_addr)
if (llvm_value_is_addr(&value) || val->var.is_written || val->var.is_addr || llvn_use_accurate_debug_info(c))
{
llvm_emit_and_set_decl_alloca(c, val);
llvm_store_decl(c, val, &value);
continue;
}
val->is_value = true;
val->backend_value = value.value;
FOREACH_END();