| ... | @@ -383,12 +383,12 @@ const DocData = struct { | ... | @@ -383,12 +383,12 @@ const DocData = struct { |
| 383 | Pointer: struct { | 383 | Pointer: struct { |
| 384 | size: std.builtin.TypeInfo.Pointer.Size, | 384 | size: std.builtin.TypeInfo.Pointer.Size, |
| 385 | child: Expr, | 385 | child: Expr, |
| 386 | sentinel: ?usize = null, | 386 | sentinel: bool = false, |
| 387 | }, | 387 | }, |
| 388 | Array: struct { | 388 | Array: struct { |
| 389 | len: Expr, | 389 | len: Expr, |
| 390 | child: Expr, | 390 | child: Expr, |
| 391 | sentinel: ?usize = null, | 391 | sentinel: bool = false, |
| 392 | }, | 392 | }, |
| 393 | Struct: struct { | 393 | Struct: struct { |
| 394 | name: []const u8, | 394 | name: []const u8, |
| ... | @@ -767,7 +767,7 @@ fn walkInstruction( | ... | @@ -767,7 +767,7 @@ fn walkInstruction( |
| 767 | .Pointer = .{ | 767 | .Pointer = .{ |
| 768 | .size = .One, | 768 | .size = .One, |
| 769 | .child = .{ .type = arrTypeId }, | 769 | .child = .{ .type = arrTypeId }, |
| 770 | .sentinel = 0, | 770 | .sentinel = true, |
| 771 | // TODO: add sentinel! | 771 | // TODO: add sentinel! |
| 772 | }, | 772 | }, |
| 773 | }); | 773 | }); |
| ... | @@ -851,7 +851,7 @@ fn walkInstruction( | ... | @@ -851,7 +851,7 @@ fn walkInstruction( |
| 851 | const ptr = data[inst_index].ptr_type; | 851 | const ptr = data[inst_index].ptr_type; |
| 852 | const extra = file.zir.extraData(Zir.Inst.PtrType, ptr.payload_index); | 852 | const extra = file.zir.extraData(Zir.Inst.PtrType, ptr.payload_index); |
| 853 | | 853 | |
| 854 | const sentinel: ?usize = if (ptr.flags.has_sentinel) 0 else null; | 854 | const sentinel: bool = if (ptr.flags.has_sentinel) true else false; |
| 855 | | 855 | |
| 856 | const type_slot_index = self.types.items.len; | 856 | const type_slot_index = self.types.items.len; |
| 857 | const elem_type_ref = try self.walkRef( | 857 | const elem_type_ref = try self.walkRef( |
| ... | @@ -903,7 +903,7 @@ fn walkInstruction( | ... | @@ -903,7 +903,7 @@ fn walkInstruction( |
| 903 | .Array = .{ | 903 | .Array = .{ |
| 904 | .len = len.expr, | 904 | .len = len.expr, |
| 905 | .child = elem_type.expr, | 905 | .child = elem_type.expr, |
| 906 | .sentinel = 0, | 906 | .sentinel = true, |
| 907 | }, | 907 | }, |
| 908 | }); | 908 | }); |
| 909 | return DocData.WalkResult{ | 909 | return DocData.WalkResult{ |
| ... | @@ -982,7 +982,7 @@ fn walkInstruction( | ... | @@ -982,7 +982,7 @@ fn walkInstruction( |
| 982 | .value = operands.len, | 982 | .value = operands.len, |
| 983 | .negated = false, | 983 | .negated = false, |
| 984 | }, | 984 | }, |
| 985 | }, .child = array_type.?, .sentinel = 0 }, | 985 | }, .child = array_type.?, .sentinel = true }, |
| 986 | }); | 986 | }); |
| 987 | | 987 | |
| 988 | return DocData.WalkResult{ | 988 | return DocData.WalkResult{ |
| ... | @@ -1090,7 +1090,7 @@ fn walkInstruction( | ... | @@ -1090,7 +1090,7 @@ fn walkInstruction( |
| 1090 | .value = operands.len, | 1090 | .value = operands.len, |
| 1091 | .negated = false, | 1091 | .negated = false, |
| 1092 | }, | 1092 | }, |
| 1093 | }, .child = array_type.?, .sentinel = 0 }, | 1093 | }, .child = array_type.?, .sentinel = true }, |
| 1094 | }); | 1094 | }); |
| 1095 | | 1095 | |
| 1096 | return DocData.WalkResult{ | 1096 | return DocData.WalkResult{ |
| ... | @@ -1312,6 +1312,7 @@ fn walkInstruction( | ... | @@ -1312,6 +1312,7 @@ fn walkInstruction( |
| 1312 | try self.types.append(self.arena, .{ | 1312 | try self.types.append(self.arena, .{ |
| 1313 | .Int = .{ .name = name }, | 1313 | .Int = .{ .name = name }, |
| 1314 | }); | 1314 | }); |
| | 1315 | |
| 1315 | return DocData.WalkResult{ | 1316 | return DocData.WalkResult{ |
| 1316 | .typeRef = .{ .type = @enumToInt(Ref.type_type) }, | 1317 | .typeRef = .{ .type = @enumToInt(Ref.type_type) }, |
| 1317 | .expr = .{ .type = self.types.items.len - 1 }, | 1318 | .expr = .{ .type = self.types.items.len - 1 }, |