authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2021-09-02 14:46:31+02:00
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2021-09-20 02:29:03+02:00
log805e1bffbdcab84717356fb1a7b375369407d9c2
treee6d3eb330017cea8e54eda7171ed75777e3088a0
parent7da9fa6fe2e982d10ebc9c3844d1249a4eb1d514

Address Spaces: Sema basics


5 files changed, 108 insertions(+), 20 deletions(-)

lib/std/builtin.zig+1
......@@ -170,6 +170,7 @@ pub const CallingConvention = enum {
170170/// therefore must be kept in sync with the compiler implementation.
171171pub const AddressSpace = enum {
172172 generic,
173 special,
173174};
174175
175176/// This data structure is used by the Zig language code generation and
src/AstGen.zig+2-2
......@@ -3134,7 +3134,7 @@ fn fnDecl(
31343134 _ = try decl_gz.addBreak(.break_inline, block_inst, func_inst);
31353135 try decl_gz.setBlockBody(block_inst);
31363136
3137 try wip_decls.payload.ensureUnusedCapacity(gpa, 9);
3137 try wip_decls.payload.ensureUnusedCapacity(gpa, 10);
31383138 {
31393139 const contents_hash = std.zig.hashSrc(tree.getNodeSource(decl_node));
31403140 const casted = @bitCast([4]u32, contents_hash);
......@@ -3284,7 +3284,7 @@ fn globalVarDecl(
32843284 _ = try block_scope.addBreak(.break_inline, block_inst, var_inst);
32853285 try block_scope.setBlockBody(block_inst);
32863286
3287 try wip_decls.payload.ensureUnusedCapacity(gpa, 9);
3287 try wip_decls.payload.ensureUnusedCapacity(gpa, 10);
32883288 {
32893289 const contents_hash = std.zig.hashSrc(tree.getNodeSource(node));
32903290 const casted = @bitCast([4]u32, contents_hash);
src/Module.zig+37-16
......@@ -288,6 +288,8 @@ pub const Decl = struct {
288288 align_val: Value,
289289 /// Populated when `has_tv`.
290290 linksection_val: Value,
291 /// Populated when `has_tv`.
292 @"addrspace": std.builtin.AddressSpace,
291293 /// The memory for ty, val, align_val, linksection_val.
292294 /// If this is `null` then there is no memory management needed.
293295 value_arena: ?*std.heap.ArenaAllocator.State = null,
......@@ -351,7 +353,7 @@ pub const Decl = struct {
351353 /// to require re-analysis.
352354 outdated,
353355 },
354 /// Whether `typed_value`, `align_val`, and `linksection_val` are populated.
356 /// Whether `typed_value`, `align_val`, `linksection_val` and `has_addrspace` are populated.
355357 has_tv: bool,
356358 /// If `true` it means the `Decl` is the resource owner of the type/value associated
357359 /// with it. That means when `Decl` is destroyed, the cleanup code should additionally
......@@ -366,8 +368,8 @@ pub const Decl = struct {
366368 is_exported: bool,
367369 /// Whether the ZIR code provides an align instruction.
368370 has_align: bool,
369 /// Whether the ZIR code provides a linksection instruction.
370 has_linksection: bool,
371 /// Whether the ZIR code provides a linksection and address space instruction.
372 has_linksection_or_addrspace: bool,
371373 /// Flag used by garbage collection to mark and sweep.
372374 /// Decls which correspond to an AST node always have this field set to `true`.
373375 /// Anonymous Decls are initialized with this field set to `false` and then it
......@@ -489,14 +491,22 @@ pub const Decl = struct {
489491 if (!decl.has_align) return .none;
490492 assert(decl.zir_decl_index != 0);
491493 const zir = decl.namespace.file_scope.zir;
492 return @intToEnum(Zir.Inst.Ref, zir.extra[decl.zir_decl_index + 6]);
494 return @intToEnum(Zir.Inst.Ref, zir.extra[decl.zir_decl_index + 7]);
493495 }
494496
495497 pub fn zirLinksectionRef(decl: Decl) Zir.Inst.Ref {
496 if (!decl.has_linksection) return .none;
498 if (!decl.has_linksection_or_addrspace) return .none;
497499 assert(decl.zir_decl_index != 0);
498500 const zir = decl.namespace.file_scope.zir;
499 const extra_index = decl.zir_decl_index + 6 + @boolToInt(decl.has_align);
501 const extra_index = decl.zir_decl_index + 7 + @boolToInt(decl.has_align);
502 return @intToEnum(Zir.Inst.Ref, zir.extra[extra_index]);
503 }
504
505 pub fn zirAddrspaceRef(decl: Decl) Zir.Inst.Ref {
506 if (!decl.has_linksection_or_addrspace) return .none;
507 assert(decl.zir_decl_index != 0);
508 const zir = decl.namespace.file_scope.zir;
509 const extra_index = decl.zir_decl_index + 7 + @boolToInt(decl.has_align) + 1;
500510 return @intToEnum(Zir.Inst.Ref, zir.extra[extra_index]);
501511 }
502512
......@@ -3072,7 +3082,7 @@ pub fn semaFile(mod: *Module, file: *Scope.File) SemaError!void {
30723082 new_decl.is_pub = true;
30733083 new_decl.is_exported = false;
30743084 new_decl.has_align = false;
3075 new_decl.has_linksection = false;
3085 new_decl.has_linksection_or_addrspace = false;
30763086 new_decl.ty = struct_ty;
30773087 new_decl.val = struct_val;
30783088 new_decl.has_tv = true;
......@@ -3202,6 +3212,12 @@ fn semaDecl(mod: *Module, decl: *Decl) !bool {
32023212 if (linksection_ref == .none) break :blk Value.initTag(.null_value);
32033213 break :blk (try sema.resolveInstConst(&block_scope, src, linksection_ref)).val;
32043214 };
3215 const address_space = blk: {
3216 const addrspace_ref = decl.zirAddrspaceRef();
3217 if (addrspace_ref == .none) break :blk .generic;
3218 const addrspace_tv = try sema.resolveInstConst(&block_scope, src, addrspace_ref);
3219 break :blk addrspace_tv.val.toEnum(std.builtin.AddressSpace);
3220 };
32053221 // Note this resolves the type of the Decl, not the value; if this Decl
32063222 // is a struct, for example, this resolves `type` (which needs no resolution),
32073223 // not the struct itself.
......@@ -3258,6 +3274,7 @@ fn semaDecl(mod: *Module, decl: *Decl) !bool {
32583274 decl.val = try decl_tv.val.copy(&decl_arena.allocator);
32593275 decl.align_val = try align_val.copy(&decl_arena.allocator);
32603276 decl.linksection_val = try linksection_val.copy(&decl_arena.allocator);
3277 decl.@"addrspace" = address_space;
32613278 decl.has_tv = true;
32623279 decl.owns_tv = owns_tv;
32633280 decl_arena_state.* = decl_arena.state;
......@@ -3319,6 +3336,7 @@ fn semaDecl(mod: *Module, decl: *Decl) !bool {
33193336 decl.val = try decl_tv.val.copy(&decl_arena.allocator);
33203337 decl.align_val = try align_val.copy(&decl_arena.allocator);
33213338 decl.linksection_val = try linksection_val.copy(&decl_arena.allocator);
3339 decl.@"addrspace" = address_space;
33223340 decl.has_tv = true;
33233341 decl_arena_state.* = decl_arena.state;
33243342 decl.value_arena = decl_arena_state;
......@@ -3526,8 +3544,8 @@ pub fn scanNamespace(
35263544
35273545 const decl_sub_index = extra_index;
35283546 extra_index += 7; // src_hash(4) + line(1) + name(1) + value(1)
3529 extra_index += @truncate(u1, flags >> 2);
3530 extra_index += @truncate(u1, flags >> 3);
3547 extra_index += @truncate(u1, flags >> 2); // Align
3548 extra_index += @as(u2, @truncate(u1, flags >> 3)) * 2; // Link section or address space, consists of 2 Refs
35313549
35323550 try scanDecl(&scan_decl_iter, decl_sub_index, flags);
35333551 }
......@@ -3553,10 +3571,10 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi
35533571 const zir = namespace.file_scope.zir;
35543572
35553573 // zig fmt: off
3556 const is_pub = (flags & 0b0001) != 0;
3557 const export_bit = (flags & 0b0010) != 0;
3558 const has_align = (flags & 0b0100) != 0;
3559 const has_linksection = (flags & 0b1000) != 0;
3574 const is_pub = (flags & 0b0001) != 0;
3575 const export_bit = (flags & 0b0010) != 0;
3576 const has_align = (flags & 0b0100) != 0;
3577 const has_linksection_or_addrspace = (flags & 0b1000) != 0;
35603578 // zig fmt: on
35613579
35623580 const line = iter.parent_decl.relativeToLine(zir.extra[decl_sub_index + 4]);
......@@ -3639,7 +3657,7 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi
36393657 new_decl.is_exported = is_exported;
36403658 new_decl.is_usingnamespace = is_usingnamespace;
36413659 new_decl.has_align = has_align;
3642 new_decl.has_linksection = has_linksection;
3660 new_decl.has_linksection_or_addrspace = has_linksection_or_addrspace;
36433661 new_decl.zir_decl_index = @intCast(u32, decl_sub_index);
36443662 new_decl.alive = true; // This Decl corresponds to an AST node and therefore always alive.
36453663 return;
......@@ -3656,7 +3674,7 @@ fn scanDecl(iter: *ScanDeclIter, decl_sub_index: usize, flags: u4) SemaError!voi
36563674 decl.is_exported = is_exported;
36573675 decl.is_usingnamespace = is_usingnamespace;
36583676 decl.has_align = has_align;
3659 decl.has_linksection = has_linksection;
3677 decl.has_linksection_or_addrspace = has_linksection_or_addrspace;
36603678 decl.zir_decl_index = @intCast(u32, decl_sub_index);
36613679 if (decl.getFunction()) |_| {
36623680 switch (mod.comp.bin_file.tag) {
......@@ -4028,6 +4046,7 @@ pub fn allocateNewDecl(mod: *Module, namespace: *Scope.Namespace, src_node: Ast.
40284046 .val = undefined,
40294047 .align_val = undefined,
40304048 .linksection_val = undefined,
4049 .@"addrspace" = undefined,
40314050 .analysis = .unreferenced,
40324051 .deletion_flag = false,
40334052 .zir_decl_index = 0,
......@@ -4052,7 +4071,7 @@ pub fn allocateNewDecl(mod: *Module, namespace: *Scope.Namespace, src_node: Ast.
40524071 .generation = 0,
40534072 .is_pub = false,
40544073 .is_exported = false,
4055 .has_linksection = false,
4074 .has_linksection_or_addrspace = false,
40564075 .has_align = false,
40574076 .alive = false,
40584077 .is_usingnamespace = false,
......@@ -4357,6 +4376,7 @@ pub fn ptrType(
43574376 elem_ty: Type,
43584377 sentinel: ?Value,
43594378 @"align": u32,
4379 @"addrspace": std.builtin.AddressSpace,
43604380 bit_offset: u16,
43614381 host_size: u16,
43624382 mutable: bool,
......@@ -4371,6 +4391,7 @@ pub fn ptrType(
43714391 .pointee_type = elem_ty,
43724392 .sentinel = sentinel,
43734393 .@"align" = @"align",
4394 .@"addrspace" = @"addrspace",
43744395 .bit_offset = bit_offset,
43754396 .host_size = host_size,
43764397 .@"allowzero" = @"allowzero",
src/Sema.zig+26-2
......@@ -3004,7 +3004,7 @@ fn analyzeCall(
30043004 new_decl.is_pub = module_fn.owner_decl.is_pub;
30053005 new_decl.is_exported = module_fn.owner_decl.is_exported;
30063006 new_decl.has_align = module_fn.owner_decl.has_align;
3007 new_decl.has_linksection = module_fn.owner_decl.has_linksection;
3007 new_decl.has_linksection_or_addrspace = module_fn.owner_decl.has_linksection_or_addrspace;
30083008 new_decl.zir_decl_index = module_fn.owner_decl.zir_decl_index;
30093009 new_decl.alive = true; // This Decl is called at runtime.
30103010 new_decl.has_tv = true;
......@@ -3895,6 +3895,7 @@ fn zirFunc(
38953895 ret_ty_body,
38963896 cc,
38973897 Value.initTag(.null_value),
3898 .generic,
38983899 false,
38993900 inferred_error_set,
39003901 false,
......@@ -3911,6 +3912,7 @@ fn funcCommon(
39113912 ret_ty_body: []const Zir.Inst.Index,
39123913 cc: std.builtin.CallingConvention,
39133914 align_val: Value,
3915 address_space: std.builtin.AddressSpace,
39143916 var_args: bool,
39153917 inferred_error_set: bool,
39163918 is_extern: bool,
......@@ -3968,7 +3970,7 @@ fn funcCommon(
39683970 // Hot path for some common function types.
39693971 // TODO can we eliminate some of these Type tag values? seems unnecessarily complicated.
39703972 if (!is_generic and block.params.items.len == 0 and !var_args and
3971 align_val.tag() == .null_value and !inferred_error_set)
3973 align_val.tag() == .null_value and !inferred_error_set and address_space == .generic)
39723974 {
39733975 if (bare_return_type.zigTypeTag() == .NoReturn and cc == .Unspecified) {
39743976 break :fn_ty Type.initTag(.fn_noreturn_no_args);
......@@ -4020,6 +4022,7 @@ fn funcCommon(
40204022 .comptime_params = comptime_params.ptr,
40214023 .return_type = return_type,
40224024 .cc = cc,
4025 .@"addrspace" = address_space,
40234026 .is_var_args = var_args,
40244027 .is_generic = is_generic,
40254028 });
......@@ -6876,6 +6879,7 @@ fn zirPtrTypeSimple(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) Comp
68766879 elem_type,
68776880 null,
68786881 0,
6882 .generic,
68796883 0,
68806884 0,
68816885 inst_data.is_mutable,
......@@ -6908,6 +6912,13 @@ fn zirPtrType(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) CompileErr
69086912 break :blk try sema.resolveAlreadyCoercedInt(block, .unneeded, ref, u32);
69096913 } else 0;
69106914
6915 const address_space = if (inst_data.flags.has_addrspace) blk: {
6916 const ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_i]);
6917 extra_i += 1;
6918 const addrspace_tv = try sema.resolveInstConst(block, .unneeded, ref);
6919 break :blk addrspace_tv.val.toEnum(std.builtin.AddressSpace);
6920 } else .generic;
6921
69116922 const bit_start = if (inst_data.flags.has_bit_range) blk: {
69126923 const ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_i]);
69136924 extra_i += 1;
......@@ -6930,6 +6941,7 @@ fn zirPtrType(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) CompileErr
69306941 elem_type,
69316942 sentinel,
69326943 abi_align,
6944 address_space,
69336945 bit_start,
69346946 bit_end,
69356947 inst_data.flags.is_mutable,
......@@ -8035,6 +8047,7 @@ fn zirFuncExtended(
80358047 const src: LazySrcLoc = .{ .node_offset = extra.data.src_node };
80368048 const cc_src: LazySrcLoc = .{ .node_offset_fn_type_cc = extra.data.src_node };
80378049 const align_src: LazySrcLoc = src; // TODO add a LazySrcLoc that points at align
8050 const addrspace_src: LazySrcLoc = src; // TODO(Snektron) add a LazySrcLoc that points at addrspace
80388051 const small = @bitCast(Zir.Inst.ExtendedFunc.Small, extended.small);
80398052
80408053 var extra_index: usize = extra.end;
......@@ -8059,6 +8072,13 @@ fn zirFuncExtended(
80598072 break :blk align_tv.val;
80608073 } else Value.initTag(.null_value);
80618074
8075 const address_space: std.builtin.AddressSpace = if (small.has_addrspace) blk: {
8076 const addrspace_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
8077 extra_index += 1;
8078 const addrspace_tv = try sema.resolveInstConst(block, addrspace_src, addrspace_ref);
8079 break :blk addrspace_tv.val.toEnum(std.builtin.AddressSpace);
8080 } else .generic;
8081
80628082 const ret_ty_body = sema.code.extra[extra_index..][0..extra.data.ret_body_len];
80638083 extra_index += ret_ty_body.len;
80648084
......@@ -8081,6 +8101,7 @@ fn zirFuncExtended(
80818101 ret_ty_body,
80828102 cc,
80838103 align_val,
8104 address_space,
80848105 is_var_args,
80858106 is_inferred_error,
80868107 is_extern,
......@@ -9693,6 +9714,9 @@ fn analyzeSlice(
96939714 return_elem_type,
96949715 if (end_opt == .none) slice_sentinel else null,
96959716 0, // TODO alignment
9717 // TODO(Snektron) address space, should be inferred from the pointer type.
9718 // TODO(Snektron) address space for slicing a local, should compute address space from context and architecture.
9719 .generic,
96969720 0,
96979721 0,
96989722 !ptr_child.isConstPtr(),
src/type.zig+42
......@@ -289,6 +289,7 @@ pub const Type = extern union {
289289 .pointee_type = Type.initTag(.comptime_int),
290290 .sentinel = null,
291291 .@"align" = 0,
292 .@"addrspace" = .generic,
292293 .bit_offset = 0,
293294 .host_size = 0,
294295 .@"allowzero" = false,
......@@ -300,6 +301,7 @@ pub const Type = extern union {
300301 .pointee_type = Type.initTag(.u8),
301302 .sentinel = null,
302303 .@"align" = 0,
304 .@"addrspace" = .generic,
303305 .bit_offset = 0,
304306 .host_size = 0,
305307 .@"allowzero" = false,
......@@ -311,6 +313,7 @@ pub const Type = extern union {
311313 .pointee_type = self.castPointer().?.data,
312314 .sentinel = null,
313315 .@"align" = 0,
316 .@"addrspace" = .generic,
314317 .bit_offset = 0,
315318 .host_size = 0,
316319 .@"allowzero" = false,
......@@ -322,6 +325,7 @@ pub const Type = extern union {
322325 .pointee_type = self.castPointer().?.data,
323326 .sentinel = null,
324327 .@"align" = 0,
328 .@"addrspace" = .generic,
325329 .bit_offset = 0,
326330 .host_size = 0,
327331 .@"allowzero" = false,
......@@ -333,6 +337,7 @@ pub const Type = extern union {
333337 .pointee_type = self.castPointer().?.data,
334338 .sentinel = null,
335339 .@"align" = 0,
340 .@"addrspace" = .generic,
336341 .bit_offset = 0,
337342 .host_size = 0,
338343 .@"allowzero" = false,
......@@ -344,6 +349,7 @@ pub const Type = extern union {
344349 .pointee_type = Type.initTag(.u8),
345350 .sentinel = null,
346351 .@"align" = 0,
352 .@"addrspace" = .generic,
347353 .bit_offset = 0,
348354 .host_size = 0,
349355 .@"allowzero" = false,
......@@ -355,6 +361,7 @@ pub const Type = extern union {
355361 .pointee_type = self.castPointer().?.data,
356362 .sentinel = null,
357363 .@"align" = 0,
364 .@"addrspace" = .generic,
358365 .bit_offset = 0,
359366 .host_size = 0,
360367 .@"allowzero" = false,
......@@ -366,6 +373,7 @@ pub const Type = extern union {
366373 .pointee_type = Type.initTag(.u8),
367374 .sentinel = null,
368375 .@"align" = 0,
376 .@"addrspace" = .generic,
369377 .bit_offset = 0,
370378 .host_size = 0,
371379 .@"allowzero" = false,
......@@ -377,6 +385,7 @@ pub const Type = extern union {
377385 .pointee_type = self.castPointer().?.data,
378386 .sentinel = null,
379387 .@"align" = 0,
388 .@"addrspace" = .generic,
380389 .bit_offset = 0,
381390 .host_size = 0,
382391 .@"allowzero" = false,
......@@ -388,6 +397,7 @@ pub const Type = extern union {
388397 .pointee_type = self.castPointer().?.data,
389398 .sentinel = null,
390399 .@"align" = 0,
400 .@"addrspace" = .generic,
391401 .bit_offset = 0,
392402 .host_size = 0,
393403 .@"allowzero" = false,
......@@ -399,6 +409,7 @@ pub const Type = extern union {
399409 .pointee_type = self.castPointer().?.data,
400410 .sentinel = null,
401411 .@"align" = 0,
412 .@"addrspace" = .generic,
402413 .bit_offset = 0,
403414 .host_size = 0,
404415 .@"allowzero" = false,
......@@ -410,6 +421,7 @@ pub const Type = extern union {
410421 .pointee_type = self.castPointer().?.data,
411422 .sentinel = null,
412423 .@"align" = 0,
424 .@"addrspace" = .generic,
413425 .bit_offset = 0,
414426 .host_size = 0,
415427 .@"allowzero" = false,
......@@ -462,6 +474,8 @@ pub const Type = extern union {
462474 return false;
463475 if (info_a.host_size != info_b.host_size)
464476 return false;
477 if (info_a.@"addrspace" != info_b.@"addrspace")
478 return false;
465479
466480 const sentinel_a = info_a.sentinel;
467481 const sentinel_b = info_b.sentinel;
......@@ -516,6 +530,8 @@ pub const Type = extern union {
516530 return false;
517531 if (a.fnCallingConvention() != b.fnCallingConvention())
518532 return false;
533 if (a.fnAddressSpace() != b.fnAddressSpace())
534 return false;
519535 const a_param_len = a.fnParamLen();
520536 const b_param_len = b.fnParamLen();
521537 if (a_param_len != b_param_len)
......@@ -822,6 +838,7 @@ pub const Type = extern union {
822838 .return_type = try payload.return_type.copy(allocator),
823839 .param_types = param_types,
824840 .cc = payload.cc,
841 .@"addrspace" = payload.@"addrspace",
825842 .is_var_args = payload.is_var_args,
826843 .is_generic = payload.is_generic,
827844 .comptime_params = comptime_params.ptr,
......@@ -837,6 +854,7 @@ pub const Type = extern union {
837854 .pointee_type = try payload.pointee_type.copy(allocator),
838855 .sentinel = sent,
839856 .@"align" = payload.@"align",
857 .@"addrspace" = payload.@"addrspace",
840858 .bit_offset = payload.bit_offset,
841859 .host_size = payload.host_size,
842860 .@"allowzero" = payload.@"allowzero",
......@@ -983,6 +1001,9 @@ pub const Type = extern union {
9831001 try writer.writeAll(") callconv(.");
9841002 try writer.writeAll(@tagName(payload.cc));
9851003 try writer.writeAll(") ");
1004 if (payload.@"addrspace" != .generic) {
1005 try writer.print("addrspace(.{s}) ", .{ @tagName(payload.@"addrspace") });
1006 }
9861007 ty = payload.return_type;
9871008 continue;
9881009 },
......@@ -1114,6 +1135,9 @@ pub const Type = extern union {
11141135 }
11151136 try writer.writeAll(") ");
11161137 }
1138 if (payload.@"addrspace" != .generic) {
1139 try writer.print("addrspace(.{s}) ", .{ @tagName(payload.@"addrspace") });
1140 }
11171141 if (!payload.mutable) try writer.writeAll("const ");
11181142 if (payload.@"volatile") try writer.writeAll("volatile ");
11191143 if (payload.@"allowzero") try writer.writeAll("allowzero ");
......@@ -2642,6 +2666,18 @@ pub const Type = extern union {
26422666 };
26432667 }
26442668
2669 pub fn fnAddressSpace(self: Type) std.builtin.AddressSpace {
2670 return switch (self.tag()) {
2671 .fn_noreturn_no_args => .generic,
2672 .fn_void_no_args => .generic,
2673 .fn_naked_noreturn_no_args => .generic,
2674 .fn_ccc_void_no_args => .generic,
2675 .function => self.castTag(.function).?.data.@"addrspace",
2676
2677 else => unreachable,
2678 };
2679 }
2680
26452681 pub fn fnInfo(ty: Type) Payload.Function.Data {
26462682 return switch (ty.tag()) {
26472683 .fn_noreturn_no_args => .{
......@@ -2649,6 +2685,7 @@ pub const Type = extern union {
26492685 .comptime_params = undefined,
26502686 .return_type = initTag(.noreturn),
26512687 .cc = .Unspecified,
2688 .@"addrspace" = .generic,
26522689 .is_var_args = false,
26532690 .is_generic = false,
26542691 },
......@@ -2657,6 +2694,7 @@ pub const Type = extern union {
26572694 .comptime_params = undefined,
26582695 .return_type = initTag(.void),
26592696 .cc = .Unspecified,
2697 .@"addrspace" = .generic,
26602698 .is_var_args = false,
26612699 .is_generic = false,
26622700 },
......@@ -2665,6 +2703,7 @@ pub const Type = extern union {
26652703 .comptime_params = undefined,
26662704 .return_type = initTag(.noreturn),
26672705 .cc = .Naked,
2706 .@"addrspace" = .generic,
26682707 .is_var_args = false,
26692708 .is_generic = false,
26702709 },
......@@ -2673,6 +2712,7 @@ pub const Type = extern union {
26732712 .comptime_params = undefined,
26742713 .return_type = initTag(.void),
26752714 .cc = .C,
2715 .@"addrspace" = .generic,
26762716 .is_var_args = false,
26772717 .is_generic = false,
26782718 },
......@@ -3544,6 +3584,7 @@ pub const Type = extern union {
35443584 comptime_params: [*]bool,
35453585 return_type: Type,
35463586 cc: std.builtin.CallingConvention,
3587 @"addrspace": std.builtin.AddressSpace,
35473588 is_var_args: bool,
35483589 is_generic: bool,
35493590
......@@ -3581,6 +3622,7 @@ pub const Type = extern union {
35813622 sentinel: ?Value,
35823623 /// If zero use pointee_type.AbiAlign()
35833624 @"align": u32,
3625 @"addrspace": std.builtin.AddressSpace,
35843626 bit_offset: u16,
35853627 host_size: u16,
35863628 @"allowzero": bool,