zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit fee5aad699232d4feeece72f345d09d67faf1494 (tree)
parent f203334878d854c17c00c0447c748d9ea5e491e5
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Mon, 21 Jun 2021 13:27:52 -0700

stage2: remove unused parameter from importPkg

Diffstat:
Msrc/Compilation.zig | 2+-
Msrc/Module.zig | 7+++----
Msrc/Sema.zig | 2+-
3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/Compilation.zig b/src/Compilation.zig @@ -1639,7 +1639,7 @@ pub fn update(self: *Compilation) !void { // Make sure std.zig is inside the import_table. We unconditionally need // it for start.zig. const std_pkg = module.root_pkg.table.get("std").?; - _ = try module.importPkg(module.root_pkg, std_pkg); + _ = try module.importPkg(std_pkg); // Put a work item in for every known source file to detect if // it changed, and, if so, re-compute ZIR and then queue the job diff --git a/src/Module.zig b/src/Module.zig @@ -2831,7 +2831,7 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl: *Decl) InnerError!void { } pub fn semaPkg(mod: *Module, pkg: *Package) !void { - const file = (try mod.importPkg(mod.root_pkg, pkg)).file; + const file = (try mod.importPkg(pkg)).file; return mod.semaFile(file); } @@ -3130,8 +3130,7 @@ pub const ImportFileResult = struct { is_new: bool, }; -pub fn importPkg(mod: *Module, cur_pkg: *Package, pkg: *Package) !ImportFileResult { - _ = cur_pkg; +pub fn importPkg(mod: *Module, pkg: *Package) !ImportFileResult { const gpa = mod.gpa; // The resolved path is used as the key in the import table, to detect if @@ -3184,7 +3183,7 @@ pub fn importFile( import_string: []const u8, ) !ImportFileResult { if (cur_file.pkg.table.get(import_string)) |pkg| { - return mod.importPkg(cur_file.pkg, pkg); + return mod.importPkg(pkg); } const gpa = mod.gpa; diff --git a/src/Sema.zig b/src/Sema.zig @@ -7556,7 +7556,7 @@ fn getBuiltinType( ) InnerError!Type { const mod = sema.mod; const std_pkg = mod.root_pkg.table.get("std").?; - const std_file = (mod.importPkg(mod.root_pkg, std_pkg) catch unreachable).file; + const std_file = (mod.importPkg(std_pkg) catch unreachable).file; const opt_builtin_inst = try sema.analyzeNamespaceLookup( block, src,