stage2/link: clarify comments on calling order

This commit is contained in:
Isaac Freund 2020-08-18 10:54:54 +02:00 committed by Andrew Kelley
parent 15bcfcd368
commit 741fb8d306

View File

@ -110,6 +110,8 @@ pub const File = struct {
}
}
/// May be called before or after updateDeclExports but must be called
/// after allocateDeclIndexes for any given Decl.
pub fn updateDecl(base: *File, module: *Module, decl: *Module.Decl) !void {
switch (base.tag) {
.elf => return @fieldParentPtr(Elf, "base", base).updateDecl(module, decl),
@ -127,6 +129,8 @@ pub const File = struct {
}
}
/// Must be called before any call to updateDecl or updateDeclExports for
/// any given Decl.
pub fn allocateDeclIndexes(base: *File, decl: *Module.Decl) !void {
switch (base.tag) {
.elf => return @fieldParentPtr(Elf, "base", base).allocateDeclIndexes(decl),
@ -200,7 +204,8 @@ pub const File = struct {
};
}
/// Must be called only after a successful call to `updateDecl`.
/// May be called before or after updateDecl, but must be called after
/// allocateDeclIndexes for any given Decl.
pub fn updateDeclExports(
base: *File,
module: *Module,