authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-05-23 19:00:48-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-10 20:47:54-07:00
log1b64eed107f54220f85a5158699225b59899a20a
treed488350ff984cabe9e975a8d81364c99819e6d1e
parent484c3e8cbcbd206023468cc16783498bbb662a2c

remove the kludges from std.builtin

I added these in an earlier commit in this branch. This commit removes them before the branch is merged.

2 files changed, 48 insertions(+), 10 deletions(-)

lib/std/builtin.zig-7
...@@ -223,13 +223,6 @@ pub const SourceLocation = struct {...@@ -223,13 +223,6 @@ pub const SourceLocation = struct {
223pub const TypeId = std.meta.Tag(Type);223pub const TypeId = std.meta.Tag(Type);
224pub const TypeInfo = @compileError("deprecated; use Type");224pub const TypeInfo = @compileError("deprecated; use Type");
225225
226/// TODO this is a temporary alias because I don't see any handy methods in
227/// Sema for accessing inner declarations.
228pub const PtrSize = Type.Pointer.Size;
229/// TODO this is a temporary alias because I don't see any handy methods in
230/// Sema for accessing inner declarations.
231pub const TmpContainerLayoutAlias = Type.ContainerLayout;
232
233/// This data structure is used by the Zig language code generation and226/// This data structure is used by the Zig language code generation and
234/// therefore must be kept in sync with the compiler implementation.227/// therefore must be kept in sync with the compiler implementation.
235pub const Type = union(enum) {228pub const Type = union(enum) {
src/Sema.zig+48-3
...@@ -16116,7 +16116,30 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai...@@ -16116,7 +16116,30 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
16116 try info.pointee_type.lazyAbiAlignment(mod, sema.arena);16116 try info.pointee_type.lazyAbiAlignment(mod, sema.arena);
1611716117
16118 const addrspace_ty = try sema.getBuiltinType("AddressSpace");16118 const addrspace_ty = try sema.getBuiltinType("AddressSpace");
16119 const ptr_size_ty = try sema.getBuiltinType("PtrSize");16119 const pointer_ty = t: {
16120 const decl_index = (try sema.namespaceLookup(
16121 block,
16122 src,
16123 (try sema.getBuiltinType("Type")).getNamespaceIndex(mod).unwrap().?,
16124 "Pointer",
16125 )).?;
16126 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
16127 try sema.ensureDeclAnalyzed(decl_index);
16128 const decl = mod.declPtr(decl_index);
16129 break :t decl.val.toType();
16130 };
16131 const ptr_size_ty = t: {
16132 const decl_index = (try sema.namespaceLookup(
16133 block,
16134 src,
16135 pointer_ty.getNamespaceIndex(mod).unwrap().?,
16136 "Size",
16137 )).?;
16138 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
16139 try sema.ensureDeclAnalyzed(decl_index);
16140 const decl = mod.declPtr(decl_index);
16141 break :t decl.val.toType();
16142 };
1612016143
16121 const field_values = try sema.arena.create([8]Value);16144 const field_values = try sema.arena.create([8]Value);
16122 field_values.* = .{16145 field_values.* = .{
...@@ -16469,7 +16492,18 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai...@@ -16469,7 +16492,18 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
16469 break :v try Value.Tag.opt_payload.create(sema.arena, ty_val);16492 break :v try Value.Tag.opt_payload.create(sema.arena, ty_val);
16470 } else Value.null;16493 } else Value.null;
1647116494
16472 const container_layout_ty = try sema.getBuiltinType("TmpContainerLayoutAlias");16495 const container_layout_ty = t: {
16496 const decl_index = (try sema.namespaceLookup(
16497 block,
16498 src,
16499 (try sema.getBuiltinType("Type")).getNamespaceIndex(mod).unwrap().?,
16500 "ContainerLayout",
16501 )).?;
16502 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
16503 try sema.ensureDeclAnalyzed(decl_index);
16504 const decl = mod.declPtr(decl_index);
16505 break :t decl.val.toType();
16506 };
1647316507
16474 const field_values = try sema.arena.create([4]Value);16508 const field_values = try sema.arena.create([4]Value);
16475 field_values.* = .{16509 field_values.* = .{
...@@ -16648,7 +16682,18 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai...@@ -16648,7 +16682,18 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
16648 }16682 }
16649 };16683 };
1665016684
16651 const container_layout_ty = try sema.getBuiltinType("TmpContainerLayoutAlias");16685 const container_layout_ty = t: {
16686 const decl_index = (try sema.namespaceLookup(
16687 block,
16688 src,
16689 (try sema.getBuiltinType("Type")).getNamespaceIndex(mod).unwrap().?,
16690 "ContainerLayout",
16691 )).?;
16692 try mod.declareDeclDependency(sema.owner_decl_index, decl_index);
16693 try sema.ensureDeclAnalyzed(decl_index);
16694 const decl = mod.declPtr(decl_index);
16695 break :t decl.val.toType();
16696 };
1665216697
16653 const field_values = try sema.arena.create([5]Value);16698 const field_values = try sema.arena.create([5]Value);
16654 field_values.* = .{16699 field_values.* = .{