| ... | @@ -467,11 +467,13 @@ const DocData = struct { | ... | @@ -467,11 +467,13 @@ const DocData = struct { |
| 467 | src: ?usize = null, // index into astNodes | 467 | src: ?usize = null, // index into astNodes |
| 468 | ret: Expr, | 468 | ret: Expr, |
| 469 | params: ?[]Expr = null, // (use src->fields to find names) | 469 | params: ?[]Expr = null, // (use src->fields to find names) |
| | 470 | lib_name: []const u8 = "", |
| 470 | is_var_args: bool = false, | 471 | is_var_args: bool = false, |
| 471 | is_inferred_error: bool = false, | 472 | is_inferred_error: bool = false, |
| 472 | has_lib_name: bool = false, | 473 | has_lib_name: bool = false, |
| 473 | has_cc: bool = false, | 474 | has_cc: bool = false, |
| 474 | cc: ?usize = null, | 475 | cc: ?usize = null, |
| | 476 | @"align": ?usize = null, |
| 475 | has_align: bool = false, | 477 | has_align: bool = false, |
| 476 | is_test: bool = false, | 478 | is_test: bool = false, |
| 477 | is_extern: bool = false, | 479 | is_extern: bool = false, |
| ... | @@ -2771,27 +2773,35 @@ fn analyzeFunctionExtended( | ... | @@ -2771,27 +2773,35 @@ fn analyzeFunctionExtended( |
| 2771 | }; | 2773 | }; |
| 2772 | | 2774 | |
| 2773 | self.ast_nodes.items[self_ast_node_index].fields = param_ast_indexes.items; | 2775 | self.ast_nodes.items[self_ast_node_index].fields = param_ast_indexes.items; |
| 2774 | const inst_data = data[inst_index].pl_node; | | |
| 2775 | | 2776 | |
| | 2777 | const inst_data = data[inst_index].pl_node; |
| 2776 | const extra = file.zir.extraData(Zir.Inst.ExtendedFunc, inst_data.payload_index); | 2778 | const extra = file.zir.extraData(Zir.Inst.ExtendedFunc, inst_data.payload_index); |
| | 2779 | |
| | 2780 | var extra_index: usize = extra.end; |
| | 2781 | |
| | 2782 | var lib_name: []const u8 = ""; |
| | 2783 | if (extra.data.bits.has_lib_name) { |
| | 2784 | lib_name = file.zir.nullTerminatedString(file.zir.extra[extra_index]); |
| | 2785 | extra_index += 1; |
| | 2786 | } |
| | 2787 | |
| 2777 | var cc_index: ?usize = null; | 2788 | var cc_index: ?usize = null; |
| | 2789 | var align_index: ?usize = null; |
| 2778 | if (extra.data.bits.has_cc) { | 2790 | if (extra.data.bits.has_cc) { |
| 2779 | const cc_ref = @intToEnum(Zir.Inst.Ref, file.zir.extra[extra.end]); | 2791 | const cc_ref = @intToEnum(Zir.Inst.Ref, file.zir.extra[extra_index]); |
| 2780 | cc_index = self.exprs.items.len; | 2792 | cc_index = self.exprs.items.len; |
| 2781 | _ = try self.walkRef(file, scope, cc_ref, false); | 2793 | _ = try self.walkRef(file, scope, cc_ref, false); |
| | 2794 | extra_index += 1; |
| | 2795 | } |
| | 2796 | |
| | 2797 | if (extra.data.bits.has_align) { |
| | 2798 | const align_ref = @intToEnum(Zir.Inst.Ref, file.zir.extra[extra_index]); |
| | 2799 | align_index = self.exprs.items.len; |
| | 2800 | _ = try self.walkRef(file, scope, align_ref, false); |
| 2782 | } | 2801 | } |
| 2783 | | 2802 | |
| 2784 | self.types.items[type_slot_index] = .{ | 2803 | self.types.items[type_slot_index] = .{ |
| 2785 | .Fn = .{ | 2804 | .Fn = .{ .name = "todo_name func", .src = self_ast_node_index, .params = param_type_refs.items, .ret = ret_type_ref.expr, .is_extern = extra.data.bits.is_extern, .has_cc = extra.data.bits.has_cc, .has_align = extra.data.bits.has_align, .has_lib_name = extra.data.bits.has_lib_name, .lib_name = lib_name, .is_inferred_error = extra.data.bits.is_inferred_error, .cc = cc_index, .@"align" = align_index }, |
| 2786 | .name = "todo_name func", | | |
| 2787 | .src = self_ast_node_index, | | |
| 2788 | .params = param_type_refs.items, | | |
| 2789 | .ret = ret_type_ref.expr, | | |
| 2790 | .is_extern = extra.data.bits.is_extern, | | |
| 2791 | .has_cc = extra.data.bits.has_cc, | | |
| 2792 | .is_inferred_error = extra.data.bits.is_inferred_error, | | |
| 2793 | .cc = cc_index, | | |
| 2794 | }, | | |
| 2795 | }; | 2805 | }; |
| 2796 | | 2806 | |
| 2797 | return DocData.WalkResult{ | 2807 | return DocData.WalkResult{ |