| ... | ... | @@ -400,7 +400,13 @@ const DocData = struct { |
| 400 | 400 | size: std.builtin.TypeInfo.Pointer.Size, |
| 401 | 401 | child: Expr, |
| 402 | 402 | sentinel: ?Expr = null, |
| 403 | | is_mutable: bool = true, |
| 403 | is_allowzero: bool = false, |
| 404 | is_mutable: bool = false, |
| 405 | is_volatile: bool = false, |
| 406 | has_sentinel: bool = false, |
| 407 | has_align: bool = false, |
| 408 | has_addrspace: bool = false, |
| 409 | has_bit_range: bool = false, |
| 404 | 410 | }, |
| 405 | 411 | Array: struct { |
| 406 | 412 | len: Expr, |
| ... | ... | @@ -507,9 +513,15 @@ const DocData = struct { |
| 507 | 513 | try w.print(",", .{}); |
| 508 | 514 | } |
| 509 | 515 | try w.print( |
| 516 | \\"is_allowzero": {}, |
| 510 | 517 | \\"is_mutable": {}, |
| 518 | \\"is_volatile": {}, |
| 519 | \\"has_sentinel": {}, |
| 520 | \\"has_align": {}, |
| 521 | \\"has_addrspace": {}, |
| 522 | \\"has_bit_range": {}, |
| 511 | 523 | \\ |
| 512 | | , .{v.is_mutable}); |
| 524 | , .{ v.is_allowzero, v.is_mutable, v.is_volatile, v.has_sentinel, v.has_align, v.has_addrspace, v.has_bit_range }); |
| 513 | 525 | if (options.whitespace) |ws| try ws.outputIndent(w); |
| 514 | 526 | try w.print( |
| 515 | 527 | \\"child": |
| ... | ... | @@ -880,11 +892,7 @@ fn walkInstruction( |
| 880 | 892 | const type_slot_index = self.types.items.len; |
| 881 | 893 | const elem_type_ref = try self.walkRef(file, parent_scope, ptr.elem_type, false); |
| 882 | 894 | try self.types.append(self.arena, .{ |
| 883 | | .Pointer = .{ |
| 884 | | .size = ptr.size, |
| 885 | | .child = elem_type_ref.expr, |
| 886 | | .is_mutable = ptr.is_mutable, |
| 887 | | }, |
| 895 | .Pointer = .{ .size = ptr.size, .child = elem_type_ref.expr, .is_mutable = ptr.is_mutable, .is_volatile = ptr.is_volatile, .is_allowzero = ptr.is_allowzero }, |
| 888 | 896 | }); |
| 889 | 897 | |
| 890 | 898 | return DocData.WalkResult{ |
| ... | ... | @@ -904,8 +912,10 @@ fn walkInstruction( |
| 904 | 912 | false, |
| 905 | 913 | ); |
| 906 | 914 | |
| 915 | const sentinel: ?DocData.Expr = if (ptr.flags.has_sentinel) DocData.Expr{ .int = .{ .value = 0, .negated = false } } else null; |
| 916 | |
| 907 | 917 | try self.types.append(self.arena, .{ |
| 908 | | .Pointer = .{ .size = ptr.size, .child = elem_type_ref.expr, .sentinel = .{ .int = .{ .value = 0, .negated = false } }, .is_mutable = ptr.flags.is_mutable }, |
| 918 | .Pointer = .{ .size = ptr.size, .child = elem_type_ref.expr, .sentinel = sentinel, .is_mutable = ptr.flags.is_mutable, .has_align = ptr.flags.has_align, .has_sentinel = ptr.flags.has_sentinel, .is_volatile = ptr.flags.is_volatile, .has_addrspace = ptr.flags.has_addrspace, .has_bit_range = ptr.flags.has_bit_range }, |
| 909 | 919 | }); |
| 910 | 920 | return DocData.WalkResult{ |
| 911 | 921 | .typeRef = .{ .type = @enumToInt(Ref.type_type) }, |
| ... | ... | @@ -1194,6 +1204,20 @@ fn walkInstruction( |
| 1194 | 1204 | .expr = .{ .float = float }, |
| 1195 | 1205 | }; |
| 1196 | 1206 | }, |
| 1207 | .float128 => { |
| 1208 | const pl_node = data[inst_index].pl_node; |
| 1209 | const extra = file.zir.extraData(Zir.Inst.Float128, pl_node.payload_index); |
| 1210 | _ = pl_node; |
| 1211 | _ = extra; |
| 1212 | |
| 1213 | // printWithContext( |
| 1214 | // file, |
| 1215 | // inst_index, |
| 1216 | // "TODO: implement `{s}` for walkInstruction\n\n", |
| 1217 | // .{@tagName(tags[inst_index])}, |
| 1218 | // ); |
| 1219 | return self.cteTodo(@tagName(tags[inst_index])); |
| 1220 | }, |
| 1197 | 1221 | .negate => { |
| 1198 | 1222 | const un_node = data[inst_index].un_node; |
| 1199 | 1223 | var operand: DocData.WalkResult = try self.walkRef( |
| ... | ... | @@ -1481,6 +1505,27 @@ fn walkInstruction( |
| 1481 | 1505 | .expr = .{ .@"struct" = field_vals }, |
| 1482 | 1506 | }; |
| 1483 | 1507 | }, |
| 1508 | .struct_init_empty => { |
| 1509 | const un_node = data[inst_index].un_node; |
| 1510 | var operand: DocData.WalkResult = try self.walkRef( |
| 1511 | file, |
| 1512 | parent_scope, |
| 1513 | un_node.operand, |
| 1514 | false, |
| 1515 | ); |
| 1516 | |
| 1517 | _ = operand; |
| 1518 | |
| 1519 | // WIP |
| 1520 | |
| 1521 | printWithContext( |
| 1522 | file, |
| 1523 | inst_index, |
| 1524 | "TODO: implement `{s}` for walkInstruction\n\n", |
| 1525 | .{@tagName(tags[inst_index])}, |
| 1526 | ); |
| 1527 | return self.cteTodo(@tagName(tags[inst_index])); |
| 1528 | }, |
| 1484 | 1529 | .error_set_decl => { |
| 1485 | 1530 | const pl_node = data[inst_index].pl_node; |
| 1486 | 1531 | const extra = file.zir.extraData(Zir.Inst.ErrorSetDecl, pl_node.payload_index); |
| ... | ... | @@ -1630,7 +1675,7 @@ fn walkInstruction( |
| 1630 | 1675 | .negated = false, |
| 1631 | 1676 | }, |
| 1632 | 1677 | }, |
| 1633 | | .child = array_type.?, |
| 1678 | .child = .{ .type = 0 }, |
| 1634 | 1679 | }, |
| 1635 | 1680 | }); |
| 1636 | 1681 | const result = DocData.WalkResult{ |
| ... | ... | @@ -2657,7 +2702,7 @@ fn analyzeFunction( |
| 2657 | 2702 | self.ast_nodes.appendAssumeCapacity(.{ |
| 2658 | 2703 | .name = name, |
| 2659 | 2704 | .docs = "", |
| 2660 | | .@"comptime" = true, |
| 2705 | .@"comptime" = tags[param_index] == .param_anytype_comptime, |
| 2661 | 2706 | }); |
| 2662 | 2707 | |
| 2663 | 2708 | param_type_refs.appendAssumeCapacity( |