| ... | @@ -15797,6 +15797,12 @@ static void ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, Scop | ... | @@ -15797,6 +15797,12 @@ static void ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, Scop |
| 15797 | TypeTableEntry *type_info_definition_data_type = ir_type_info_get_type(ira, "Data", type_info_definition_type); | 15797 | TypeTableEntry *type_info_definition_data_type = ir_type_info_get_type(ira, "Data", type_info_definition_type); |
| 15798 | ensure_complete_type(ira->codegen, type_info_definition_data_type); | 15798 | ensure_complete_type(ira->codegen, type_info_definition_data_type); |
| 15799 | | 15799 | |
| | 15800 | TypeTableEntry *type_info_fn_def_type = ir_type_info_get_type(ira, "FnDef", type_info_definition_data_type); |
| | 15801 | ensure_complete_type(ira->codegen, type_info_fn_def_type); |
| | 15802 | |
| | 15803 | TypeTableEntry *type_info_fn_def_inline_type = ir_type_info_get_type(ira, "Inline", type_info_fn_def_type); |
| | 15804 | ensure_complete_type(ira->codegen, type_info_fn_def_inline_type); |
| | 15805 | |
| 15800 | // Loop through our definitions once to figure out how many definitions we will generate info for. | 15806 | // Loop through our definitions once to figure out how many definitions we will generate info for. |
| 15801 | auto decl_it = decls_scope->decl_table.entry_iterator(); | 15807 | auto decl_it = decls_scope->decl_table.entry_iterator(); |
| 15802 | decltype(decls_scope->decl_table)::Entry *curr_entry = nullptr; | 15808 | decltype(decls_scope->decl_table)::Entry *curr_entry = nullptr; |
| ... | @@ -15905,7 +15911,35 @@ static void ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, Scop | ... | @@ -15905,7 +15911,35 @@ static void ir_make_type_info_defs(IrAnalyze *ira, ConstExprValue *out_val, Scop |
| 15905 | FnTableEntry *fn_entry = ((TldFn *)curr_entry->value)->fn_entry; | 15911 | FnTableEntry *fn_entry = ((TldFn *)curr_entry->value)->fn_entry; |
| 15906 | assert(!fn_entry->is_test); | 15912 | assert(!fn_entry->is_test); |
| 15907 | | 15913 | |
| 15908 | inner_fields[2].data.x_union.payload = nullptr; | 15914 | AstNodeFnProto *fn_node = (AstNodeFnProto *)(fn_entry->proto_node); |
| | 15915 | |
| | 15916 | ConstExprValue *fn_def_val = create_const_vals(1); |
| | 15917 | fn_def_val->special = ConstValSpecialStatic; |
| | 15918 | fn_def_val->type = type_info_fn_def_type; |
| | 15919 | fn_def_val->data.x_struct.parent.id = ConstParentIdUnion; |
| | 15920 | fn_def_val->data.x_struct.parent.data.p_union.union_val = &inner_fields[2]; |
| | 15921 | |
| | 15922 | // @TODO Add fields |
| | 15923 | ConstExprValue *fn_def_fields = create_const_vals(3); |
| | 15924 | fn_def_val->data.x_struct.fields = fn_def_fields; |
| | 15925 | |
| | 15926 | // fn_type: type |
| | 15927 | ensure_field_index(fn_def_val->type, "fn_type", 0); |
| | 15928 | fn_def_fields[0].special = ConstValSpecialStatic; |
| | 15929 | fn_def_fields[0].type = ira->codegen->builtin_types.entry_type; |
| | 15930 | fn_def_fields[0].data.x_type = fn_entry->type_entry; |
| | 15931 | // inline_type: Data.FnDef.Inline |
| | 15932 | ensure_field_index(fn_def_val->type, "inline_type", 1); |
| | 15933 | fn_def_fields[1].special = ConstValSpecialStatic; |
| | 15934 | fn_def_fields[1].type = type_info_fn_def_inline_type; |
| | 15935 | bigint_init_unsigned(&fn_def_fields[1].data.x_enum_tag, fn_entry->fn_inline); |
| | 15936 | // calling_convention: TypeInfo.CallingConvention |
| | 15937 | ensure_field_index(fn_def_val->type, "calling_convention", 2); |
| | 15938 | fn_def_fields[2].special = ConstValSpecialStatic; |
| | 15939 | fn_def_fields[2].type = ir_type_info_get_type(ira, "CallingConvention"); |
| | 15940 | bigint_init_unsigned(&fn_def_fields[2].data.x_enum_tag, fn_node->cc); |
| | 15941 | |
| | 15942 | inner_fields[2].data.x_union.payload = fn_def_val; |
| 15909 | break; | 15943 | break; |
| 15910 | } | 15944 | } |
| 15911 | case TldIdContainer: | 15945 | case TldIdContainer: |