diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-02-23 22:22:56 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-02-23 22:22:56 +0000 |
| commit | a982c51c30141b88fd905c02225c2a7efdb39137 (patch) | |
| tree | 3aa5dd201a9fe386cb3f88ad284d8d736d7b5d1a /src | |
| parent | 047c0e4bcc415a1f0e7b55afd57900319e43dbef (diff) | |
Fix minor bugs in IR for slices
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.c | 10 | ||||
| -rw-r--r-- | src/ir_print.c | 4 | ||||
| -rw-r--r-- | src/parser.c | 2 |
3 files changed, 6 insertions, 10 deletions
@@ -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)); } diff --git a/src/ir_print.c b/src/ir_print.c index a7888ce5a..643c429e7 100644 --- a/src/ir_print.c +++ b/src/ir_print.c @@ -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; diff --git a/src/parser.c b/src/parser.c index 289e80ba4..f14f37599 100644 --- a/src/parser.c +++ b/src/parser.c @@ -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); } |