Merge pull request #124 from birth-software/update-zig-version

Adapt to Zig master last changes
This commit is contained in:
David 2024-04-01 20:22:08 -06:00 committed by GitHub
commit 92a08cfcf4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4090,7 +4090,7 @@ pub const Debug = struct {
var scope_it: ?*Scope = scope; var scope_it: ?*Scope = scope;
while (scope_it) |s| : (scope_it = s.parent) { while (scope_it) |s| : (scope_it = s.parent) {
if (s.kind == .file) { if (s.kind == .file) {
const file = @fieldParentPtr(File, "scope", s); const file: *File = @fieldParentPtr("scope", s);
const file_index = unit.files.indexOf(file); const file_index = unit.files.indexOf(file);
return file_index; return file_index;
} }
@ -5022,7 +5022,7 @@ pub const Builder = struct {
.basic_block = .null, .basic_block = .null,
}); });
const global_declaration = @fieldParentPtr(Debug.Declaration.Global, "declaration", declaration); const global_declaration: *Debug.Declaration.Global = @fieldParentPtr("declaration", declaration);
switch (global_declaration.initial_value) { switch (global_declaration.initial_value) {
.unresolved => |declaration_node_index| { .unresolved => |declaration_node_index| {
assert(declaration.type == .null); assert(declaration.type == .null);
@ -5188,8 +5188,8 @@ pub const Builder = struct {
assert(declaration.kind == .argument); assert(declaration.kind == .argument);
assert(scope.kind == .function); assert(scope.kind == .function);
const argument_declaration = @fieldParentPtr(Debug.Declaration.Argument, "declaration", declaration); const argument_declaration: *Debug.Declaration.Argument =@fieldParentPtr("declaration", declaration);
const function_scope = @fieldParentPtr(Debug.Scope.Function, "scope", scope); const function_scope: *Debug.Scope.Function = @fieldParentPtr("scope", scope);
const instruction_index = function_scope.argument_map.get(argument_declaration).?; const instruction_index = function_scope.argument_map.get(argument_declaration).?;
return .{ return .{
@ -5211,8 +5211,8 @@ pub const Builder = struct {
assert(declaration.kind == .local); assert(declaration.kind == .local);
assert(scope.kind == .block); assert(scope.kind == .block);
const local_declaration = @fieldParentPtr(Debug.Declaration.Local, "declaration", declaration); const local_declaration: *Debug.Declaration.Local = @fieldParentPtr("declaration", declaration);
const local_scope = @fieldParentPtr(Debug.Scope.Local, "scope", scope); const local_scope: *Debug.Scope.Local = @fieldParentPtr("scope", scope);
if (local_scope.local_declaration_map.get(local_declaration)) |instruction_index| { if (local_scope.local_declaration_map.get(local_declaration)) |instruction_index| {
return .{ return .{
.value = .{ .value = .{
@ -7530,8 +7530,8 @@ pub const Builder = struct {
// Save file type // Save file type
switch (builder.current_scope.kind) { switch (builder.current_scope.kind) {
.file => { .file => {
const global_scope = @fieldParentPtr(Debug.Scope.Global, "scope", builder.current_scope); const global_scope: *Debug.Scope.Global= @fieldParentPtr("scope", builder.current_scope);
const file = @fieldParentPtr(Debug.File, "scope", global_scope); const file: *Debug.File = @fieldParentPtr("scope", global_scope);
file.type = type_index; file.type = type_index;
try unit.scope_container_map.put_no_clobber(context.my_allocator, &struct_type.kind.@"struct".scope.scope, type_index); try unit.scope_container_map.put_no_clobber(context.my_allocator, &struct_type.kind.@"struct".scope.scope, type_index);
}, },
@ -12534,7 +12534,7 @@ pub const Builder = struct {
const stack = try builder.createStackVariable(unit, context, declaration_type, null); const stack = try builder.createStackVariable(unit, context, declaration_type, null);
assert(builder.current_scope.kind == .block); assert(builder.current_scope.kind == .block);
const local_scope = @fieldParentPtr(Debug.Scope.Local, "scope", builder.current_scope); const local_scope: *Debug.Scope.Local = @fieldParentPtr("scope", builder.current_scope);
try local_scope.local_declaration_map.put_no_clobber(context.my_allocator, local_declaration, stack); try local_scope.local_declaration_map.put_no_clobber(context.my_allocator, local_declaration, stack);
const debug_declare_local = try unit.instructions.append(context.my_allocator, .{ const debug_declare_local = try unit.instructions.append(context.my_allocator, .{
@ -14755,7 +14755,7 @@ pub const Builder = struct {
const test_slice_type = test_functions.type; const test_slice_type = test_functions.type;
const test_type = unit.types.get(test_slice_type).slice.child_type; const test_type = unit.types.get(test_slice_type).slice.child_type;
assert(test_functions.kind == .global); assert(test_functions.kind == .global);
const test_functions_global = @fieldParentPtr(Debug.Declaration.Global, "declaration", test_functions); const test_functions_global: *Debug.Declaration.Global = @fieldParentPtr("declaration", test_functions);
assert(test_functions_global.declaration.mutability == .@"var"); assert(test_functions_global.declaration.mutability == .@"var");
const array_type = try unit.getArrayType(context, .{ const array_type = try unit.getArrayType(context, .{
.type = test_type, .type = test_type,