| ... | ... | @@ -162,6 +162,9 @@ pub fn generateZirData(self: *Autodoc) !void { |
| 162 | 162 | .anyerror_type => .{ |
| 163 | 163 | .ErrorSet = .{ .name = tmpbuf.toOwnedSlice() }, |
| 164 | 164 | }, |
| 165 | // .calling_convention_inline, .calling_convention_c, .calling_convention_type => .{ |
| 166 | // .EnumLiteral = .{ .name = tmpbuf.toOwnedSlice() }, |
| 167 | // }, |
| 165 | 168 | }, |
| 166 | 169 | ); |
| 167 | 170 | } |
| ... | ... | @@ -515,7 +518,15 @@ const DocData = struct { |
| 515 | 518 | .Int => |v| try printTypeBody(v, options, w), |
| 516 | 519 | .Float => |v| try printTypeBody(v, options, w), |
| 517 | 520 | .Type => |v| try printTypeBody(v, options, w), |
| 521 | .NoReturn => |v| try printTypeBody(v, options, w), |
| 518 | 522 | .EnumLiteral => |v| try printTypeBody(v, options, w), |
| 523 | .Unanalyzed => |_| { |
| 524 | if (options.whitespace) |ws| try ws.outputIndent(w); |
| 525 | try w.print( |
| 526 | \\"Unanalyzed": "Unanalyzed" |
| 527 | \\ |
| 528 | , .{}); |
| 529 | }, |
| 519 | 530 | .Pointer => |v| { |
| 520 | 531 | if (options.whitespace) |ws| try ws.outputIndent(w); |
| 521 | 532 | try w.print( |
| ... | ... | @@ -2767,12 +2778,16 @@ fn analyzeFunction( |
| 2767 | 2778 | const inst_data = data[inst_index].pl_node; |
| 2768 | 2779 | const extra = file.zir.extraData(Zir.Inst.ExtendedFunc, inst_data.payload_index); |
| 2769 | 2780 | var cc_index: ?usize = null; |
| 2770 | | if (extra.data.bits.has_cc) { |
| 2771 | | // @panic with .calling_convention_inline |
| 2772 | | // const cc_ref = @intToEnum(Zir.Inst.Ref, file.zir.extra[extra.end]); |
| 2773 | | // _ = try self.walkRef(file, scope, cc_ref, false); |
| 2774 | | // cc_index = self.types.items.len - 1; |
| 2775 | | } |
| 2781 | cc_index = self.types.items.len - 1; |
| 2782 | // if (extra.data.bits.has_cc) { |
| 2783 | // const cc = file.zir.extra[extra.end]; |
| 2784 | // const cc_ref = @intToEnum(Zir.Inst.Ref, cc); |
| 2785 | // _ = try self.walkRef(file, scope, cc_ref, false); |
| 2786 | // cc_index = self.types.items.len - 1; |
| 2787 | // std.debug.print("DONE\n", .{}); |
| 2788 | // std.debug.print("cc_ref = {any}\n", .{cc_ref}); |
| 2789 | // std.debug.print("index = {}\n", .{cc_index}); |
| 2790 | // } |
| 2776 | 2791 | |
| 2777 | 2792 | break :blk .{ |
| 2778 | 2793 | .Fn = .{ |
| ... | ... | @@ -2781,7 +2796,7 @@ fn analyzeFunction( |
| 2781 | 2796 | .params = param_type_refs.items, |
| 2782 | 2797 | .ret = ret_type_ref.expr, |
| 2783 | 2798 | .is_extern = extra.data.bits.is_extern, |
| 2784 | | // .has_cc = extra.data.bits.has_cc, |
| 2799 | .has_cc = extra.data.bits.has_cc, |
| 2785 | 2800 | .is_inferred_error = extra.data.bits.is_inferred_error, |
| 2786 | 2801 | .cc = cc_index, |
| 2787 | 2802 | }, |
| ... | ... | @@ -3015,24 +3030,27 @@ fn walkRef( |
| 3015 | 3030 | }; |
| 3016 | 3031 | }, |
| 3017 | 3032 | // TODO: dunno what to do with those |
| 3018 | | // .calling_convention_type => { |
| 3019 | | // return DocData.WalkResult{ |
| 3020 | | // .typeRef = .{ .type = @enumToInt(Ref.calling_convention_type) }, |
| 3021 | | // .expr = .{ .int = .{ .value = 1 } }, |
| 3022 | | // }; |
| 3023 | | // }, |
| 3024 | | // .calling_convention_c => { |
| 3025 | | // return DocData.WalkResult{ |
| 3026 | | // .typeRef = .{ .type = @enumToInt(Ref.calling_convention_c) }, |
| 3027 | | // .expr = .{ .int = .{ .value = 1 } }, |
| 3028 | | // }; |
| 3029 | | // }, |
| 3030 | | // .calling_convention_inline => { |
| 3031 | | // return DocData.WalkResult{ |
| 3032 | | // .typeRef = .{ .type = @enumToInt(Ref.calling_convention_inline) }, |
| 3033 | | // .expr = .{ .int = .{ .value = 1 } }, |
| 3034 | | // }; |
| 3035 | | // }, |
| 3033 | .calling_convention_type => { |
| 3034 | return DocData.WalkResult{ |
| 3035 | // .typeRef = .{ .type = @enumToInt(Ref.calling_convention_type) }, |
| 3036 | .typeRef = .{ .type = @enumToInt(Ref.comptime_int_type) }, |
| 3037 | .expr = .{ .int = .{ .value = 1 } }, |
| 3038 | }; |
| 3039 | }, |
| 3040 | .calling_convention_c => { |
| 3041 | return DocData.WalkResult{ |
| 3042 | // .typeRef = .{ .type = @enumToInt(Ref.calling_convention_c) }, |
| 3043 | .typeRef = .{ .type = @enumToInt(Ref.comptime_int_type) }, |
| 3044 | .expr = .{ .int = .{ .value = 1 } }, |
| 3045 | }; |
| 3046 | }, |
| 3047 | .calling_convention_inline => { |
| 3048 | return DocData.WalkResult{ |
| 3049 | // .typeRef = .{ .type = @enumToInt(Ref.calling_convention_inline) }, |
| 3050 | .typeRef = .{ .type = @enumToInt(Ref.comptime_int_type) }, |
| 3051 | .expr = .{ .int = .{ .value = 1 } }, |
| 3052 | }; |
| 3053 | }, |
| 3036 | 3054 | // .generic_poison => { |
| 3037 | 3055 | // return DocData.WalkResult{ .int = .{ |
| 3038 | 3056 | // .type = @enumToInt(Ref.comptime_int_type), |