AstGen: implement global variable decls

This commit is contained in:
Andrew Kelley
2021-04-15 20:34:21 -07:00
parent 7818586a2b
commit 8387307807
3 changed files with 154 additions and 512 deletions

View File

@@ -2457,6 +2457,9 @@ fn freeExportList(gpa: *Allocator, export_list: []*Export) void {
}
pub fn astGenFile(mod: *Module, file: *Scope.File, prog_node: *std.Progress.Node) !void {
const tracy = trace(@src());
defer tracy.end();
const comp = mod.comp;
const gpa = mod.gpa;
@@ -2468,7 +2471,9 @@ pub fn astGenFile(mod: *Module, file: *Scope.File, prog_node: *std.Progress.Node
// Determine whether we need to reload the file from disk and redo parsing and AstGen.
switch (file.status) {
.never_loaded, .retryable_failure => {},
.never_loaded, .retryable_failure => {
log.debug("first-time AstGen: {s}", .{file.sub_file_path});
},
.parse_failure, .astgen_failure, .success => {
const unchanged_metadata =
stat.size == file.stat_size and