| author | |
| committer | |
| log | b384a7f85859678657f0ee91041be27078dfd346 |
| tree | 2c1c4f983074b916bdc8331a8613755528c63522 |
| parent | 15204cc210e4010bfbd033f81aebad5df38bcde8 |
it's almost like all these references to Package actually wanted to be
references to Module instead...25 files changed, 82 insertions(+), 84 deletions(-)
src/Builtin.zig+1-1| ... | @@ -370,7 +370,7 @@ const std = @import("std"); | ... | @@ -370,7 +370,7 @@ const std = @import("std"); |
| 370 | const Allocator = std.mem.Allocator; | 370 | const Allocator = std.mem.Allocator; |
| 371 | const Cache = std.Build.Cache; | 371 | const Cache = std.Build.Cache; |
| 372 | const build_options = @import("build_options"); | 372 | const build_options = @import("build_options"); |
| 373 | const Module = @import("Package/Module.zig"); | 373 | const Module = @import("Module.zig"); |
| 374 | const assert = std.debug.assert; | 374 | const assert = std.debug.assert; |
| 375 | const AstGen = std.zig.AstGen; | 375 | const AstGen = std.zig.AstGen; |
| 376 | const File = @import("Zcu.zig").File; | 376 | const File = @import("Zcu.zig").File; |
src/Compilation.zig+24-24| ... | @@ -16,7 +16,6 @@ const fatal = std.process.fatal; | ... | @@ -16,7 +16,6 @@ const fatal = std.process.fatal; |
| 16 | const Value = @import("Value.zig"); | 16 | const Value = @import("Value.zig"); |
| 17 | const Type = @import("Type.zig"); | 17 | const Type = @import("Type.zig"); |
| 18 | const target_util = @import("target.zig"); | 18 | const target_util = @import("target.zig"); |
| 19 | const Package = @import("Package.zig"); | ||
| 20 | const link = @import("link.zig"); | 19 | const link = @import("link.zig"); |
| 21 | const tracy = @import("tracy.zig"); | 20 | const tracy = @import("tracy.zig"); |
| 22 | const trace = tracy.trace; | 21 | const trace = tracy.trace; |
| ... | @@ -43,6 +42,7 @@ const Air = @import("Air.zig"); | ... | @@ -43,6 +42,7 @@ const Air = @import("Air.zig"); |
| 43 | const Builtin = @import("Builtin.zig"); | 42 | const Builtin = @import("Builtin.zig"); |
| 44 | const LlvmObject = @import("codegen/llvm.zig").Object; | 43 | const LlvmObject = @import("codegen/llvm.zig").Object; |
| 45 | const dev = @import("dev.zig"); | 44 | const dev = @import("dev.zig"); |
| 45 | const Module = @import("Module.zig"); | ||
| 46 | 46 | ||
| 47 | pub const Config = @import("Compilation/Config.zig"); | 47 | pub const Config = @import("Compilation/Config.zig"); |
| 48 | 48 | ||
| ... | @@ -63,7 +63,7 @@ cache_use: CacheUse, | ... | @@ -63,7 +63,7 @@ cache_use: CacheUse, |
| 63 | /// All compilations have a root module because this is where some important | 63 | /// All compilations have a root module because this is where some important |
| 64 | /// settings are stored, such as target and optimization mode. This module | 64 | /// settings are stored, such as target and optimization mode. This module |
| 65 | /// might not have any .zig code associated with it, however. | 65 | /// might not have any .zig code associated with it, however. |
| 66 | root_mod: *Package.Module, | 66 | root_mod: *Module, |
| 67 | 67 | ||
| 68 | /// User-specified settings that have all the defaults resolved into concrete values. | 68 | /// User-specified settings that have all the defaults resolved into concrete values. |
| 69 | config: Config, | 69 | config: Config, |
| ... | @@ -766,7 +766,7 @@ pub const CrtFile = struct { | ... | @@ -766,7 +766,7 @@ pub const CrtFile = struct { |
| 766 | /// For passing to a C compiler. | 766 | /// For passing to a C compiler. |
| 767 | pub const CSourceFile = struct { | 767 | pub const CSourceFile = struct { |
| 768 | /// Many C compiler flags are determined by settings contained in the owning Module. | 768 | /// Many C compiler flags are determined by settings contained in the owning Module. |
| 769 | owner: *Package.Module, | 769 | owner: *Module, |
| 770 | src_path: []const u8, | 770 | src_path: []const u8, |
| 771 | extra_flags: []const []const u8 = &.{}, | 771 | extra_flags: []const []const u8 = &.{}, |
| 772 | /// Same as extra_flags except they are not added to the Cache hash. | 772 | /// Same as extra_flags except they are not added to the Cache hash. |
| ... | @@ -778,7 +778,7 @@ pub const CSourceFile = struct { | ... | @@ -778,7 +778,7 @@ pub const CSourceFile = struct { |
| 778 | 778 | ||
| 779 | /// For passing to resinator. | 779 | /// For passing to resinator. |
| 780 | pub const RcSourceFile = struct { | 780 | pub const RcSourceFile = struct { |
| 781 | owner: *Package.Module, | 781 | owner: *Module, |
| 782 | src_path: []const u8, | 782 | src_path: []const u8, |
| 783 | extra_flags: []const []const u8 = &.{}, | 783 | extra_flags: []const []const u8 = &.{}, |
| 784 | }; | 784 | }; |
| ... | @@ -1216,7 +1216,7 @@ pub const MiscError = struct { | ... | @@ -1216,7 +1216,7 @@ pub const MiscError = struct { |
| 1216 | }; | 1216 | }; |
| 1217 | 1217 | ||
| 1218 | pub const cache_helpers = struct { | 1218 | pub const cache_helpers = struct { |
| 1219 | pub fn addModule(hh: *Cache.HashHelper, mod: *const Package.Module) void { | 1219 | pub fn addModule(hh: *Cache.HashHelper, mod: *const Module) void { |
| 1220 | addResolvedTarget(hh, mod.resolved_target); | 1220 | addResolvedTarget(hh, mod.resolved_target); |
| 1221 | hh.add(mod.optimize_mode); | 1221 | hh.add(mod.optimize_mode); |
| 1222 | hh.add(mod.code_model); | 1222 | hh.add(mod.code_model); |
| ... | @@ -1239,7 +1239,7 @@ pub const cache_helpers = struct { | ... | @@ -1239,7 +1239,7 @@ pub const cache_helpers = struct { |
| 1239 | 1239 | ||
| 1240 | pub fn addResolvedTarget( | 1240 | pub fn addResolvedTarget( |
| 1241 | hh: *Cache.HashHelper, | 1241 | hh: *Cache.HashHelper, |
| 1242 | resolved_target: Package.Module.ResolvedTarget, | 1242 | resolved_target: Module.ResolvedTarget, |
| 1243 | ) void { | 1243 | ) void { |
| 1244 | const target = &resolved_target.result; | 1244 | const target = &resolved_target.result; |
| 1245 | hh.add(target.cpu.arch); | 1245 | hh.add(target.cpu.arch); |
| ... | @@ -1412,16 +1412,16 @@ pub const CreateOptions = struct { | ... | @@ -1412,16 +1412,16 @@ pub const CreateOptions = struct { |
| 1412 | /// Options that have been resolved by calling `resolveDefaults`. | 1412 | /// Options that have been resolved by calling `resolveDefaults`. |
| 1413 | config: Compilation.Config, | 1413 | config: Compilation.Config, |
| 1414 | 1414 | ||
| 1415 | root_mod: *Package.Module, | 1415 | root_mod: *Module, |
| 1416 | /// Normally, `main_mod` and `root_mod` are the same. The exception is `zig | 1416 | /// Normally, `main_mod` and `root_mod` are the same. The exception is `zig |
| 1417 | /// test`, in which `root_mod` is the test runner, and `main_mod` is the | 1417 | /// test`, in which `root_mod` is the test runner, and `main_mod` is the |
| 1418 | /// user's source file which has the tests. | 1418 | /// user's source file which has the tests. |
| 1419 | main_mod: ?*Package.Module = null, | 1419 | main_mod: ?*Module = null, |
| 1420 | /// This is provided so that the API user has a chance to tweak the | 1420 | /// This is provided so that the API user has a chance to tweak the |
| 1421 | /// per-module settings of the standard library. | 1421 | /// per-module settings of the standard library. |
| 1422 | /// When this is null, a default configuration of the std lib is created | 1422 | /// When this is null, a default configuration of the std lib is created |
| 1423 | /// based on the settings of root_mod. | 1423 | /// based on the settings of root_mod. |
| 1424 | std_mod: ?*Package.Module = null, | 1424 | std_mod: ?*Module = null, |
| 1425 | root_name: []const u8, | 1425 | root_name: []const u8, |
| 1426 | sysroot: ?[]const u8 = null, | 1426 | sysroot: ?[]const u8 = null, |
| 1427 | cache_mode: CacheMode, | 1427 | cache_mode: CacheMode, |
| ... | @@ -1763,7 +1763,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, | ... | @@ -1763,7 +1763,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, |
| 1763 | if (compiler_rt_strat == .zcu) { | 1763 | if (compiler_rt_strat == .zcu) { |
| 1764 | // For objects, this mechanism relies on essentially `_ = @import("compiler-rt");` | 1764 | // For objects, this mechanism relies on essentially `_ = @import("compiler-rt");` |
| 1765 | // injected into the object. | 1765 | // injected into the object. |
| 1766 | const compiler_rt_mod = Package.Module.create(arena, .{ | 1766 | const compiler_rt_mod = Module.create(arena, .{ |
| 1767 | .paths = .{ | 1767 | .paths = .{ |
| 1768 | .root = .zig_lib_root, | 1768 | .root = .zig_lib_root, |
| 1769 | .root_src_path = "compiler_rt.zig", | 1769 | .root_src_path = "compiler_rt.zig", |
| ... | @@ -1825,7 +1825,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, | ... | @@ -1825,7 +1825,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, |
| 1825 | }; | 1825 | }; |
| 1826 | 1826 | ||
| 1827 | if (ubsan_rt_strat == .zcu) { | 1827 | if (ubsan_rt_strat == .zcu) { |
| 1828 | const ubsan_rt_mod = Package.Module.create(arena, .{ | 1828 | const ubsan_rt_mod = Module.create(arena, .{ |
| 1829 | .paths = .{ | 1829 | .paths = .{ |
| 1830 | .root = .zig_lib_root, | 1830 | .root = .zig_lib_root, |
| 1831 | .root_src_path = "ubsan_rt.zig", | 1831 | .root_src_path = "ubsan_rt.zig", |
| ... | @@ -1866,7 +1866,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, | ... | @@ -1866,7 +1866,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, |
| 1866 | }; | 1866 | }; |
| 1867 | 1867 | ||
| 1868 | if (zigc_strat == .zcu) { | 1868 | if (zigc_strat == .zcu) { |
| 1869 | const zigc_mod = Package.Module.create(arena, .{ | 1869 | const zigc_mod = Module.create(arena, .{ |
| 1870 | .paths = .{ | 1870 | .paths = .{ |
| 1871 | .root = .zig_lib_root, | 1871 | .root = .zig_lib_root, |
| 1872 | .root_src_path = "c.zig", | 1872 | .root_src_path = "c.zig", |
| ... | @@ -1996,7 +1996,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, | ... | @@ -1996,7 +1996,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, |
| 1996 | .path = try options.dirs.global_cache.join(arena, &.{zir_sub_dir}), | 1996 | .path = try options.dirs.global_cache.join(arena, &.{zir_sub_dir}), |
| 1997 | }; | 1997 | }; |
| 1998 | 1998 | ||
| 1999 | const std_mod = options.std_mod orelse Package.Module.create(arena, .{ | 1999 | const std_mod = options.std_mod orelse Module.create(arena, .{ |
| 2000 | .paths = .{ | 2000 | .paths = .{ |
| 2001 | .root = try .fromRoot(arena, options.dirs, .zig_lib, "std"), | 2001 | .root = try .fromRoot(arena, options.dirs, .zig_lib, "std"), |
| 2002 | .root_src_path = "std.zig", | 2002 | .root_src_path = "std.zig", |
| ... | @@ -4639,7 +4639,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void { | ... | @@ -4639,7 +4639,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void { |
| 4639 | var buffer: [1024]u8 = undefined; | 4639 | var buffer: [1024]u8 = undefined; |
| 4640 | var tar_file_writer = tar_file.writer(io, &buffer); | 4640 | var tar_file_writer = tar_file.writer(io, &buffer); |
| 4641 | 4641 | ||
| 4642 | var seen_table: std.array_hash_map.Auto(*Package.Module, []const u8) = .empty; | 4642 | var seen_table: std.array_hash_map.Auto(*Module, []const u8) = .empty; |
| 4643 | defer seen_table.deinit(comp.gpa); | 4643 | defer seen_table.deinit(comp.gpa); |
| 4644 | 4644 | ||
| 4645 | try seen_table.put(comp.gpa, zcu.main_mod, comp.root_name); | 4645 | try seen_table.put(comp.gpa, zcu.main_mod, comp.root_name); |
| ... | @@ -4666,7 +4666,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void { | ... | @@ -4666,7 +4666,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void { |
| 4666 | 4666 | ||
| 4667 | fn docsCopyModule( | 4667 | fn docsCopyModule( |
| 4668 | comp: *Compilation, | 4668 | comp: *Compilation, |
| 4669 | module: *Package.Module, | 4669 | module: *Module, |
| 4670 | name: []const u8, | 4670 | name: []const u8, |
| 4671 | tar_file_writer: *Io.File.Writer, | 4671 | tar_file_writer: *Io.File.Writer, |
| 4672 | ) !void { | 4672 | ) !void { |
| ... | @@ -4746,7 +4746,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU | ... | @@ -4746,7 +4746,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU |
| 4746 | 4746 | ||
| 4747 | const optimize_mode = std.lang.OptimizeMode.ReleaseSmall; | 4747 | const optimize_mode = std.lang.OptimizeMode.ReleaseSmall; |
| 4748 | const output_mode = std.lang.OutputMode.Exe; | 4748 | const output_mode = std.lang.OutputMode.Exe; |
| 4749 | const resolved_target: Package.Module.ResolvedTarget = .{ | 4749 | const resolved_target: Module.ResolvedTarget = .{ |
| 4750 | .result = std.zig.system.resolveTargetQuery(io, .{ | 4750 | .result = std.zig.system.resolveTargetQuery(io, .{ |
| 4751 | .cpu_arch = .wasm32, | 4751 | .cpu_arch = .wasm32, |
| 4752 | .os_tag = .freestanding, | 4752 | .os_tag = .freestanding, |
| ... | @@ -4786,7 +4786,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU | ... | @@ -4786,7 +4786,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU |
| 4786 | 4786 | ||
| 4787 | const dirs = comp.dirs.withoutLocalCache(); | 4787 | const dirs = comp.dirs.withoutLocalCache(); |
| 4788 | 4788 | ||
| 4789 | const root_mod = Package.Module.create(arena, .{ | 4789 | const root_mod = Module.create(arena, .{ |
| 4790 | .paths = .{ | 4790 | .paths = .{ |
| 4791 | .root = try .fromRoot(arena, dirs, .zig_lib, "docs/wasm"), | 4791 | .root = try .fromRoot(arena, dirs, .zig_lib, "docs/wasm"), |
| 4792 | .root_src_path = src_basename, | 4792 | .root_src_path = src_basename, |
| ... | @@ -4803,7 +4803,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU | ... | @@ -4803,7 +4803,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU |
| 4803 | comp.lockAndSetMiscFailure(.docs_wasm, "sub-compilation of docs_wasm failed: failed to create root module: {t}", .{err}); | 4803 | comp.lockAndSetMiscFailure(.docs_wasm, "sub-compilation of docs_wasm failed: failed to create root module: {t}", .{err}); |
| 4804 | return error.AlreadyReported; | 4804 | return error.AlreadyReported; |
| 4805 | }; | 4805 | }; |
| 4806 | const walk_mod = Package.Module.create(arena, .{ | 4806 | const walk_mod = Module.create(arena, .{ |
| 4807 | .paths = .{ | 4807 | .paths = .{ |
| 4808 | .root = try .fromRoot(arena, dirs, .zig_lib, "docs/wasm"), | 4808 | .root = try .fromRoot(arena, dirs, .zig_lib, "docs/wasm"), |
| 4809 | .root_src_path = "Walk.zig", | 4809 | .root_src_path = "Walk.zig", |
| ... | @@ -4888,7 +4888,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU | ... | @@ -4888,7 +4888,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU |
| 4888 | 4888 | ||
| 4889 | pub fn obtainCObjectCacheManifest( | 4889 | pub fn obtainCObjectCacheManifest( |
| 4890 | comp: *const Compilation, | 4890 | comp: *const Compilation, |
| 4891 | owner_mod: *Package.Module, | 4891 | owner_mod: *Module, |
| 4892 | ) Cache.Manifest { | 4892 | ) Cache.Manifest { |
| 4893 | var man = comp.cache_parent.obtain(); | 4893 | var man = comp.cache_parent.obtain(); |
| 4894 | 4894 | ||
| ... | @@ -4936,7 +4936,7 @@ pub fn translateC( | ... | @@ -4936,7 +4936,7 @@ pub fn translateC( |
| 4936 | ext: FileExt, | 4936 | ext: FileExt, |
| 4937 | source_path: []const u8, | 4937 | source_path: []const u8, |
| 4938 | translated_basename: []const u8, | 4938 | translated_basename: []const u8, |
| 4939 | owner_mod: *Package.Module, | 4939 | owner_mod: *Module, |
| 4940 | prog_node: std.Progress.Node, | 4940 | prog_node: std.Progress.Node, |
| 4941 | environ_map: *const std.process.Environ.Map, | 4941 | environ_map: *const std.process.Environ.Map, |
| 4942 | ) !TranslateCResult { | 4942 | ) !TranslateCResult { |
| ... | @@ -6092,7 +6092,7 @@ fn addCommonCCArgs( | ... | @@ -6092,7 +6092,7 @@ fn addCommonCCArgs( |
| 6092 | argv: *std.array_list.Managed([]const u8), | 6092 | argv: *std.array_list.Managed([]const u8), |
| 6093 | ext: FileExt, | 6093 | ext: FileExt, |
| 6094 | out_dep_path: ?[]const u8, | 6094 | out_dep_path: ?[]const u8, |
| 6095 | mod: *Package.Module, | 6095 | mod: *Module, |
| 6096 | c_frontend: Config.CFrontend, | 6096 | c_frontend: Config.CFrontend, |
| 6097 | ) !void { | 6097 | ) !void { |
| 6098 | const target = &mod.resolved_target.result; | 6098 | const target = &mod.resolved_target.result; |
| ... | @@ -6446,7 +6446,7 @@ pub fn addCCArgs( | ... | @@ -6446,7 +6446,7 @@ pub fn addCCArgs( |
| 6446 | argv: *std.array_list.Managed([]const u8), | 6446 | argv: *std.array_list.Managed([]const u8), |
| 6447 | ext: FileExt, | 6447 | ext: FileExt, |
| 6448 | out_dep_path: ?[]const u8, | 6448 | out_dep_path: ?[]const u8, |
| 6449 | mod: *Package.Module, | 6449 | mod: *Module, |
| 6450 | ) !void { | 6450 | ) !void { |
| 6451 | const target = &mod.resolved_target.result; | 6451 | const target = &mod.resolved_target.result; |
| 6452 | 6452 | ||
| ... | @@ -7237,7 +7237,7 @@ fn buildOutputFromZig( | ... | @@ -7237,7 +7237,7 @@ fn buildOutputFromZig( |
| 7237 | return error.AlreadyReported; | 7237 | return error.AlreadyReported; |
| 7238 | }; | 7238 | }; |
| 7239 | 7239 | ||
| 7240 | const root_mod = Package.Module.create(arena, .{ | 7240 | const root_mod = Module.create(arena, .{ |
| 7241 | .paths = .{ | 7241 | .paths = .{ |
| 7242 | .root = .zig_lib_root, | 7242 | .root = .zig_lib_root, |
| 7243 | .root_src_path = src_basename, | 7243 | .root_src_path = src_basename, |
| ... | @@ -7384,7 +7384,7 @@ pub fn build_crt_file( | ... | @@ -7384,7 +7384,7 @@ pub fn build_crt_file( |
| 7384 | comp.lockAndSetMiscFailure(misc_task_tag, "sub-compilation of {t} failed: failed to resolve compilation config: {t}", .{ misc_task_tag, err }); | 7384 | comp.lockAndSetMiscFailure(misc_task_tag, "sub-compilation of {t} failed: failed to resolve compilation config: {t}", .{ misc_task_tag, err }); |
| 7385 | return error.AlreadyReported; | 7385 | return error.AlreadyReported; |
| 7386 | }; | 7386 | }; |
| 7387 | const root_mod = Package.Module.create(arena, .{ | 7387 | const root_mod = Module.create(arena, .{ |
| 7388 | .paths = .{ | 7388 | .paths = .{ |
| 7389 | .root = .zig_lib_root, | 7389 | .root = .zig_lib_root, |
| 7390 | .root_src_path = "", | 7390 | .root_src_path = "", |
src/Compilation/Config.zig+1-1| ... | @@ -577,7 +577,7 @@ pub fn resolve(options: Options) ResolveError!Config { | ... | @@ -577,7 +577,7 @@ pub fn resolve(options: Options) ResolveError!Config { |
| 577 | } | 577 | } |
| 578 | 578 | ||
| 579 | const std = @import("std"); | 579 | const std = @import("std"); |
| 580 | const Module = @import("../Package.zig").Module; | 580 | const Module = @import("../Module.zig"); |
| 581 | const Config = @This(); | 581 | const Config = @This(); |
| 582 | const target_util = @import("../target.zig"); | 582 | const target_util = @import("../target.zig"); |
| 583 | const build_options = @import("build_options"); | 583 | const build_options = @import("build_options"); |
src/Module.zig+4-4| ... | @@ -6,10 +6,10 @@ const Allocator = std.mem.Allocator; | ... | @@ -6,10 +6,10 @@ const Allocator = std.mem.Allocator; |
| 6 | const Cache = std.Build.Cache; | 6 | const Cache = std.Build.Cache; |
| 7 | const assert = std.debug.assert; | 7 | const assert = std.debug.assert; |
| 8 | 8 | ||
| 9 | const target_util = @import("../target.zig"); | 9 | const target_util = @import("target.zig"); |
| 10 | const Builtin = @import("../Builtin.zig"); | 10 | const Builtin = @import("Builtin.zig"); |
| 11 | const Compilation = @import("../Compilation.zig"); | 11 | const Compilation = @import("Compilation.zig"); |
| 12 | const File = @import("../Zcu.zig").File; | 12 | const File = @import("Zcu.zig").File; |
| 13 | 13 | ||
| 14 | /// The root directory of the module. Only files inside this directory can be imported. | 14 | /// The root directory of the module. Only files inside this directory can be imported. |
| 15 | root: Compilation.Path, | 15 | root: Compilation.Path, |
src/Sema.zig+2-2| ... | @@ -25,7 +25,6 @@ const SemaError = Zcu.SemaError; | ... | @@ -25,7 +25,6 @@ const SemaError = Zcu.SemaError; |
| 25 | const LazySrcLoc = Zcu.LazySrcLoc; | 25 | const LazySrcLoc = Zcu.LazySrcLoc; |
| 26 | const RangeSet = @import("RangeSet.zig"); | 26 | const RangeSet = @import("RangeSet.zig"); |
| 27 | const target_util = @import("target.zig"); | 27 | const target_util = @import("target.zig"); |
| 28 | const Package = @import("Package.zig"); | ||
| 29 | const crash_report = @import("crash_report.zig"); | 28 | const crash_report = @import("crash_report.zig"); |
| 30 | const build_options = @import("build_options"); | 29 | const build_options = @import("build_options"); |
| 31 | const Compilation = @import("Compilation.zig"); | 30 | const Compilation = @import("Compilation.zig"); |
| ... | @@ -36,6 +35,7 @@ const ComptimeAllocIndex = InternPool.ComptimeAllocIndex; | ... | @@ -36,6 +35,7 @@ const ComptimeAllocIndex = InternPool.ComptimeAllocIndex; |
| 36 | const Cache = std.Build.Cache; | 35 | const Cache = std.Build.Cache; |
| 37 | const LowerZon = @import("Sema/LowerZon.zig"); | 36 | const LowerZon = @import("Sema/LowerZon.zig"); |
| 38 | const arith = @import("Sema/arith.zig"); | 37 | const arith = @import("Sema/arith.zig"); |
| 38 | const Module = @import("Module.zig"); | ||
| 39 | 39 | ||
| 40 | pt: Zcu.PerThread, | 40 | pt: Zcu.PerThread, |
| 41 | /// Alias to `zcu.gpa`. | 41 | /// Alias to `zcu.gpa`. |
| ... | @@ -839,7 +839,7 @@ pub const Block = struct { | ... | @@ -839,7 +839,7 @@ pub const Block = struct { |
| 839 | return result_index; | 839 | return result_index; |
| 840 | } | 840 | } |
| 841 | 841 | ||
| 842 | pub fn ownerModule(block: Block) *Package.Module { | 842 | pub fn ownerModule(block: Block) *Module { |
| 843 | const zcu = block.sema.pt.zcu; | 843 | const zcu = block.sema.pt.zcu; |
| 844 | return zcu.namespacePtr(block.namespace).fileScope(zcu).mod.?; | 844 | return zcu.namespacePtr(block.namespace).fileScope(zcu).mod.?; |
| 845 | } | 845 | } |
src/Zcu.zig+15-15| ... | @@ -25,7 +25,7 @@ const Compilation = @import("Compilation.zig"); | ... | @@ -25,7 +25,7 @@ const Compilation = @import("Compilation.zig"); |
| 25 | const Cache = std.Build.Cache; | 25 | const Cache = std.Build.Cache; |
| 26 | pub const Value = @import("Value.zig"); | 26 | pub const Value = @import("Value.zig"); |
| 27 | pub const Type = @import("Type.zig"); | 27 | pub const Type = @import("Type.zig"); |
| 28 | const Package = @import("Package.zig"); | 28 | const Module = @import("Module.zig"); |
| 29 | const link = @import("link.zig"); | 29 | const link = @import("link.zig"); |
| 30 | const Air = @import("Air.zig"); | 30 | const Air = @import("Air.zig"); |
| 31 | const Zir = std.zig.Zir; | 31 | const Zir = std.zig.Zir; |
| ... | @@ -64,11 +64,11 @@ comp: *Compilation, | ... | @@ -64,11 +64,11 @@ comp: *Compilation, |
| 64 | llvm_object: ?LlvmObject.Ptr, | 64 | llvm_object: ?LlvmObject.Ptr, |
| 65 | 65 | ||
| 66 | /// Pointer to externally managed resource. | 66 | /// Pointer to externally managed resource. |
| 67 | root_mod: *Package.Module, | 67 | root_mod: *Module, |
| 68 | /// Normally, `main_mod` and `root_mod` are the same. The exception is `zig test`, in which | 68 | /// Normally, `main_mod` and `root_mod` are the same. The exception is `zig test`, in which |
| 69 | /// `root_mod` is the test runner, and `main_mod` is the user's source file which has the tests. | 69 | /// `root_mod` is the test runner, and `main_mod` is the user's source file which has the tests. |
| 70 | main_mod: *Package.Module, | 70 | main_mod: *Module, |
| 71 | std_mod: *Package.Module, | 71 | std_mod: *Module, |
| 72 | sema_prog_node: std.Progress.Node = .none, | 72 | sema_prog_node: std.Progress.Node = .none, |
| 73 | codegen_prog_node: std.Progress.Node = .none, | 73 | codegen_prog_node: std.Progress.Node = .none, |
| 74 | /// The number of codegen jobs which are pending or in-progress. Whichever thread drops this value | 74 | /// The number of codegen jobs which are pending or in-progress. Whichever thread drops this value |
| ... | @@ -105,11 +105,11 @@ multi_exports: std.array_hash_map.Auto(AnalUnit, extern struct { | ... | @@ -105,11 +105,11 @@ multi_exports: std.array_hash_map.Auto(AnalUnit, extern struct { |
| 105 | }) = .{}, | 105 | }) = .{}, |
| 106 | 106 | ||
| 107 | /// Key is the digest returned by `Builtin.hash`; value is the corresponding module. | 107 | /// Key is the digest returned by `Builtin.hash`; value is the corresponding module. |
| 108 | builtin_modules: std.array_hash_map.Auto(Cache.BinDigest, *Package.Module) = .empty, | 108 | builtin_modules: std.array_hash_map.Auto(Cache.BinDigest, *Module) = .empty, |
| 109 | 109 | ||
| 110 | /// Populated as soon as the `Compilation` is created. Guaranteed to contain all modules, even builtin ones. | 110 | /// Populated as soon as the `Compilation` is created. Guaranteed to contain all modules, even builtin ones. |
| 111 | /// Modules whose root file is not a Zig or ZON file have the value `.none`. | 111 | /// Modules whose root file is not a Zig or ZON file have the value `.none`. |
| 112 | module_roots: std.array_hash_map.Auto(*Package.Module, File.Index.Optional) = .empty, | 112 | module_roots: std.array_hash_map.Auto(*Module, File.Index.Optional) = .empty, |
| 113 | 113 | ||
| 114 | /// The set of all the Zig source files in the Zig Compilation Unit. Tracked in | 114 | /// The set of all the Zig source files in the Zig Compilation Unit. Tracked in |
| 115 | /// order to iterate over it and check which source files have been modified on | 115 | /// order to iterate over it and check which source files have been modified on |
| ... | @@ -148,7 +148,7 @@ alive_files: std.array_hash_map.Auto(File.Index, File.Reference) = .empty, | ... | @@ -148,7 +148,7 @@ alive_files: std.array_hash_map.Auto(File.Index, File.Reference) = .empty, |
| 148 | /// Cleared and recomputed every update, after AstGen and before Sema. | 148 | /// Cleared and recomputed every update, after AstGen and before Sema. |
| 149 | multi_module_err: ?struct { | 149 | multi_module_err: ?struct { |
| 150 | file: File.Index, | 150 | file: File.Index, |
| 151 | modules: [2]*Package.Module, | 151 | modules: [2]*Module, |
| 152 | refs: [2]File.Reference, | 152 | refs: [2]File.Reference, |
| 153 | } = null, | 153 | } = null, |
| 154 | 154 | ||
| ... | @@ -292,7 +292,7 @@ retryable_failures: std.ArrayList(AnalUnit) = .empty, | ... | @@ -292,7 +292,7 @@ retryable_failures: std.ArrayList(AnalUnit) = .empty, |
| 292 | 292 | ||
| 293 | /// These are the modules which we initially queue for analysis in `Compilation.update`. | 293 | /// These are the modules which we initially queue for analysis in `Compilation.update`. |
| 294 | /// `resolveReferences` will use these as the root of its reachability traversal. | 294 | /// `resolveReferences` will use these as the root of its reachability traversal. |
| 295 | analysis_roots_buffer: [5]*Package.Module, | 295 | analysis_roots_buffer: [5]*Module, |
| 296 | analysis_roots_len: usize = 0, | 296 | analysis_roots_len: usize = 0, |
| 297 | /// This is the cached result of `Zcu.resolveReferences`. It is computed on-demand, and | 297 | /// This is the cached result of `Zcu.resolveReferences`. It is computed on-demand, and |
| 298 | /// reset to `null` when any semantic analysis occurs (since this invalidates the data). | 298 | /// reset to `null` when any semantic analysis occurs (since this invalidates the data). |
| ... | @@ -985,7 +985,7 @@ pub const File = struct { | ... | @@ -985,7 +985,7 @@ pub const File = struct { |
| 985 | /// tell, and invalidate dependencies as needed (see `module_changed`). | 985 | /// tell, and invalidate dependencies as needed (see `module_changed`). |
| 986 | /// During semantic analysis, this is always non-`null` for alive files (i.e. those which | 986 | /// During semantic analysis, this is always non-`null` for alive files (i.e. those which |
| 987 | /// have imports targeting them). | 987 | /// have imports targeting them). |
| 988 | mod: ?*Package.Module, | 988 | mod: ?*Module, |
| 989 | /// Relative to the root directory of `mod`. If `mod == null`, this field is `undefined`. | 989 | /// Relative to the root directory of `mod`. If `mod == null`, this field is `undefined`. |
| 990 | /// This memory is managed externally and must not be directly freed. | 990 | /// This memory is managed externally and must not be directly freed. |
| 991 | /// Its lifetime is at least equal to that of this `File`. | 991 | /// Its lifetime is at least equal to that of this `File`. |
| ... | @@ -1028,13 +1028,13 @@ pub const File = struct { | ... | @@ -1028,13 +1028,13 @@ pub const File = struct { |
| 1028 | 1028 | ||
| 1029 | /// A single reference to a file. | 1029 | /// A single reference to a file. |
| 1030 | pub const Reference = union(enum) { | 1030 | pub const Reference = union(enum) { |
| 1031 | analysis_root: *Package.Module, | 1031 | analysis_root: *Module, |
| 1032 | import: struct { | 1032 | import: struct { |
| 1033 | importer: Zcu.File.Index, | 1033 | importer: Zcu.File.Index, |
| 1034 | tok: Ast.TokenIndex, | 1034 | tok: Ast.TokenIndex, |
| 1035 | /// If the file is imported as the root of a module, this is that module. | 1035 | /// If the file is imported as the root of a module, this is that module. |
| 1036 | /// `null` means the file was imported directly by path. | 1036 | /// `null` means the file was imported directly by path. |
| 1037 | module: ?*Package.Module, | 1037 | module: ?*Module, |
| 1038 | }, | 1038 | }, |
| 1039 | }; | 1039 | }; |
| 1040 | 1040 | ||
| ... | @@ -3709,7 +3709,7 @@ pub const ImportResult = struct { | ... | @@ -3709,7 +3709,7 @@ pub const ImportResult = struct { |
| 3709 | /// If this import was a simple file path, this is `null`; the imported file should exist within | 3709 | /// If this import was a simple file path, this is `null`; the imported file should exist within |
| 3710 | /// the importer's module. Otherwise, it's the module which the import resolved to. This module | 3710 | /// the importer's module. Otherwise, it's the module which the import resolved to. This module |
| 3711 | /// could match the module of `cur_file`, since a module can depend on itself. | 3711 | /// could match the module of `cur_file`, since a module can depend on itself. |
| 3712 | module: ?*Package.Module, | 3712 | module: ?*Module, |
| 3713 | }; | 3713 | }; |
| 3714 | 3714 | ||
| 3715 | /// Prepares `unit` for re-analysis by clearing all of the following state: | 3715 | /// Prepares `unit` for re-analysis by clearing all of the following state: |
| ... | @@ -4406,7 +4406,7 @@ fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.array_hash_map.Auto(Ana | ... | @@ -4406,7 +4406,7 @@ fn resolveReferencesInner(zcu: *Zcu) Allocator.Error!std.array_hash_map.Auto(Ana |
| 4406 | return units.move(); | 4406 | return units.move(); |
| 4407 | } | 4407 | } |
| 4408 | 4408 | ||
| 4409 | pub fn analysisRoots(zcu: *Zcu) []*Package.Module { | 4409 | pub fn analysisRoots(zcu: *Zcu) []*Module { |
| 4410 | return zcu.analysis_roots_buffer[0..zcu.analysis_roots_len]; | 4410 | return zcu.analysis_roots_buffer[0..zcu.analysis_roots_len]; |
| 4411 | } | 4411 | } |
| 4412 | 4412 | ||
| ... | @@ -4820,7 +4820,7 @@ fn explainWhyFileIsInModule( | ... | @@ -4820,7 +4820,7 @@ fn explainWhyFileIsInModule( |
| 4820 | eb: *std.zig.ErrorBundle.Wip, | 4820 | eb: *std.zig.ErrorBundle.Wip, |
| 4821 | notes_out: *std.ArrayList(std.zig.ErrorBundle.MessageIndex), | 4821 | notes_out: *std.ArrayList(std.zig.ErrorBundle.MessageIndex), |
| 4822 | file: File.Index, | 4822 | file: File.Index, |
| 4823 | in_module: *Package.Module, | 4823 | in_module: *Module, |
| 4824 | ref: File.Reference, | 4824 | ref: File.Reference, |
| 4825 | ) Allocator.Error!void { | 4825 | ) Allocator.Error!void { |
| 4826 | const gpa = zcu.gpa; | 4826 | const gpa = zcu.gpa; |
| ... | @@ -4866,7 +4866,7 @@ fn explainWhyFileIsInModule( | ... | @@ -4866,7 +4866,7 @@ fn explainWhyFileIsInModule( |
| 4866 | const import_src = try importer_file.errorBundleTokenSrc(import.tok, zcu, eb); | 4866 | const import_src = try importer_file.errorBundleTokenSrc(import.tok, zcu, eb); |
| 4867 | 4867 | ||
| 4868 | const importer_ref = zcu.alive_files.get(import.importer).?; | 4868 | const importer_ref = zcu.alive_files.get(import.importer).?; |
| 4869 | const importer_root: ?*Package.Module = switch (importer_ref) { | 4869 | const importer_root: ?*Module = switch (importer_ref) { |
| 4870 | .analysis_root => |mod| mod, | 4870 | .analysis_root => |mod| mod, |
| 4871 | .import => |i| i.module, | 4871 | .import => |i| i.module, |
| 4872 | }; | 4872 | }; |
src/Zcu/PerThread.zig+1-1| ... | @@ -23,7 +23,7 @@ const builtin = @import("builtin"); | ... | @@ -23,7 +23,7 @@ const builtin = @import("builtin"); |
| 23 | const dev = @import("../dev.zig"); | 23 | const dev = @import("../dev.zig"); |
| 24 | const InternPool = @import("../InternPool.zig"); | 24 | const InternPool = @import("../InternPool.zig"); |
| 25 | const AnalUnit = InternPool.AnalUnit; | 25 | const AnalUnit = InternPool.AnalUnit; |
| 26 | const Module = @import("../Package.zig").Module; | 26 | const Module = @import("../Module.zig"); |
| 27 | const Sema = @import("../Sema.zig"); | 27 | const Sema = @import("../Sema.zig"); |
| 28 | const target_util = @import("../target.zig"); | 28 | const target_util = @import("../target.zig"); |
| 29 | const tracy = @import("../tracy.zig"); | 29 | const tracy = @import("../tracy.zig"); |
src/codegen/aarch64/Select.zig+2-2| ... | @@ -7592,7 +7592,7 @@ pub fn layout( | ... | @@ -7592,7 +7592,7 @@ pub fn layout( |
| 7592 | is_sysv_var_args: bool, | 7592 | is_sysv_var_args: bool, |
| 7593 | saved_gra_len: u7, | 7593 | saved_gra_len: u7, |
| 7594 | saved_vra_len: u7, | 7594 | saved_vra_len: u7, |
| 7595 | mod: *const Package.Module, | 7595 | mod: *const Module, |
| 7596 | ) !usize { | 7596 | ) !usize { |
| 7597 | const zcu = isel.pt.zcu; | 7597 | const zcu = isel.pt.zcu; |
| 7598 | const ip = &zcu.intern_pool; | 7598 | const ip = &zcu.intern_pool; |
| ... | @@ -12513,7 +12513,7 @@ const assert = std.debug.assert; | ... | @@ -12513,7 +12513,7 @@ const assert = std.debug.assert; |
| 12513 | const codegen = @import("../../codegen.zig"); | 12513 | const codegen = @import("../../codegen.zig"); |
| 12514 | const Constant = @import("../../Value.zig"); | 12514 | const Constant = @import("../../Value.zig"); |
| 12515 | const InternPool = @import("../../InternPool.zig"); | 12515 | const InternPool = @import("../../InternPool.zig"); |
| 12516 | const Package = @import("../../Package.zig"); | 12516 | const Module = @import("../../Module.zig"); |
| 12517 | const Register = codegen.aarch64.encoding.Register; | 12517 | const Register = codegen.aarch64.encoding.Register; |
| 12518 | const Select = @This(); | 12518 | const Select = @This(); |
| 12519 | const std = @import("std"); | 12519 | const std = @import("std"); |
src/codegen/c.zig+1-1| ... | @@ -9,7 +9,7 @@ const Writer = std.Io.Writer; | ... | @@ -9,7 +9,7 @@ const Writer = std.Io.Writer; |
| 9 | const dev = @import("../dev.zig"); | 9 | const dev = @import("../dev.zig"); |
| 10 | const link = @import("../link.zig"); | 10 | const link = @import("../link.zig"); |
| 11 | const Zcu = @import("../Zcu.zig"); | 11 | const Zcu = @import("../Zcu.zig"); |
| 12 | const Module = @import("../Package/Module.zig"); | 12 | const Module = @import("../Module.zig"); |
| 13 | const Compilation = @import("../Compilation.zig"); | 13 | const Compilation = @import("../Compilation.zig"); |
| 14 | const Value = @import("../Value.zig"); | 14 | const Value = @import("../Value.zig"); |
| 15 | const Type = @import("../Type.zig"); | 15 | const Type = @import("../Type.zig"); |
src/codegen/llvm.zig+2-2| ... | @@ -13,7 +13,7 @@ const Compilation = @import("../Compilation.zig"); | ... | @@ -13,7 +13,7 @@ const Compilation = @import("../Compilation.zig"); |
| 13 | const dev = @import("../dev.zig"); | 13 | const dev = @import("../dev.zig"); |
| 14 | const InternPool = @import("../InternPool.zig"); | 14 | const InternPool = @import("../InternPool.zig"); |
| 15 | const link = @import("../link.zig"); | 15 | const link = @import("../link.zig"); |
| 16 | const Package = @import("../Package.zig"); | 16 | const Module = @import("../Module.zig"); |
| 17 | const target_util = @import("../target.zig"); | 17 | const target_util = @import("../target.zig"); |
| 18 | const Type = @import("../Type.zig"); | 18 | const Type = @import("../Type.zig"); |
| 19 | const Value = @import("../Value.zig"); | 19 | const Value = @import("../Value.zig"); |
| ... | @@ -2772,7 +2772,7 @@ pub const Object = struct { | ... | @@ -2772,7 +2772,7 @@ pub const Object = struct { |
| 2772 | fn addCommonFnAttributes( | 2772 | fn addCommonFnAttributes( |
| 2773 | o: *Object, | 2773 | o: *Object, |
| 2774 | attributes: *Builder.FunctionAttributes.Wip, | 2774 | attributes: *Builder.FunctionAttributes.Wip, |
| 2775 | owner_mod: *Package.Module, | 2775 | owner_mod: *Module, |
| 2776 | omit_frame_pointer: bool, | 2776 | omit_frame_pointer: bool, |
| 2777 | ) Allocator.Error!void { | 2777 | ) Allocator.Error!void { |
| 2778 | if (!owner_mod.red_zone) { | 2778 | if (!owner_mod.red_zone) { |
src/codegen/llvm/FuncGen.zig+2-2| ... | @@ -80,7 +80,7 @@ fn todo(fg: *FuncGen, comptime format: []const u8, args: anytype) TodoError { | ... | @@ -80,7 +80,7 @@ fn todo(fg: *FuncGen, comptime format: []const u8, args: anytype) TodoError { |
| 80 | ); | 80 | ); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | fn ownerModule(fg: *const FuncGen) *Package.Module { | 83 | fn ownerModule(fg: *const FuncGen) *Module { |
| 84 | return fg.object.zcu.navFileScope(fg.nav_index).mod.?; | 84 | return fg.object.zcu.navFileScope(fg.nav_index).mod.?; |
| 85 | } | 85 | } |
| 86 | 86 | ||
| ... | @@ -7739,7 +7739,7 @@ const mips_c_abi = @import("../mips/abi.zig"); | ... | @@ -7739,7 +7739,7 @@ const mips_c_abi = @import("../mips/abi.zig"); |
| 7739 | 7739 | ||
| 7740 | const Zcu = @import("../../Zcu.zig"); | 7740 | const Zcu = @import("../../Zcu.zig"); |
| 7741 | const Air = @import("../../Air.zig"); | 7741 | const Air = @import("../../Air.zig"); |
| 7742 | const Package = @import("../../Package.zig"); | 7742 | const Module = @import("../../Module.zig"); |
| 7743 | const InternPool = @import("../../InternPool.zig"); | 7743 | const InternPool = @import("../../InternPool.zig"); |
| 7744 | const Value = @import("../../Value.zig"); | 7744 | const Value = @import("../../Value.zig"); |
| 7745 | const Type = @import("../../Type.zig"); | 7745 | const Type = @import("../../Type.zig"); |
src/codegen/riscv64/CodeGen.zig+2-2| ... | @@ -14,7 +14,7 @@ const Type = @import("../../Type.zig"); | ... | @@ -14,7 +14,7 @@ const Type = @import("../../Type.zig"); |
| 14 | const Value = @import("../../Value.zig"); | 14 | const Value = @import("../../Value.zig"); |
| 15 | const link = @import("../../link.zig"); | 15 | const link = @import("../../link.zig"); |
| 16 | const Zcu = @import("../../Zcu.zig"); | 16 | const Zcu = @import("../../Zcu.zig"); |
| 17 | const Package = @import("../../Package.zig"); | 17 | const Module = @import("../../Module.zig"); |
| 18 | const InternPool = @import("../../InternPool.zig"); | 18 | const InternPool = @import("../../InternPool.zig"); |
| 19 | const Compilation = @import("../../Compilation.zig"); | 19 | const Compilation = @import("../../Compilation.zig"); |
| 20 | const target_util = @import("../../target.zig"); | 20 | const target_util = @import("../../target.zig"); |
| ... | @@ -66,7 +66,7 @@ liveness: Air.Liveness, | ... | @@ -66,7 +66,7 @@ liveness: Air.Liveness, |
| 66 | bin_file: *link.File, | 66 | bin_file: *link.File, |
| 67 | gpa: Allocator, | 67 | gpa: Allocator, |
| 68 | 68 | ||
| 69 | mod: *Package.Module, | 69 | mod: *Module, |
| 70 | target: *const std.Target, | 70 | target: *const std.Target, |
| 71 | args: []MCValue, | 71 | args: []MCValue, |
| 72 | ret_mcv: InstTracking, | 72 | ret_mcv: InstTracking, |
src/codegen/x86_64/CodeGen.zig+1-1| ... | @@ -14,7 +14,7 @@ const Emit = @import("Emit.zig"); | ... | @@ -14,7 +14,7 @@ const Emit = @import("Emit.zig"); |
| 14 | const Lower = @import("Lower.zig"); | 14 | const Lower = @import("Lower.zig"); |
| 15 | const Mir = @import("Mir.zig"); | 15 | const Mir = @import("Mir.zig"); |
| 16 | const Zcu = @import("../../Zcu.zig"); | 16 | const Zcu = @import("../../Zcu.zig"); |
| 17 | const Module = @import("../../Package/Module.zig"); | 17 | const Module = @import("../../Module.zig"); |
| 18 | const InternPool = @import("../../InternPool.zig"); | 18 | const InternPool = @import("../../InternPool.zig"); |
| 19 | const Type = @import("../../Type.zig"); | 19 | const Type = @import("../../Type.zig"); |
| 20 | const Value = @import("../../Value.zig"); | 20 | const Value = @import("../../Value.zig"); |
src/libs/freebsd.zig+1-1| ... | @@ -12,7 +12,7 @@ const Compilation = @import("../Compilation.zig"); | ... | @@ -12,7 +12,7 @@ const Compilation = @import("../Compilation.zig"); |
| 12 | const build_options = @import("build_options"); | 12 | const build_options = @import("build_options"); |
| 13 | const trace = @import("../tracy.zig").trace; | 13 | const trace = @import("../tracy.zig").trace; |
| 14 | const Cache = std.Build.Cache; | 14 | const Cache = std.Build.Cache; |
| 15 | const Module = @import("../Package/Module.zig"); | 15 | const Module = @import("../Module.zig"); |
| 16 | const link = @import("../link.zig"); | 16 | const link = @import("../link.zig"); |
| 17 | 17 | ||
| 18 | pub const CrtFile = enum { | 18 | pub const CrtFile = enum { |
src/libs/glibc.zig+1-1| ... | @@ -12,7 +12,7 @@ const Compilation = @import("../Compilation.zig"); | ... | @@ -12,7 +12,7 @@ const Compilation = @import("../Compilation.zig"); |
| 12 | const build_options = @import("build_options"); | 12 | const build_options = @import("build_options"); |
| 13 | const trace = @import("../tracy.zig").trace; | 13 | const trace = @import("../tracy.zig").trace; |
| 14 | const Cache = std.Build.Cache; | 14 | const Cache = std.Build.Cache; |
| 15 | const Module = @import("../Package/Module.zig"); | 15 | const Module = @import("../Module.zig"); |
| 16 | const link = @import("../link.zig"); | 16 | const link = @import("../link.zig"); |
| 17 | 17 | ||
| 18 | pub const Lib = struct { | 18 | pub const Lib = struct { |
src/libs/libcxx.zig+1-1| ... | @@ -6,7 +6,7 @@ const target_util = @import("../target.zig"); | ... | @@ -6,7 +6,7 @@ const target_util = @import("../target.zig"); |
| 6 | const Compilation = @import("../Compilation.zig"); | 6 | const Compilation = @import("../Compilation.zig"); |
| 7 | const build_options = @import("build_options"); | 7 | const build_options = @import("build_options"); |
| 8 | const trace = @import("../tracy.zig").trace; | 8 | const trace = @import("../tracy.zig").trace; |
| 9 | const Module = @import("../Package/Module.zig"); | 9 | const Module = @import("../Module.zig"); |
| 10 | 10 | ||
| 11 | const libcxxabi_files = [_][]const u8{ | 11 | const libcxxabi_files = [_][]const u8{ |
| 12 | "src/cxa_aux_runtime.cpp", | 12 | "src/cxa_aux_runtime.cpp", |
src/libs/libtsan.zig+1-1| ... | @@ -4,7 +4,7 @@ const assert = std.debug.assert; | ... | @@ -4,7 +4,7 @@ const assert = std.debug.assert; |
| 4 | const Compilation = @import("../Compilation.zig"); | 4 | const Compilation = @import("../Compilation.zig"); |
| 5 | const build_options = @import("build_options"); | 5 | const build_options = @import("build_options"); |
| 6 | const trace = @import("../tracy.zig").trace; | 6 | const trace = @import("../tracy.zig").trace; |
| 7 | const Module = @import("../Package/Module.zig"); | 7 | const Module = @import("../Module.zig"); |
| 8 | 8 | ||
| 9 | pub const BuildError = error{ | 9 | pub const BuildError = error{ |
| 10 | OutOfMemory, | 10 | OutOfMemory, |
src/libs/libunwind.zig+1-1| ... | @@ -4,7 +4,7 @@ const assert = std.debug.assert; | ... | @@ -4,7 +4,7 @@ const assert = std.debug.assert; |
| 4 | 4 | ||
| 5 | const target_util = @import("../target.zig"); | 5 | const target_util = @import("../target.zig"); |
| 6 | const Compilation = @import("../Compilation.zig"); | 6 | const Compilation = @import("../Compilation.zig"); |
| 7 | const Module = @import("../Package/Module.zig"); | 7 | const Module = @import("../Module.zig"); |
| 8 | const build_options = @import("build_options"); | 8 | const build_options = @import("build_options"); |
| 9 | const trace = @import("../tracy.zig").trace; | 9 | const trace = @import("../tracy.zig").trace; |
| 10 | 10 |
src/libs/musl.zig+1-1| ... | @@ -3,7 +3,7 @@ const Allocator = std.mem.Allocator; | ... | @@ -3,7 +3,7 @@ const Allocator = std.mem.Allocator; |
| 3 | const mem = std.mem; | 3 | const mem = std.mem; |
| 4 | const path = std.fs.path; | 4 | const path = std.fs.path; |
| 5 | const assert = std.debug.assert; | 5 | const assert = std.debug.assert; |
| 6 | const Module = @import("../Package/Module.zig"); | 6 | const Module = @import("../Module.zig"); |
| 7 | 7 | ||
| 8 | const Compilation = @import("../Compilation.zig"); | 8 | const Compilation = @import("../Compilation.zig"); |
| 9 | const build_options = @import("build_options"); | 9 | const build_options = @import("build_options"); |
src/libs/netbsd.zig+1-1| ... | @@ -12,7 +12,7 @@ const Compilation = @import("../Compilation.zig"); | ... | @@ -12,7 +12,7 @@ const Compilation = @import("../Compilation.zig"); |
| 12 | const build_options = @import("build_options"); | 12 | const build_options = @import("build_options"); |
| 13 | const trace = @import("../tracy.zig").trace; | 13 | const trace = @import("../tracy.zig").trace; |
| 14 | const Cache = std.Build.Cache; | 14 | const Cache = std.Build.Cache; |
| 15 | const Module = @import("../Package/Module.zig"); | 15 | const Module = @import("../Module.zig"); |
| 16 | const link = @import("../link.zig"); | 16 | const link = @import("../link.zig"); |
| 17 | 17 | ||
| 18 | pub const CrtFile = enum { | 18 | pub const CrtFile = enum { |
src/libs/openbsd.zig+1-1| ... | @@ -13,7 +13,7 @@ const Compilation = @import("../Compilation.zig"); | ... | @@ -13,7 +13,7 @@ const Compilation = @import("../Compilation.zig"); |
| 13 | const build_options = @import("build_options"); | 13 | const build_options = @import("build_options"); |
| 14 | const trace = @import("../tracy.zig").trace; | 14 | const trace = @import("../tracy.zig").trace; |
| 15 | const Cache = std.Build.Cache; | 15 | const Cache = std.Build.Cache; |
| 16 | const Module = @import("../Package/Module.zig"); | 16 | const Module = @import("../Module.zig"); |
| 17 | const link = @import("../link.zig"); | 17 | const link = @import("../link.zig"); |
| 18 | 18 | ||
| 19 | pub const CrtFile = enum { | 19 | pub const CrtFile = enum { |
src/link.zig-1| ... | @@ -21,7 +21,6 @@ const Zcu = @import("Zcu.zig"); | ... | @@ -21,7 +21,6 @@ const Zcu = @import("Zcu.zig"); |
| 21 | const InternPool = @import("InternPool.zig"); | 21 | const InternPool = @import("InternPool.zig"); |
| 22 | const Type = @import("Type.zig"); | 22 | const Type = @import("Type.zig"); |
| 23 | const Value = @import("Value.zig"); | 23 | const Value = @import("Value.zig"); |
| 24 | const Package = @import("Package.zig"); | ||
| 25 | const dev = @import("dev.zig"); | 24 | const dev = @import("dev.zig"); |
| 26 | const target_util = @import("target.zig"); | 25 | const target_util = @import("target.zig"); |
| 27 | const codegen = @import("codegen.zig"); | 26 | const codegen = @import("codegen.zig"); |
src/link/C.zig+1-1| ... | @@ -13,7 +13,7 @@ const Path = std.Build.Cache.Path; | ... | @@ -13,7 +13,7 @@ const Path = std.Build.Cache.Path; |
| 13 | 13 | ||
| 14 | const build_options = @import("build_options"); | 14 | const build_options = @import("build_options"); |
| 15 | const Zcu = @import("../Zcu.zig"); | 15 | const Zcu = @import("../Zcu.zig"); |
| 16 | const Module = @import("../Package/Module.zig"); | 16 | const Module = @import("../Module.zig"); |
| 17 | const InternPool = @import("../InternPool.zig"); | 17 | const InternPool = @import("../InternPool.zig"); |
| 18 | const Alignment = InternPool.Alignment; | 18 | const Alignment = InternPool.Alignment; |
| 19 | const Compilation = @import("../Compilation.zig"); | 19 | const Compilation = @import("../Compilation.zig"); |
src/link/Dwarf.zig+1-1| ... | @@ -10,7 +10,7 @@ const log = std.log.scoped(.dwarf); | ... | @@ -10,7 +10,7 @@ const log = std.log.scoped(.dwarf); |
| 10 | const Writer = std.Io.Writer; | 10 | const Writer = std.Io.Writer; |
| 11 | 11 | ||
| 12 | const InternPool = @import("../InternPool.zig"); | 12 | const InternPool = @import("../InternPool.zig"); |
| 13 | const Module = @import("../Package.zig").Module; | 13 | const Module = @import("../Module.zig"); |
| 14 | const Type = @import("../Type.zig"); | 14 | const Type = @import("../Type.zig"); |
| 15 | const Value = @import("../Value.zig"); | 15 | const Value = @import("../Value.zig"); |
| 16 | const Zcu = @import("../Zcu.zig"); | 16 | const Zcu = @import("../Zcu.zig"); |
src/main.zig+14-15| ... | @@ -26,7 +26,6 @@ const allocPrint = std.fmt.allocPrint; | ... | @@ -26,7 +26,6 @@ const allocPrint = std.fmt.allocPrint; |
| 26 | pub const tracy = @import("tracy.zig"); | 26 | pub const tracy = @import("tracy.zig"); |
| 27 | const Compilation = @import("Compilation.zig"); | 27 | const Compilation = @import("Compilation.zig"); |
| 28 | const link = @import("link.zig"); | 28 | const link = @import("link.zig"); |
| 29 | const Package = @import("Package.zig"); | ||
| 30 | const build_options = @import("build_options"); | 29 | const build_options = @import("build_options"); |
| 31 | const wasi_libc = @import("libs/wasi_libc.zig"); | 30 | const wasi_libc = @import("libs/wasi_libc.zig"); |
| 32 | const target_util = @import("target.zig"); | 31 | const target_util = @import("target.zig"); |
| ... | @@ -34,9 +33,9 @@ const crash_report = @import("crash_report.zig"); | ... | @@ -34,9 +33,9 @@ const crash_report = @import("crash_report.zig"); |
| 34 | const Zcu = @import("Zcu.zig"); | 33 | const Zcu = @import("Zcu.zig"); |
| 35 | const mingw = @import("libs/mingw.zig"); | 34 | const mingw = @import("libs/mingw.zig"); |
| 36 | const dev = @import("dev.zig"); | 35 | const dev = @import("dev.zig"); |
| 36 | const Module = @import("Module.zig"); | ||
| 37 | 37 | ||
| 38 | test { | 38 | test { |
| 39 | _ = Package; | ||
| 40 | _ = @import("codegen.zig"); | 39 | _ = @import("codegen.zig"); |
| 41 | } | 40 | } |
| 42 | 41 | ||
| ... | @@ -878,13 +877,13 @@ const CliModule = struct { | ... | @@ -878,13 +877,13 @@ const CliModule = struct { |
| 878 | root_path: []const u8, | 877 | root_path: []const u8, |
| 879 | root_src_path: []const u8, | 878 | root_src_path: []const u8, |
| 880 | cc_argv: []const []const u8, | 879 | cc_argv: []const []const u8, |
| 881 | inherited: Package.Module.CreateOptions.Inherited, | 880 | inherited: Module.CreateOptions.Inherited, |
| 882 | target_arch_os_abi: ?[]const u8, | 881 | target_arch_os_abi: ?[]const u8, |
| 883 | target_mcpu: ?[]const u8, | 882 | target_mcpu: ?[]const u8, |
| 884 | dynamic_linker: ?[]const u8, | 883 | dynamic_linker: ?[]const u8, |
| 885 | 884 | ||
| 886 | deps: []const Dep, | 885 | deps: []const Dep, |
| 887 | resolved: ?*Package.Module, | 886 | resolved: ?*Module, |
| 888 | 887 | ||
| 889 | c_source_files_start: usize, | 888 | c_source_files_start: usize, |
| 890 | c_source_files_end: usize, | 889 | c_source_files_end: usize, |
| ... | @@ -1035,7 +1034,7 @@ fn buildOutputType( | ... | @@ -1035,7 +1034,7 @@ fn buildOutputType( |
| 1035 | 1034 | ||
| 1036 | // These get set by CLI flags and then snapshotted when a `-M` flag is | 1035 | // These get set by CLI flags and then snapshotted when a `-M` flag is |
| 1037 | // encountered. | 1036 | // encountered. |
| 1038 | var mod_opts: Package.Module.CreateOptions.Inherited = .{}; | 1037 | var mod_opts: Module.CreateOptions.Inherited = .{}; |
| 1039 | 1038 | ||
| 1040 | // These get appended to by CLI flags and then slurped when a `-M` flag | 1039 | // These get appended to by CLI flags and then slurped when a `-M` flag |
| 1041 | // is encountered. | 1040 | // is encountered. |
| ... | @@ -3266,7 +3265,7 @@ fn buildOutputType( | ... | @@ -3266,7 +3265,7 @@ fn buildOutputType( |
| 3266 | const root_mod = switch (arg_mode) { | 3265 | const root_mod = switch (arg_mode) { |
| 3267 | .zig_test, .zig_test_obj => root_mod: { | 3266 | .zig_test, .zig_test_obj => root_mod: { |
| 3268 | const test_mod = if (test_runner_path) |test_runner| test_mod: { | 3267 | const test_mod = if (test_runner_path) |test_runner| test_mod: { |
| 3269 | const test_mod = try Package.Module.create(arena, .{ | 3268 | const test_mod = try Module.create(arena, .{ |
| 3270 | .paths = .{ | 3269 | .paths = .{ |
| 3271 | .root = try .fromUnresolved(arena, dirs, &.{fs.path.dirname(test_runner) orelse "."}), | 3270 | .root = try .fromUnresolved(arena, dirs, &.{fs.path.dirname(test_runner) orelse "."}), |
| 3272 | .root_src_path = fs.path.basename(test_runner), | 3271 | .root_src_path = fs.path.basename(test_runner), |
| ... | @@ -3279,7 +3278,7 @@ fn buildOutputType( | ... | @@ -3279,7 +3278,7 @@ fn buildOutputType( |
| 3279 | }); | 3278 | }); |
| 3280 | test_mod.deps = try main_mod.deps.clone(arena); | 3279 | test_mod.deps = try main_mod.deps.clone(arena); |
| 3281 | break :test_mod test_mod; | 3280 | break :test_mod test_mod; |
| 3282 | } else try Package.Module.create(arena, .{ | 3281 | } else try Module.create(arena, .{ |
| 3283 | .paths = .{ | 3282 | .paths = .{ |
| 3284 | .root = try .fromRoot(arena, dirs, .zig_lib, "compiler"), | 3283 | .root = try .fromRoot(arena, dirs, .zig_lib, "compiler"), |
| 3285 | .root_src_path = "test_runner.zig", | 3284 | .root_src_path = "test_runner.zig", |
| ... | @@ -3973,10 +3972,10 @@ fn createModule( | ... | @@ -3973,10 +3972,10 @@ fn createModule( |
| 3973 | io: Io, | 3972 | io: Io, |
| 3974 | create_module: *CreateModule, | 3973 | create_module: *CreateModule, |
| 3975 | index: usize, | 3974 | index: usize, |
| 3976 | parent: ?*Package.Module, | 3975 | parent: ?*Module, |
| 3977 | color: std.zig.Color, | 3976 | color: std.zig.Color, |
| 3978 | environ_map: *process.Environ.Map, | 3977 | environ_map: *process.Environ.Map, |
| 3979 | ) Allocator.Error!*Package.Module { | 3978 | ) Allocator.Error!*Module { |
| 3980 | const cli_mod = &create_module.modules.values()[index]; | 3979 | const cli_mod = &create_module.modules.values()[index]; |
| 3981 | if (cli_mod.resolved) |m| return m; | 3980 | if (cli_mod.resolved) |m| return m; |
| 3982 | 3981 | ||
| ... | @@ -4252,7 +4251,7 @@ fn createModule( | ... | @@ -4252,7 +4251,7 @@ fn createModule( |
| 4252 | 4251 | ||
| 4253 | const root: Compilation.Path = try .fromUnresolved(arena, create_module.dirs, &.{cli_mod.root_path}); | 4252 | const root: Compilation.Path = try .fromUnresolved(arena, create_module.dirs, &.{cli_mod.root_path}); |
| 4254 | 4253 | ||
| 4255 | const mod = Package.Module.create(arena, .{ | 4254 | const mod = Module.create(arena, .{ |
| 4256 | .paths = .{ | 4255 | .paths = .{ |
| 4257 | .root = root, | 4256 | .root = root, |
| 4258 | .root_src_path = cli_mod.root_src_path, | 4257 | .root_src_path = cli_mod.root_src_path, |
| ... | @@ -4919,7 +4918,7 @@ fn jitCmdInner( | ... | @@ -4919,7 +4918,7 @@ fn jitCmdInner( |
| 4919 | options: JitCmdOptions, | 4918 | options: JitCmdOptions, |
| 4920 | ) !void { | 4919 | ) !void { |
| 4921 | const target_query: std.Target.Query = .{}; | 4920 | const target_query: std.Target.Query = .{}; |
| 4922 | const resolved_target: Package.Module.ResolvedTarget = .{ | 4921 | const resolved_target: Module.ResolvedTarget = .{ |
| 4923 | .result = std.zig.resolveTargetQueryOrFatal(io, target_query), | 4922 | .result = std.zig.resolveTargetQueryOrFatal(io, target_query), |
| 4924 | .is_native_os = true, | 4923 | .is_native_os = true, |
| 4925 | .is_native_abi = true, | 4924 | .is_native_abi = true, |
| ... | @@ -4959,7 +4958,7 @@ fn jitCmdInner( | ... | @@ -4959,7 +4958,7 @@ fn jitCmdInner( |
| 4959 | // We want to release all the locks before executing the child process, so we make a nice | 4958 | // We want to release all the locks before executing the child process, so we make a nice |
| 4960 | // big block here to ensure the cleanup gets run when we extract out our argv. | 4959 | // big block here to ensure the cleanup gets run when we extract out our argv. |
| 4961 | { | 4960 | { |
| 4962 | const main_mod_paths: Package.Module.CreateOptions.Paths = .{ | 4961 | const main_mod_paths: Module.CreateOptions.Paths = .{ |
| 4963 | .root = try .fromRoot(arena, dirs, .zig_lib, "compiler"), | 4962 | .root = try .fromRoot(arena, dirs, .zig_lib, "compiler"), |
| 4964 | .root_src_path = options.root_src_path, | 4963 | .root_src_path = options.root_src_path, |
| 4965 | }; | 4964 | }; |
| ... | @@ -4974,7 +4973,7 @@ fn jitCmdInner( | ... | @@ -4974,7 +4973,7 @@ fn jitCmdInner( |
| 4974 | .is_test = false, | 4973 | .is_test = false, |
| 4975 | }); | 4974 | }); |
| 4976 | 4975 | ||
| 4977 | const root_mod = try Package.Module.create(arena, .{ | 4976 | const root_mod = try Module.create(arena, .{ |
| 4978 | .paths = main_mod_paths, | 4977 | .paths = main_mod_paths, |
| 4979 | .fully_qualified_name = "root", | 4978 | .fully_qualified_name = "root", |
| 4980 | .cc_argv = &.{}, | 4979 | .cc_argv = &.{}, |
| ... | @@ -4988,7 +4987,7 @@ fn jitCmdInner( | ... | @@ -4988,7 +4987,7 @@ fn jitCmdInner( |
| 4988 | }); | 4987 | }); |
| 4989 | 4988 | ||
| 4990 | if (options.depend_on_aro) { | 4989 | if (options.depend_on_aro) { |
| 4991 | const aro_mod = try Package.Module.create(arena, .{ | 4990 | const aro_mod = try Module.create(arena, .{ |
| 4992 | .paths = .{ | 4991 | .paths = .{ |
| 4993 | .root = try .fromRoot(arena, dirs, .zig_lib, "compiler/aro"), | 4992 | .root = try .fromRoot(arena, dirs, .zig_lib, "compiler/aro"), |
| 4994 | .root_src_path = "aro.zig", | 4993 | .root_src_path = "aro.zig", |
| ... | @@ -6023,7 +6022,7 @@ fn handleModArg( | ... | @@ -6023,7 +6022,7 @@ fn handleModArg( |
| 6023 | mod_name: []const u8, | 6022 | mod_name: []const u8, |
| 6024 | opt_root_src_orig: ?[]const u8, | 6023 | opt_root_src_orig: ?[]const u8, |
| 6025 | create_module: *CreateModule, | 6024 | create_module: *CreateModule, |
| 6026 | mod_opts: *Package.Module.CreateOptions.Inherited, | 6025 | mod_opts: *Module.CreateOptions.Inherited, |
| 6027 | cc_argv: *std.ArrayList([]const u8), | 6026 | cc_argv: *std.ArrayList([]const u8), |
| 6028 | target_arch_os_abi: *?[]const u8, | 6027 | target_arch_os_abi: *?[]const u8, |
| 6029 | target_mcpu: *?[]const u8, | 6028 | target_mcpu: *?[]const u8, |