mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-20 16:36:46 +00:00
Fix minor bugs in IR for slices
This commit is contained in:
@@ -6353,14 +6353,12 @@ void ir_gen_tree(irGen *s) {
|
||||
CheckerInfo *info = proc->module->info;
|
||||
|
||||
if (true) {
|
||||
irValue *global_type_infos = ir_find_global_variable(proc, str_lit("__type_infos"));
|
||||
irValue *global_type_table = ir_find_global_variable(proc, str_lit("__type_table"));
|
||||
Type *type = base_type(type_deref(ir_type(ir_global_type_info_data)));
|
||||
GB_ASSERT(is_type_array(type));
|
||||
irValue *array_data = ir_emit_array_epi(proc, ir_global_type_info_data, 0);
|
||||
irValue *array_count = ir_make_const_int(proc->module->allocator, type->Array.count);
|
||||
|
||||
ir_emit_store(proc, ir_emit_struct_ep(proc, global_type_infos, 0), array_data);
|
||||
ir_emit_store(proc, ir_emit_struct_ep(proc, global_type_infos, 1), array_count);
|
||||
ir_fill_slice(proc, global_type_table,
|
||||
ir_emit_array_epi(proc, ir_global_type_info_data, 0),
|
||||
ir_make_const_int(proc->module->allocator, type->Array.count));
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-3
@@ -195,7 +195,7 @@ void ir_print_type(irFileBuffer *f, irModule *m, Type *t) {
|
||||
return;
|
||||
case Type_DynamicArray:
|
||||
ir_fprintf(f, "{");
|
||||
ir_print_type(f, m, t->Slice.elem);
|
||||
ir_print_type(f, m, t->DynamicArray.elem);
|
||||
ir_fprintf(f, "*, i%lld, i%lld,", word_bits, word_bits);
|
||||
ir_print_type(f, m, t_allocator);
|
||||
ir_fprintf(f, "}");
|
||||
@@ -616,8 +616,6 @@ void ir_print_value(irFileBuffer *f, irModule *m, irValue *value, Type *type_hin
|
||||
ir_print_type(f, m, t_int);
|
||||
ir_fprintf(f, " 0, i32 0), ");
|
||||
ir_print_type(f, m, t_int);
|
||||
ir_fprintf(f, " %lld, ", cs->count);
|
||||
ir_print_type(f, m, t_int);
|
||||
ir_fprintf(f, " %lld}", cs->count);
|
||||
}
|
||||
} break;
|
||||
|
||||
+1
-1
@@ -3475,7 +3475,7 @@ AstNode *parse_stmt(AstFile *f) {
|
||||
syntax_error(token, "#include is not a valid import declaration kind. Use #load instead");
|
||||
s = ast_bad_stmt(f, token, f->curr_token);
|
||||
} else {
|
||||
syntax_error(token, "Unknown tag used: `%.*s`", LIT(tag));
|
||||
syntax_error(token, "Unknown tag directive used: `%.*s`", LIT(tag));
|
||||
s = ast_bad_stmt(f, token, f->curr_token);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user