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