mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Fix lb_type_info for the new layout
This commit is contained in:
@@ -119,8 +119,14 @@ gb_internal lbValue lb_type_info(lbModule *m, Type *type) {
|
|||||||
isize index = lb_type_info_index(m->info, type);
|
isize index = lb_type_info_index(m->info, type);
|
||||||
GB_ASSERT(index >= 0);
|
GB_ASSERT(index >= 0);
|
||||||
|
|
||||||
lbValue data = lb_global_type_info_data_ptr(m);
|
LLVMValueRef global = lb_global_type_info_data_ptr(m).value;
|
||||||
return lb_emit_array_epi(m, data, index);
|
|
||||||
|
LLVMValueRef global_array = LLVMGetInitializer(global);
|
||||||
|
LLVMValueRef index_value = LLVMConstInt(lb_type(m, t_int), index, false);
|
||||||
|
lbValue res = {};
|
||||||
|
res.value = LLVMConstPointerCast(LLVMConstExtractElement(global_array, index_value), lb_type(m, t_type_info_ptr));
|
||||||
|
res.type = t_type_info_ptr;
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
gb_internal LLVMTypeRef lb_get_procedure_raw_type(lbModule *m, Type *type) {
|
gb_internal LLVMTypeRef lb_get_procedure_raw_type(lbModule *m, Type *type) {
|
||||||
|
|||||||
Reference in New Issue
Block a user