authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-06-24 00:08:53-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-06-29 23:50:19-07:00
logb384a7f85859678657f0ee91041be27078dfd346
tree2c1c4f983074b916bdc8331a8613755528c63522
parent15204cc210e4010bfbd033f81aebad5df38bcde8

compiler: import Module instead of Package

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");
370370const Allocator = std.mem.Allocator;
371371const Cache = std.Build.Cache;
372372const build_options = @import("build_options");
373const Module = @import("Package/Module.zig");
373const Module = @import("Module.zig");
374374const assert = std.debug.assert;
375375const AstGen = std.zig.AstGen;
376376const File = @import("Zcu.zig").File;
src/Compilation.zig+24-24
......@@ -16,7 +16,6 @@ const fatal = std.process.fatal;
1616const Value = @import("Value.zig");
1717const Type = @import("Type.zig");
1818const target_util = @import("target.zig");
19const Package = @import("Package.zig");
2019const link = @import("link.zig");
2120const tracy = @import("tracy.zig");
2221const trace = tracy.trace;
......@@ -43,6 +42,7 @@ const Air = @import("Air.zig");
4342const Builtin = @import("Builtin.zig");
4443const LlvmObject = @import("codegen/llvm.zig").Object;
4544const dev = @import("dev.zig");
45const Module = @import("Module.zig");
4646
4747pub const Config = @import("Compilation/Config.zig");
4848
......@@ -63,7 +63,7 @@ cache_use: CacheUse,
6363/// All compilations have a root module because this is where some important
6464/// settings are stored, such as target and optimization mode. This module
6565/// might not have any .zig code associated with it, however.
66root_mod: *Package.Module,
66root_mod: *Module,
6767
6868/// User-specified settings that have all the defaults resolved into concrete values.
6969config: Config,
......@@ -766,7 +766,7 @@ pub const CrtFile = struct {
766766/// For passing to a C compiler.
767767pub const CSourceFile = struct {
768768 /// Many C compiler flags are determined by settings contained in the owning Module.
769 owner: *Package.Module,
769 owner: *Module,
770770 src_path: []const u8,
771771 extra_flags: []const []const u8 = &.{},
772772 /// Same as extra_flags except they are not added to the Cache hash.
......@@ -778,7 +778,7 @@ pub const CSourceFile = struct {
778778
779779/// For passing to resinator.
780780pub const RcSourceFile = struct {
781 owner: *Package.Module,
781 owner: *Module,
782782 src_path: []const u8,
783783 extra_flags: []const []const u8 = &.{},
784784};
......@@ -1216,7 +1216,7 @@ pub const MiscError = struct {
12161216};
12171217
12181218pub 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 {
12201220 addResolvedTarget(hh, mod.resolved_target);
12211221 hh.add(mod.optimize_mode);
12221222 hh.add(mod.code_model);
......@@ -1239,7 +1239,7 @@ pub const cache_helpers = struct {
12391239
12401240 pub fn addResolvedTarget(
12411241 hh: *Cache.HashHelper,
1242 resolved_target: Package.Module.ResolvedTarget,
1242 resolved_target: Module.ResolvedTarget,
12431243 ) void {
12441244 const target = &resolved_target.result;
12451245 hh.add(target.cpu.arch);
......@@ -1412,16 +1412,16 @@ pub const CreateOptions = struct {
14121412 /// Options that have been resolved by calling `resolveDefaults`.
14131413 config: Compilation.Config,
14141414
1415 root_mod: *Package.Module,
1415 root_mod: *Module,
14161416 /// Normally, `main_mod` and `root_mod` are the same. The exception is `zig
14171417 /// test`, in which `root_mod` is the test runner, and `main_mod` is the
14181418 /// user's source file which has the tests.
1419 main_mod: ?*Package.Module = null,
1419 main_mod: ?*Module = null,
14201420 /// This is provided so that the API user has a chance to tweak the
14211421 /// per-module settings of the standard library.
14221422 /// When this is null, a default configuration of the std lib is created
14231423 /// based on the settings of root_mod.
1424 std_mod: ?*Package.Module = null,
1424 std_mod: ?*Module = null,
14251425 root_name: []const u8,
14261426 sysroot: ?[]const u8 = null,
14271427 cache_mode: CacheMode,
......@@ -1763,7 +1763,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic,
17631763 if (compiler_rt_strat == .zcu) {
17641764 // For objects, this mechanism relies on essentially `_ = @import("compiler-rt");`
17651765 // injected into the object.
1766 const compiler_rt_mod = Package.Module.create(arena, .{
1766 const compiler_rt_mod = Module.create(arena, .{
17671767 .paths = .{
17681768 .root = .zig_lib_root,
17691769 .root_src_path = "compiler_rt.zig",
......@@ -1825,7 +1825,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic,
18251825 };
18261826
18271827 if (ubsan_rt_strat == .zcu) {
1828 const ubsan_rt_mod = Package.Module.create(arena, .{
1828 const ubsan_rt_mod = Module.create(arena, .{
18291829 .paths = .{
18301830 .root = .zig_lib_root,
18311831 .root_src_path = "ubsan_rt.zig",
......@@ -1866,7 +1866,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic,
18661866 };
18671867
18681868 if (zigc_strat == .zcu) {
1869 const zigc_mod = Package.Module.create(arena, .{
1869 const zigc_mod = Module.create(arena, .{
18701870 .paths = .{
18711871 .root = .zig_lib_root,
18721872 .root_src_path = "c.zig",
......@@ -1996,7 +1996,7 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic,
19961996 .path = try options.dirs.global_cache.join(arena, &.{zir_sub_dir}),
19971997 };
19981998
1999 const std_mod = options.std_mod orelse Package.Module.create(arena, .{
1999 const std_mod = options.std_mod orelse Module.create(arena, .{
20002000 .paths = .{
20012001 .root = try .fromRoot(arena, options.dirs, .zig_lib, "std"),
20022002 .root_src_path = "std.zig",
......@@ -4639,7 +4639,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {
46394639 var buffer: [1024]u8 = undefined;
46404640 var tar_file_writer = tar_file.writer(io, &buffer);
46414641
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;
46434643 defer seen_table.deinit(comp.gpa);
46444644
46454645 try seen_table.put(comp.gpa, zcu.main_mod, comp.root_name);
......@@ -4666,7 +4666,7 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void {
46664666
46674667fn docsCopyModule(
46684668 comp: *Compilation,
4669 module: *Package.Module,
4669 module: *Module,
46704670 name: []const u8,
46714671 tar_file_writer: *Io.File.Writer,
46724672) !void {
......@@ -4746,7 +4746,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU
47464746
47474747 const optimize_mode = std.lang.OptimizeMode.ReleaseSmall;
47484748 const output_mode = std.lang.OutputMode.Exe;
4749 const resolved_target: Package.Module.ResolvedTarget = .{
4749 const resolved_target: Module.ResolvedTarget = .{
47504750 .result = std.zig.system.resolveTargetQuery(io, .{
47514751 .cpu_arch = .wasm32,
47524752 .os_tag = .freestanding,
......@@ -4786,7 +4786,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU
47864786
47874787 const dirs = comp.dirs.withoutLocalCache();
47884788
4789 const root_mod = Package.Module.create(arena, .{
4789 const root_mod = Module.create(arena, .{
47904790 .paths = .{
47914791 .root = try .fromRoot(arena, dirs, .zig_lib, "docs/wasm"),
47924792 .root_src_path = src_basename,
......@@ -4803,7 +4803,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU
48034803 comp.lockAndSetMiscFailure(.docs_wasm, "sub-compilation of docs_wasm failed: failed to create root module: {t}", .{err});
48044804 return error.AlreadyReported;
48054805 };
4806 const walk_mod = Package.Module.create(arena, .{
4806 const walk_mod = Module.create(arena, .{
48074807 .paths = .{
48084808 .root = try .fromRoot(arena, dirs, .zig_lib, "docs/wasm"),
48094809 .root_src_path = "Walk.zig",
......@@ -4888,7 +4888,7 @@ fn workerDocsWasmFallible(comp: *Compilation, prog_node: std.Progress.Node) SubU
48884888
48894889pub fn obtainCObjectCacheManifest(
48904890 comp: *const Compilation,
4891 owner_mod: *Package.Module,
4891 owner_mod: *Module,
48924892) Cache.Manifest {
48934893 var man = comp.cache_parent.obtain();
48944894
......@@ -4936,7 +4936,7 @@ pub fn translateC(
49364936 ext: FileExt,
49374937 source_path: []const u8,
49384938 translated_basename: []const u8,
4939 owner_mod: *Package.Module,
4939 owner_mod: *Module,
49404940 prog_node: std.Progress.Node,
49414941 environ_map: *const std.process.Environ.Map,
49424942) !TranslateCResult {
......@@ -6092,7 +6092,7 @@ fn addCommonCCArgs(
60926092 argv: *std.array_list.Managed([]const u8),
60936093 ext: FileExt,
60946094 out_dep_path: ?[]const u8,
6095 mod: *Package.Module,
6095 mod: *Module,
60966096 c_frontend: Config.CFrontend,
60976097) !void {
60986098 const target = &mod.resolved_target.result;
......@@ -6446,7 +6446,7 @@ pub fn addCCArgs(
64466446 argv: *std.array_list.Managed([]const u8),
64476447 ext: FileExt,
64486448 out_dep_path: ?[]const u8,
6449 mod: *Package.Module,
6449 mod: *Module,
64506450) !void {
64516451 const target = &mod.resolved_target.result;
64526452
......@@ -7237,7 +7237,7 @@ fn buildOutputFromZig(
72377237 return error.AlreadyReported;
72387238 };
72397239
7240 const root_mod = Package.Module.create(arena, .{
7240 const root_mod = Module.create(arena, .{
72417241 .paths = .{
72427242 .root = .zig_lib_root,
72437243 .root_src_path = src_basename,
......@@ -7384,7 +7384,7 @@ pub fn build_crt_file(
73847384 comp.lockAndSetMiscFailure(misc_task_tag, "sub-compilation of {t} failed: failed to resolve compilation config: {t}", .{ misc_task_tag, err });
73857385 return error.AlreadyReported;
73867386 };
7387 const root_mod = Package.Module.create(arena, .{
7387 const root_mod = Module.create(arena, .{
73887388 .paths = .{
73897389 .root = .zig_lib_root,
73907390 .root_src_path = "",
src/Compilation/Config.zig+1-1
......@@ -577,7 +577,7 @@ pub fn resolve(options: Options) ResolveError!Config {
577577}
578578
579579const std = @import("std");
580const Module = @import("../Package.zig").Module;
580const Module = @import("../Module.zig");
581581const Config = @This();
582582const target_util = @import("../target.zig");
583583const build_options = @import("build_options");
src/Module.zig+4-4
......@@ -6,10 +6,10 @@ const Allocator = std.mem.Allocator;
66const Cache = std.Build.Cache;
77const assert = std.debug.assert;
88
9const target_util = @import("../target.zig");
10const Builtin = @import("../Builtin.zig");
11const Compilation = @import("../Compilation.zig");
12const File = @import("../Zcu.zig").File;
9const target_util = @import("target.zig");
10const Builtin = @import("Builtin.zig");
11const Compilation = @import("Compilation.zig");
12const File = @import("Zcu.zig").File;
1313
1414/// The root directory of the module. Only files inside this directory can be imported.
1515root: Compilation.Path,
src/Sema.zig+2-2
......@@ -25,7 +25,6 @@ const SemaError = Zcu.SemaError;
2525const LazySrcLoc = Zcu.LazySrcLoc;
2626const RangeSet = @import("RangeSet.zig");
2727const target_util = @import("target.zig");
28const Package = @import("Package.zig");
2928const crash_report = @import("crash_report.zig");
3029const build_options = @import("build_options");
3130const Compilation = @import("Compilation.zig");
......@@ -36,6 +35,7 @@ const ComptimeAllocIndex = InternPool.ComptimeAllocIndex;
3635const Cache = std.Build.Cache;
3736const LowerZon = @import("Sema/LowerZon.zig");
3837const arith = @import("Sema/arith.zig");
38const Module = @import("Module.zig");
3939
4040pt: Zcu.PerThread,
4141/// Alias to `zcu.gpa`.
......@@ -839,7 +839,7 @@ pub const Block = struct {
839839 return result_index;
840840 }
841841
842 pub fn ownerModule(block: Block) *Package.Module {
842 pub fn ownerModule(block: Block) *Module {
843843 const zcu = block.sema.pt.zcu;
844844 return zcu.namespacePtr(block.namespace).fileScope(zcu).mod.?;
845845 }
src/Zcu.zig+15-15
......@@ -25,7 +25,7 @@ const Compilation = @import("Compilation.zig");
2525const Cache = std.Build.Cache;
2626pub const Value = @import("Value.zig");
2727pub const Type = @import("Type.zig");
28const Package = @import("Package.zig");
28const Module = @import("Module.zig");
2929const link = @import("link.zig");
3030const Air = @import("Air.zig");
3131const Zir = std.zig.Zir;
......@@ -64,11 +64,11 @@ comp: *Compilation,
6464llvm_object: ?LlvmObject.Ptr,
6565
6666/// Pointer to externally managed resource.
67root_mod: *Package.Module,
67root_mod: *Module,
6868/// Normally, `main_mod` and `root_mod` are the same. The exception is `zig test`, in which
6969/// `root_mod` is the test runner, and `main_mod` is the user's source file which has the tests.
70main_mod: *Package.Module,
71std_mod: *Package.Module,
70main_mod: *Module,
71std_mod: *Module,
7272sema_prog_node: std.Progress.Node = .none,
7373codegen_prog_node: std.Progress.Node = .none,
7474/// 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 {
105105}) = .{},
106106
107107/// Key is the digest returned by `Builtin.hash`; value is the corresponding module.
108builtin_modules: std.array_hash_map.Auto(Cache.BinDigest, *Package.Module) = .empty,
108builtin_modules: std.array_hash_map.Auto(Cache.BinDigest, *Module) = .empty,
109109
110110/// Populated as soon as the `Compilation` is created. Guaranteed to contain all modules, even builtin ones.
111111/// Modules whose root file is not a Zig or ZON file have the value `.none`.
112module_roots: std.array_hash_map.Auto(*Package.Module, File.Index.Optional) = .empty,
112module_roots: std.array_hash_map.Auto(*Module, File.Index.Optional) = .empty,
113113
114114/// The set of all the Zig source files in the Zig Compilation Unit. Tracked in
115115/// 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,
148148/// Cleared and recomputed every update, after AstGen and before Sema.
149149multi_module_err: ?struct {
150150 file: File.Index,
151 modules: [2]*Package.Module,
151 modules: [2]*Module,
152152 refs: [2]File.Reference,
153153} = null,
154154
......@@ -292,7 +292,7 @@ retryable_failures: std.ArrayList(AnalUnit) = .empty,
292292
293293/// These are the modules which we initially queue for analysis in `Compilation.update`.
294294/// `resolveReferences` will use these as the root of its reachability traversal.
295analysis_roots_buffer: [5]*Package.Module,
295analysis_roots_buffer: [5]*Module,
296296analysis_roots_len: usize = 0,
297297/// This is the cached result of `Zcu.resolveReferences`. It is computed on-demand, and
298298/// reset to `null` when any semantic analysis occurs (since this invalidates the data).
......@@ -985,7 +985,7 @@ pub const File = struct {
985985 /// tell, and invalidate dependencies as needed (see `module_changed`).
986986 /// During semantic analysis, this is always non-`null` for alive files (i.e. those which
987987 /// have imports targeting them).
988 mod: ?*Package.Module,
988 mod: ?*Module,
989989 /// Relative to the root directory of `mod`. If `mod == null`, this field is `undefined`.
990990 /// This memory is managed externally and must not be directly freed.
991991 /// Its lifetime is at least equal to that of this `File`.
......@@ -1028,13 +1028,13 @@ pub const File = struct {
10281028
10291029 /// A single reference to a file.
10301030 pub const Reference = union(enum) {
1031 analysis_root: *Package.Module,
1031 analysis_root: *Module,
10321032 import: struct {
10331033 importer: Zcu.File.Index,
10341034 tok: Ast.TokenIndex,
10351035 /// If the file is imported as the root of a module, this is that module.
10361036 /// `null` means the file was imported directly by path.
1037 module: ?*Package.Module,
1037 module: ?*Module,
10381038 },
10391039 };
10401040
......@@ -3709,7 +3709,7 @@ pub const ImportResult = struct {
37093709 /// If this import was a simple file path, this is `null`; the imported file should exist within
37103710 /// the importer's module. Otherwise, it's the module which the import resolved to. This module
37113711 /// could match the module of `cur_file`, since a module can depend on itself.
3712 module: ?*Package.Module,
3712 module: ?*Module,
37133713};
37143714
37153715/// 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
44064406 return units.move();
44074407}
44084408
4409pub fn analysisRoots(zcu: *Zcu) []*Package.Module {
4409pub fn analysisRoots(zcu: *Zcu) []*Module {
44104410 return zcu.analysis_roots_buffer[0..zcu.analysis_roots_len];
44114411}
44124412
......@@ -4820,7 +4820,7 @@ fn explainWhyFileIsInModule(
48204820 eb: *std.zig.ErrorBundle.Wip,
48214821 notes_out: *std.ArrayList(std.zig.ErrorBundle.MessageIndex),
48224822 file: File.Index,
4823 in_module: *Package.Module,
4823 in_module: *Module,
48244824 ref: File.Reference,
48254825) Allocator.Error!void {
48264826 const gpa = zcu.gpa;
......@@ -4866,7 +4866,7 @@ fn explainWhyFileIsInModule(
48664866 const import_src = try importer_file.errorBundleTokenSrc(import.tok, zcu, eb);
48674867
48684868 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) {
48704870 .analysis_root => |mod| mod,
48714871 .import => |i| i.module,
48724872 };
src/Zcu/PerThread.zig+1-1
......@@ -23,7 +23,7 @@ const builtin = @import("builtin");
2323const dev = @import("../dev.zig");
2424const InternPool = @import("../InternPool.zig");
2525const AnalUnit = InternPool.AnalUnit;
26const Module = @import("../Package.zig").Module;
26const Module = @import("../Module.zig");
2727const Sema = @import("../Sema.zig");
2828const target_util = @import("../target.zig");
2929const tracy = @import("../tracy.zig");
src/codegen/aarch64/Select.zig+2-2
......@@ -7592,7 +7592,7 @@ pub fn layout(
75927592 is_sysv_var_args: bool,
75937593 saved_gra_len: u7,
75947594 saved_vra_len: u7,
7595 mod: *const Package.Module,
7595 mod: *const Module,
75967596) !usize {
75977597 const zcu = isel.pt.zcu;
75987598 const ip = &zcu.intern_pool;
......@@ -12513,7 +12513,7 @@ const assert = std.debug.assert;
1251312513const codegen = @import("../../codegen.zig");
1251412514const Constant = @import("../../Value.zig");
1251512515const InternPool = @import("../../InternPool.zig");
12516const Package = @import("../../Package.zig");
12516const Module = @import("../../Module.zig");
1251712517const Register = codegen.aarch64.encoding.Register;
1251812518const Select = @This();
1251912519const std = @import("std");
src/codegen/c.zig+1-1
......@@ -9,7 +9,7 @@ const Writer = std.Io.Writer;
99const dev = @import("../dev.zig");
1010const link = @import("../link.zig");
1111const Zcu = @import("../Zcu.zig");
12const Module = @import("../Package/Module.zig");
12const Module = @import("../Module.zig");
1313const Compilation = @import("../Compilation.zig");
1414const Value = @import("../Value.zig");
1515const Type = @import("../Type.zig");
src/codegen/llvm.zig+2-2
......@@ -13,7 +13,7 @@ const Compilation = @import("../Compilation.zig");
1313const dev = @import("../dev.zig");
1414const InternPool = @import("../InternPool.zig");
1515const link = @import("../link.zig");
16const Package = @import("../Package.zig");
16const Module = @import("../Module.zig");
1717const target_util = @import("../target.zig");
1818const Type = @import("../Type.zig");
1919const Value = @import("../Value.zig");
......@@ -2772,7 +2772,7 @@ pub const Object = struct {
27722772 fn addCommonFnAttributes(
27732773 o: *Object,
27742774 attributes: *Builder.FunctionAttributes.Wip,
2775 owner_mod: *Package.Module,
2775 owner_mod: *Module,
27762776 omit_frame_pointer: bool,
27772777 ) Allocator.Error!void {
27782778 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 {
8080 );
8181}
8282
83fn ownerModule(fg: *const FuncGen) *Package.Module {
83fn ownerModule(fg: *const FuncGen) *Module {
8484 return fg.object.zcu.navFileScope(fg.nav_index).mod.?;
8585}
8686
......@@ -7739,7 +7739,7 @@ const mips_c_abi = @import("../mips/abi.zig");
77397739
77407740const Zcu = @import("../../Zcu.zig");
77417741const Air = @import("../../Air.zig");
7742const Package = @import("../../Package.zig");
7742const Module = @import("../../Module.zig");
77437743const InternPool = @import("../../InternPool.zig");
77447744const Value = @import("../../Value.zig");
77457745const Type = @import("../../Type.zig");
src/codegen/riscv64/CodeGen.zig+2-2
......@@ -14,7 +14,7 @@ const Type = @import("../../Type.zig");
1414const Value = @import("../../Value.zig");
1515const link = @import("../../link.zig");
1616const Zcu = @import("../../Zcu.zig");
17const Package = @import("../../Package.zig");
17const Module = @import("../../Module.zig");
1818const InternPool = @import("../../InternPool.zig");
1919const Compilation = @import("../../Compilation.zig");
2020const target_util = @import("../../target.zig");
......@@ -66,7 +66,7 @@ liveness: Air.Liveness,
6666bin_file: *link.File,
6767gpa: Allocator,
6868
69mod: *Package.Module,
69mod: *Module,
7070target: *const std.Target,
7171args: []MCValue,
7272ret_mcv: InstTracking,
src/codegen/x86_64/CodeGen.zig+1-1
......@@ -14,7 +14,7 @@ const Emit = @import("Emit.zig");
1414const Lower = @import("Lower.zig");
1515const Mir = @import("Mir.zig");
1616const Zcu = @import("../../Zcu.zig");
17const Module = @import("../../Package/Module.zig");
17const Module = @import("../../Module.zig");
1818const InternPool = @import("../../InternPool.zig");
1919const Type = @import("../../Type.zig");
2020const Value = @import("../../Value.zig");
src/libs/freebsd.zig+1-1
......@@ -12,7 +12,7 @@ const Compilation = @import("../Compilation.zig");
1212const build_options = @import("build_options");
1313const trace = @import("../tracy.zig").trace;
1414const Cache = std.Build.Cache;
15const Module = @import("../Package/Module.zig");
15const Module = @import("../Module.zig");
1616const link = @import("../link.zig");
1717
1818pub const CrtFile = enum {
src/libs/glibc.zig+1-1
......@@ -12,7 +12,7 @@ const Compilation = @import("../Compilation.zig");
1212const build_options = @import("build_options");
1313const trace = @import("../tracy.zig").trace;
1414const Cache = std.Build.Cache;
15const Module = @import("../Package/Module.zig");
15const Module = @import("../Module.zig");
1616const link = @import("../link.zig");
1717
1818pub const Lib = struct {
src/libs/libcxx.zig+1-1
......@@ -6,7 +6,7 @@ const target_util = @import("../target.zig");
66const Compilation = @import("../Compilation.zig");
77const build_options = @import("build_options");
88const trace = @import("../tracy.zig").trace;
9const Module = @import("../Package/Module.zig");
9const Module = @import("../Module.zig");
1010
1111const libcxxabi_files = [_][]const u8{
1212 "src/cxa_aux_runtime.cpp",
src/libs/libtsan.zig+1-1
......@@ -4,7 +4,7 @@ const assert = std.debug.assert;
44const Compilation = @import("../Compilation.zig");
55const build_options = @import("build_options");
66const trace = @import("../tracy.zig").trace;
7const Module = @import("../Package/Module.zig");
7const Module = @import("../Module.zig");
88
99pub const BuildError = error{
1010 OutOfMemory,
src/libs/libunwind.zig+1-1
......@@ -4,7 +4,7 @@ const assert = std.debug.assert;
44
55const target_util = @import("../target.zig");
66const Compilation = @import("../Compilation.zig");
7const Module = @import("../Package/Module.zig");
7const Module = @import("../Module.zig");
88const build_options = @import("build_options");
99const trace = @import("../tracy.zig").trace;
1010
src/libs/musl.zig+1-1
......@@ -3,7 +3,7 @@ const Allocator = std.mem.Allocator;
33const mem = std.mem;
44const path = std.fs.path;
55const assert = std.debug.assert;
6const Module = @import("../Package/Module.zig");
6const Module = @import("../Module.zig");
77
88const Compilation = @import("../Compilation.zig");
99const build_options = @import("build_options");
src/libs/netbsd.zig+1-1
......@@ -12,7 +12,7 @@ const Compilation = @import("../Compilation.zig");
1212const build_options = @import("build_options");
1313const trace = @import("../tracy.zig").trace;
1414const Cache = std.Build.Cache;
15const Module = @import("../Package/Module.zig");
15const Module = @import("../Module.zig");
1616const link = @import("../link.zig");
1717
1818pub const CrtFile = enum {
src/libs/openbsd.zig+1-1
......@@ -13,7 +13,7 @@ const Compilation = @import("../Compilation.zig");
1313const build_options = @import("build_options");
1414const trace = @import("../tracy.zig").trace;
1515const Cache = std.Build.Cache;
16const Module = @import("../Package/Module.zig");
16const Module = @import("../Module.zig");
1717const link = @import("../link.zig");
1818
1919pub const CrtFile = enum {
src/link.zig-1
......@@ -21,7 +21,6 @@ const Zcu = @import("Zcu.zig");
2121const InternPool = @import("InternPool.zig");
2222const Type = @import("Type.zig");
2323const Value = @import("Value.zig");
24const Package = @import("Package.zig");
2524const dev = @import("dev.zig");
2625const target_util = @import("target.zig");
2726const codegen = @import("codegen.zig");
src/link/C.zig+1-1
......@@ -13,7 +13,7 @@ const Path = std.Build.Cache.Path;
1313
1414const build_options = @import("build_options");
1515const Zcu = @import("../Zcu.zig");
16const Module = @import("../Package/Module.zig");
16const Module = @import("../Module.zig");
1717const InternPool = @import("../InternPool.zig");
1818const Alignment = InternPool.Alignment;
1919const Compilation = @import("../Compilation.zig");
src/link/Dwarf.zig+1-1
......@@ -10,7 +10,7 @@ const log = std.log.scoped(.dwarf);
1010const Writer = std.Io.Writer;
1111
1212const InternPool = @import("../InternPool.zig");
13const Module = @import("../Package.zig").Module;
13const Module = @import("../Module.zig");
1414const Type = @import("../Type.zig");
1515const Value = @import("../Value.zig");
1616const Zcu = @import("../Zcu.zig");
src/main.zig+14-15
......@@ -26,7 +26,6 @@ const allocPrint = std.fmt.allocPrint;
2626pub const tracy = @import("tracy.zig");
2727const Compilation = @import("Compilation.zig");
2828const link = @import("link.zig");
29const Package = @import("Package.zig");
3029const build_options = @import("build_options");
3130const wasi_libc = @import("libs/wasi_libc.zig");
3231const target_util = @import("target.zig");
......@@ -34,9 +33,9 @@ const crash_report = @import("crash_report.zig");
3433const Zcu = @import("Zcu.zig");
3534const mingw = @import("libs/mingw.zig");
3635const dev = @import("dev.zig");
36const Module = @import("Module.zig");
3737
3838test {
39 _ = Package;
4039 _ = @import("codegen.zig");
4140}
4241
......@@ -878,13 +877,13 @@ const CliModule = struct {
878877 root_path: []const u8,
879878 root_src_path: []const u8,
880879 cc_argv: []const []const u8,
881 inherited: Package.Module.CreateOptions.Inherited,
880 inherited: Module.CreateOptions.Inherited,
882881 target_arch_os_abi: ?[]const u8,
883882 target_mcpu: ?[]const u8,
884883 dynamic_linker: ?[]const u8,
885884
886885 deps: []const Dep,
887 resolved: ?*Package.Module,
886 resolved: ?*Module,
888887
889888 c_source_files_start: usize,
890889 c_source_files_end: usize,
......@@ -1035,7 +1034,7 @@ fn buildOutputType(
10351034
10361035 // These get set by CLI flags and then snapshotted when a `-M` flag is
10371036 // encountered.
1038 var mod_opts: Package.Module.CreateOptions.Inherited = .{};
1037 var mod_opts: Module.CreateOptions.Inherited = .{};
10391038
10401039 // These get appended to by CLI flags and then slurped when a `-M` flag
10411040 // is encountered.
......@@ -3266,7 +3265,7 @@ fn buildOutputType(
32663265 const root_mod = switch (arg_mode) {
32673266 .zig_test, .zig_test_obj => root_mod: {
32683267 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, .{
32703269 .paths = .{
32713270 .root = try .fromUnresolved(arena, dirs, &.{fs.path.dirname(test_runner) orelse "."}),
32723271 .root_src_path = fs.path.basename(test_runner),
......@@ -3279,7 +3278,7 @@ fn buildOutputType(
32793278 });
32803279 test_mod.deps = try main_mod.deps.clone(arena);
32813280 break :test_mod test_mod;
3282 } else try Package.Module.create(arena, .{
3281 } else try Module.create(arena, .{
32833282 .paths = .{
32843283 .root = try .fromRoot(arena, dirs, .zig_lib, "compiler"),
32853284 .root_src_path = "test_runner.zig",
......@@ -3973,10 +3972,10 @@ fn createModule(
39733972 io: Io,
39743973 create_module: *CreateModule,
39753974 index: usize,
3976 parent: ?*Package.Module,
3975 parent: ?*Module,
39773976 color: std.zig.Color,
39783977 environ_map: *process.Environ.Map,
3979) Allocator.Error!*Package.Module {
3978) Allocator.Error!*Module {
39803979 const cli_mod = &create_module.modules.values()[index];
39813980 if (cli_mod.resolved) |m| return m;
39823981
......@@ -4252,7 +4251,7 @@ fn createModule(
42524251
42534252 const root: Compilation.Path = try .fromUnresolved(arena, create_module.dirs, &.{cli_mod.root_path});
42544253
4255 const mod = Package.Module.create(arena, .{
4254 const mod = Module.create(arena, .{
42564255 .paths = .{
42574256 .root = root,
42584257 .root_src_path = cli_mod.root_src_path,
......@@ -4919,7 +4918,7 @@ fn jitCmdInner(
49194918 options: JitCmdOptions,
49204919) !void {
49214920 const target_query: std.Target.Query = .{};
4922 const resolved_target: Package.Module.ResolvedTarget = .{
4921 const resolved_target: Module.ResolvedTarget = .{
49234922 .result = std.zig.resolveTargetQueryOrFatal(io, target_query),
49244923 .is_native_os = true,
49254924 .is_native_abi = true,
......@@ -4959,7 +4958,7 @@ fn jitCmdInner(
49594958 // We want to release all the locks before executing the child process, so we make a nice
49604959 // big block here to ensure the cleanup gets run when we extract out our argv.
49614960 {
4962 const main_mod_paths: Package.Module.CreateOptions.Paths = .{
4961 const main_mod_paths: Module.CreateOptions.Paths = .{
49634962 .root = try .fromRoot(arena, dirs, .zig_lib, "compiler"),
49644963 .root_src_path = options.root_src_path,
49654964 };
......@@ -4974,7 +4973,7 @@ fn jitCmdInner(
49744973 .is_test = false,
49754974 });
49764975
4977 const root_mod = try Package.Module.create(arena, .{
4976 const root_mod = try Module.create(arena, .{
49784977 .paths = main_mod_paths,
49794978 .fully_qualified_name = "root",
49804979 .cc_argv = &.{},
......@@ -4988,7 +4987,7 @@ fn jitCmdInner(
49884987 });
49894988
49904989 if (options.depend_on_aro) {
4991 const aro_mod = try Package.Module.create(arena, .{
4990 const aro_mod = try Module.create(arena, .{
49924991 .paths = .{
49934992 .root = try .fromRoot(arena, dirs, .zig_lib, "compiler/aro"),
49944993 .root_src_path = "aro.zig",
......@@ -6023,7 +6022,7 @@ fn handleModArg(
60236022 mod_name: []const u8,
60246023 opt_root_src_orig: ?[]const u8,
60256024 create_module: *CreateModule,
6026 mod_opts: *Package.Module.CreateOptions.Inherited,
6025 mod_opts: *Module.CreateOptions.Inherited,
60276026 cc_argv: *std.ArrayList([]const u8),
60286027 target_arch_os_abi: *?[]const u8,
60296028 target_mcpu: *?[]const u8,