authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-21 13:27:52-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-21 17:03:04-07:00
logfee5aad699232d4feeece72f345d09d67faf1494
tree71f9c4a28b7ec44d954665b3c55f73995aed7c10
parentf203334878d854c17c00c0447c748d9ea5e491e5

stage2: remove unused parameter from importPkg


3 files changed, 5 insertions(+), 6 deletions(-)

src/Compilation.zig+1-1
...@@ -1639,7 +1639,7 @@ pub fn update(self: *Compilation) !void {...@@ -1639,7 +1639,7 @@ pub fn update(self: *Compilation) !void {
1639 // Make sure std.zig is inside the import_table. We unconditionally need1639 // Make sure std.zig is inside the import_table. We unconditionally need
1640 // it for start.zig.1640 // it for start.zig.
1641 const std_pkg = module.root_pkg.table.get("std").?;1641 const std_pkg = module.root_pkg.table.get("std").?;
1642 _ = try module.importPkg(module.root_pkg, std_pkg);1642 _ = try module.importPkg(std_pkg);
16431643
1644 // Put a work item in for every known source file to detect if1644 // Put a work item in for every known source file to detect if
1645 // it changed, and, if so, re-compute ZIR and then queue the job1645 // it changed, and, if so, re-compute ZIR and then queue the job
src/Module.zig+3-4
...@@ -2831,7 +2831,7 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl: *Decl) InnerError!void {...@@ -2831,7 +2831,7 @@ pub fn ensureDeclAnalyzed(mod: *Module, decl: *Decl) InnerError!void {
2831}2831}
28322832
2833pub fn semaPkg(mod: *Module, pkg: *Package) !void {2833pub fn semaPkg(mod: *Module, pkg: *Package) !void {
2834 const file = (try mod.importPkg(mod.root_pkg, pkg)).file;2834 const file = (try mod.importPkg(pkg)).file;
2835 return mod.semaFile(file);2835 return mod.semaFile(file);
2836}2836}
28372837
...@@ -3130,8 +3130,7 @@ pub const ImportFileResult = struct {...@@ -3130,8 +3130,7 @@ pub const ImportFileResult = struct {
3130 is_new: bool,3130 is_new: bool,
3131};3131};
31323132
3133pub fn importPkg(mod: *Module, cur_pkg: *Package, pkg: *Package) !ImportFileResult {3133pub fn importPkg(mod: *Module, pkg: *Package) !ImportFileResult {
3134 _ = cur_pkg;
3135 const gpa = mod.gpa;3134 const gpa = mod.gpa;
31363135
3137 // The resolved path is used as the key in the import table, to detect if3136 // The resolved path is used as the key in the import table, to detect if
...@@ -3184,7 +3183,7 @@ pub fn importFile(...@@ -3184,7 +3183,7 @@ pub fn importFile(
3184 import_string: []const u8,3183 import_string: []const u8,
3185) !ImportFileResult {3184) !ImportFileResult {
3186 if (cur_file.pkg.table.get(import_string)) |pkg| {3185 if (cur_file.pkg.table.get(import_string)) |pkg| {
3187 return mod.importPkg(cur_file.pkg, pkg);3186 return mod.importPkg(pkg);
3188 }3187 }
3189 const gpa = mod.gpa;3188 const gpa = mod.gpa;
31903189
src/Sema.zig+1-1
...@@ -7556,7 +7556,7 @@ fn getBuiltinType(...@@ -7556,7 +7556,7 @@ fn getBuiltinType(
7556) InnerError!Type {7556) InnerError!Type {
7557 const mod = sema.mod;7557 const mod = sema.mod;
7558 const std_pkg = mod.root_pkg.table.get("std").?;7558 const std_pkg = mod.root_pkg.table.get("std").?;
7559 const std_file = (mod.importPkg(mod.root_pkg, std_pkg) catch unreachable).file;7559 const std_file = (mod.importPkg(std_pkg) catch unreachable).file;
7560 const opt_builtin_inst = try sema.analyzeNamespaceLookup(7560 const opt_builtin_inst = try sema.analyzeNamespaceLookup(
7561 block,7561 block,
7562 src,7562 src,