stage2: remove unused parameter from importPkg

This commit is contained in:
Andrew Kelley 2021-06-21 13:27:52 -07:00
parent f203334878
commit fee5aad699
3 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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;

View File

@ -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,