mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 13:00:28 +00:00
Fix bugs: Array Literals with constant elements; IR printing of raw procedure types
This commit is contained in:
@@ -7360,7 +7360,7 @@ irAddr ir_build_addr(irProcedure *proc, Ast *expr) {
|
||||
|
||||
case Type_Array: {
|
||||
if (cl->elems.count > 0) {
|
||||
// ir_emit_store(proc, v, ir_add_module_constant(proc->module, type, exact_value_compound(expr)));
|
||||
ir_emit_store(proc, v, ir_add_module_constant(proc->module, type, exact_value_compound(expr)));
|
||||
|
||||
auto temp_data = array_make<irCompoundLitElemTempData>(heap_allocator(), 0, cl->elems.count);
|
||||
defer (array_free(&temp_data));
|
||||
|
||||
@@ -316,8 +316,11 @@ void ir_print_proc_type_without_pointer(irFileBuffer *f, irModule *m, Type *t) {
|
||||
if (t->Proc.return_by_pointer) {
|
||||
ir_print_type(f, m, reduce_tuple_to_single_type(t->Proc.results));
|
||||
// ir_fprintf(f, "* sret noalias ");
|
||||
ir_write_string(f, str_lit("* noalias "));
|
||||
if (param_count > 0) ir_write_string(f, str_lit(", "));
|
||||
// ir_write_string(f, str_lit("* noalias "));
|
||||
ir_write_string(f, str_lit("*"));
|
||||
if (param_count > 0 || t->Proc.calling_convention == ProcCC_Odin) {
|
||||
ir_write_string(f, str_lit(", "));
|
||||
}
|
||||
}
|
||||
isize param_index = 0;
|
||||
for (isize i = 0; i < param_count; i++) {
|
||||
|
||||
@@ -100,7 +100,6 @@ TOKEN_KIND(Token__KeywordBegin, ""), \
|
||||
TOKEN_KIND(Token_defer, "defer"), \
|
||||
TOKEN_KIND(Token_return, "return"), \
|
||||
TOKEN_KIND(Token_proc, "proc"), \
|
||||
TOKEN_KIND(Token_macro, "macro"), \
|
||||
TOKEN_KIND(Token_struct, "struct"), \
|
||||
TOKEN_KIND(Token_union, "union"), \
|
||||
TOKEN_KIND(Token_enum, "enum"), \
|
||||
@@ -121,6 +120,7 @@ TOKEN_KIND(Token__KeywordBegin, ""), \
|
||||
TOKEN_KIND(Token_align_of, "align_of"), \
|
||||
TOKEN_KIND(Token_offset_of, "offset_of"), \
|
||||
TOKEN_KIND(Token_type_of, "type_of"), \
|
||||
TOKEN_KIND(Token_macro, "macro"), \
|
||||
TOKEN_KIND(Token_const, "const"), \
|
||||
TOKEN_KIND(Token_asm, "asm"), \
|
||||
TOKEN_KIND(Token_yield, "yield"), \
|
||||
|
||||
Reference in New Issue
Block a user