Make lb_type_info use a procedure to load the global value

This commit is contained in:
gingerBill
2024-02-27 15:45:53 +00:00
parent 5137d12d36
commit 5107bdc06b
5 changed files with 9 additions and 12 deletions

View File

@@ -1164,7 +1164,7 @@ gb_internal lbProcedure *lb_create_startup_runtime(lbModule *main_module, lbProc
lbValue data = lb_emit_struct_ep(p, var.var, 0);
lbValue ti = lb_emit_struct_ep(p, var.var, 1);
lb_emit_store(p, data, lb_emit_conv(p, gp, t_rawptr));
lb_emit_store(p, ti, lb_type_info(main_module, var_type));
lb_emit_store(p, ti, lb_type_info(p, var_type));
} else {
LLVMTypeRef vt = llvm_addr_type(p->module, var.var);
lbValue src0 = lb_emit_conv(p, var.init, t);