| author | |
| committer | |
| log | e41e75a4862e955266a7e760133ea757e5afb8ce |
| tree | 03dcceb5e2cdf88289040cc8b37c79c58f0a0a4c |
| parent | a2ff3a13fe22b5693bbd719bf4eaee06a9d6be57 |
10 files changed, 40 insertions(+), 28 deletions(-)
src/AstGen.zig-8| ... | @@ -9072,14 +9072,6 @@ const GenZir = struct { | ... | @@ -9072,14 +9072,6 @@ const GenZir = struct { |
| 9072 | return @intCast(u32, gz.decl_line + astgen.source_line); | 9072 | return @intCast(u32, gz.decl_line + astgen.source_line); |
| 9073 | } | 9073 | } |
| 9074 | 9074 | ||
| 9075 | fn tokSrcLoc(gz: GenZir, token_index: ast.TokenIndex) LazySrcLoc { | ||
| 9076 | return .{ .token_offset = token_index - gz.srcToken() }; | ||
| 9077 | } | ||
| 9078 | |||
| 9079 | fn nodeSrcLoc(gz: GenZir, node_index: ast.Node.Index) LazySrcLoc { | ||
| 9080 | return .{ .node_offset = gz.nodeIndexToRelative(node_index) }; | ||
| 9081 | } | ||
| 9082 | |||
| 9083 | fn nodeIndexToRelative(gz: GenZir, node_index: ast.Node.Index) i32 { | 9075 | fn nodeIndexToRelative(gz: GenZir, node_index: ast.Node.Index) i32 { |
| 9084 | return @bitCast(i32, node_index) - @bitCast(i32, gz.decl_node_index); | 9076 | return @bitCast(i32, node_index) - @bitCast(i32, gz.decl_node_index); |
| 9085 | } | 9077 | } |
src/clang_options_data.zig+7-1| ... | @@ -1,6 +1,12 @@ | ... | @@ -1,6 +1,12 @@ |
| 1 | // This file is generated by tools/update_clang_options.zig. | 1 | // This file is generated by tools/update_clang_options.zig. |
| 2 | // zig fmt: off | 2 | // zig fmt: off |
| 3 | usingnamespace @import("clang_options.zig"); | 3 | const clang_options = @import("clang_options.zig"); |
| 4 | const CliArg = clang_options.CliArg; | ||
| 5 | const flagpd1 = clang_options.flagpd1; | ||
| 6 | const flagpsl = clang_options.flagpsl; | ||
| 7 | const joinpd1 = clang_options.joinpd1; | ||
| 8 | const jspd1 = clang_options.jspd1; | ||
| 9 | const sepd1 = clang_options.sepd1; | ||
| 4 | pub const data = blk: { @setEvalBranchQuota(6000); break :blk &[_]CliArg{ | 10 | pub const data = blk: { @setEvalBranchQuota(6000); break :blk &[_]CliArg{ |
| 5 | flagpd1("C"), | 11 | flagpd1("C"), |
| 6 | flagpd1("CC"), | 12 | flagpd1("CC"), |
src/codegen/spirv/spec.zig+2-2| ... | @@ -582,8 +582,8 @@ pub const Opcode = enum(u16) { | ... | @@ -582,8 +582,8 @@ pub const Opcode = enum(u16) { |
| 582 | OpSpecConstantCompositeContinuedINTEL = 6092, | 582 | OpSpecConstantCompositeContinuedINTEL = 6092, |
| 583 | _, | 583 | _, |
| 584 | 584 | ||
| 585 | const OpReportIntersectionKHR = OpReportIntersectionNV; | 585 | const OpReportIntersectionKHR: Opcode = .OpReportIntersectionNV; |
| 586 | const OpTypeAccelerationStructureKHR = OpTypeAccelerationStructureNV; | 586 | const OpTypeAccelerationStructureKHR: Opcode = .OpTypeAccelerationStructureNV; |
| 587 | }; | 587 | }; |
| 588 | pub const ImageOperands = packed struct { | 588 | pub const ImageOperands = packed struct { |
| 589 | Bias: bool align(@alignOf(u32)) = false, | 589 | Bias: bool align(@alignOf(u32)) = false, |
src/libc_installation.zig+3-3| ... | @@ -12,7 +12,7 @@ const is_haiku = Target.current.os.tag == .haiku; | ... | @@ -12,7 +12,7 @@ const is_haiku = Target.current.os.tag == .haiku; |
| 12 | 12 | ||
| 13 | const log = std.log.scoped(.libc_installation); | 13 | const log = std.log.scoped(.libc_installation); |
| 14 | 14 | ||
| 15 | usingnamespace @import("windows_sdk.zig"); | 15 | const ZigWindowsSDK = @import("windows_sdk.zig").ZigWindowsSDK; |
| 16 | 16 | ||
| 17 | /// See the render function implementation for documentation of the fields. | 17 | /// See the render function implementation for documentation of the fields. |
| 18 | pub const LibCInstallation = struct { | 18 | pub const LibCInstallation = struct { |
| ... | @@ -183,9 +183,9 @@ pub const LibCInstallation = struct { | ... | @@ -183,9 +183,9 @@ pub const LibCInstallation = struct { |
| 183 | if (!build_options.have_llvm) | 183 | if (!build_options.have_llvm) |
| 184 | return error.WindowsSdkNotFound; | 184 | return error.WindowsSdkNotFound; |
| 185 | var sdk: *ZigWindowsSDK = undefined; | 185 | var sdk: *ZigWindowsSDK = undefined; |
| 186 | switch (zig_find_windows_sdk(&sdk)) { | 186 | switch (ZigWindowsSDK.find(&sdk)) { |
| 187 | .None => { | 187 | .None => { |
| 188 | defer zig_free_windows_sdk(sdk); | 188 | defer sdk.free(); |
| 189 | 189 | ||
| 190 | var batch = Batch(FindError!void, 5, .auto_async).init(); | 190 | var batch = Batch(FindError!void, 5, .auto_async).init(); |
| 191 | batch.add(&async self.findNativeMsvcIncludeDir(args, sdk)); | 191 | batch.add(&async self.findNativeMsvcIncludeDir(args, sdk)); |
src/link/MachO/DebugSymbols.zig+4-1| ... | @@ -20,7 +20,10 @@ const SrcFn = MachO.SrcFn; | ... | @@ -20,7 +20,10 @@ const SrcFn = MachO.SrcFn; |
| 20 | const TextBlock = MachO.TextBlock; | 20 | const TextBlock = MachO.TextBlock; |
| 21 | const padToIdeal = MachO.padToIdeal; | 21 | const padToIdeal = MachO.padToIdeal; |
| 22 | 22 | ||
| 23 | usingnamespace @import("commands.zig"); | 23 | const commands = @import("commands.zig"); |
| 24 | const emptyHeader = commands.emptyHeader; | ||
| 25 | const LoadCommand = commands.LoadCommand; | ||
| 26 | const SegmentCommand = commands.SegmentCommand; | ||
| 24 | 27 | ||
| 25 | const page_size: u16 = 0x1000; | 28 | const page_size: u16 = 0x1000; |
| 26 | 29 |
src/link/tapi/parse/test.zig+2-2| ... | @@ -1,8 +1,8 @@ | ... | @@ -1,8 +1,8 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const mem = std.mem; | 2 | const mem = std.mem; |
| 3 | const testing = std.testing; | 3 | const testing = std.testing; |
| 4 | 4 | const Tree = @import("../parse.zig").Tree; | |
| 5 | usingnamespace @import("../parse.zig"); | 5 | const Node = @import("../parse.zig").Node; |
| 6 | 6 | ||
| 7 | test "explicit doc" { | 7 | test "explicit doc" { |
| 8 | const source = | 8 | const source = |
src/type.zig+1-1| ... | @@ -197,7 +197,7 @@ pub const Type = extern union { | ... | @@ -197,7 +197,7 @@ pub const Type = extern union { |
| 197 | /// Prefer `castTag` to this. | 197 | /// Prefer `castTag` to this. |
| 198 | pub fn cast(self: Type, comptime T: type) ?*T { | 198 | pub fn cast(self: Type, comptime T: type) ?*T { |
| 199 | if (@hasField(T, "base_tag")) { | 199 | if (@hasField(T, "base_tag")) { |
| 200 | return base.castTag(T.base_tag); | 200 | return self.castTag(T.base_tag); |
| 201 | } | 201 | } |
| 202 | if (self.tag_if_small_enough < Tag.no_payload_count) { | 202 | if (self.tag_if_small_enough < Tag.no_payload_count) { |
| 203 | return null; | 203 | return null; |
src/value.zig+1-1| ... | @@ -315,7 +315,7 @@ pub const Value = extern union { | ... | @@ -315,7 +315,7 @@ pub const Value = extern union { |
| 315 | /// Prefer `castTag` to this. | 315 | /// Prefer `castTag` to this. |
| 316 | pub fn cast(self: Value, comptime T: type) ?*T { | 316 | pub fn cast(self: Value, comptime T: type) ?*T { |
| 317 | if (@hasField(T, "base_tag")) { | 317 | if (@hasField(T, "base_tag")) { |
| 318 | return base.castTag(T.base_tag); | 318 | return self.castTag(T.base_tag); |
| 319 | } | 319 | } |
| 320 | if (self.tag_if_small_enough < Tag.no_payload_count) { | 320 | if (self.tag_if_small_enough < Tag.no_payload_count) { |
| 321 | return null; | 321 | return null; |
src/windows_sdk.zig+13-8| ... | @@ -11,12 +11,17 @@ pub const ZigWindowsSDK = extern struct { | ... | @@ -11,12 +11,17 @@ pub const ZigWindowsSDK = extern struct { |
| 11 | version81_len: usize, | 11 | version81_len: usize, |
| 12 | msvc_lib_dir_ptr: ?[*]const u8, | 12 | msvc_lib_dir_ptr: ?[*]const u8, |
| 13 | msvc_lib_dir_len: usize, | 13 | msvc_lib_dir_len: usize, |
| 14 | |||
| 15 | pub const find = zig_find_windows_sdk; | ||
| 16 | pub const free = zig_free_windows_sdk; | ||
| 17 | |||
| 18 | pub const FindError = enum(c_int) { | ||
| 19 | None, | ||
| 20 | OutOfMemory, | ||
| 21 | NotFound, | ||
| 22 | PathTooLong, | ||
| 23 | }; | ||
| 24 | |||
| 25 | extern fn zig_find_windows_sdk(out_sdk: **ZigWindowsSDK) FindError; | ||
| 26 | extern fn zig_free_windows_sdk(sdk: *ZigWindowsSDK) void; | ||
| 14 | }; | 27 | }; |
| 15 | pub const ZigFindWindowsSdkError = enum(c_int) { | ||
| 16 | None, | ||
| 17 | OutOfMemory, | ||
| 18 | NotFound, | ||
| 19 | PathTooLong, | ||
| 20 | }; | ||
| 21 | pub extern fn zig_find_windows_sdk(out_sdk: **ZigWindowsSDK) ZigFindWindowsSdkError; | ||
| 22 | pub extern fn zig_free_windows_sdk(sdk: *ZigWindowsSDK) void; |
tools/update_clang_options.zig+7-1| ... | @@ -473,7 +473,13 @@ pub fn main() anyerror!void { | ... | @@ -473,7 +473,13 @@ pub fn main() anyerror!void { |
| 473 | try stdout.writeAll( | 473 | try stdout.writeAll( |
| 474 | \\// This file is generated by tools/update_clang_options.zig. | 474 | \\// This file is generated by tools/update_clang_options.zig. |
| 475 | \\// zig fmt: off | 475 | \\// zig fmt: off |
| 476 | \\usingnamespace @import("clang_options.zig"); | 476 | \\const clang_options = @import("clang_options.zig"); |
| 477 | \\const CliArg = clang_options.CliArg; | ||
| 478 | \\const flagpd1 = clang_options.flagpd1; | ||
| 479 | \\const flagpsl = clang_options.flagpsl; | ||
| 480 | \\const joinpd1 = clang_options.joinpd1; | ||
| 481 | \\const jspd1 = clang_options.jspd1; | ||
| 482 | \\const sepd1 = clang_options.sepd1; | ||
| 477 | \\pub const data = blk: { @setEvalBranchQuota(6000); break :blk &[_]CliArg{ | 483 | \\pub const data = blk: { @setEvalBranchQuota(6000); break :blk &[_]CliArg{ |
| 478 | \\ | 484 | \\ |
| 479 | ); | 485 | ); |