| ... | ... | @@ -697,16 +697,9 @@ pub const Module = struct { |
| 697 | 697 | }; |
| 698 | 698 | } |
| 699 | 699 | |
| 700 | | fn analyzeRoot(self: *Module, root_scope: *Scope.ZIRModule) !void { |
| 701 | | // TODO use the cache to identify, from the modified source files, the decls which have |
| 702 | | // changed based on the span of memory that represents the decl in the re-parsed source file. |
| 703 | | // Use the cached dependency graph to recursively determine the set of decls which need |
| 704 | | // regeneration. |
| 705 | | // Here we simulate adding a source file which was previously not part of the compilation, |
| 706 | | // which means scanning the decls looking for exports. |
| 707 | | // TODO also identify decls that need to be deleted. |
| 708 | | const src_module = switch (root_scope.status) { |
| 709 | | .unloaded => blk: { |
| 700 | fn getTextModule(self: *Module, root_scope: *Scope.ZIRModule) !*text.Module { |
| 701 | switch (root_scope.status) { |
| 702 | .unloaded => { |
| 710 | 703 | try self.failed_files.ensureCapacity(self.failed_files.size + 1); |
| 711 | 704 | |
| 712 | 705 | var keep_source = false; |
| ... | ... | @@ -743,12 +736,23 @@ pub const Module = struct { |
| 743 | 736 | root_scope.contents = .{ .module = zir_module }; |
| 744 | 737 | keep_zir_module = true; |
| 745 | 738 | |
| 746 | | break :blk zir_module; |
| 739 | return zir_module; |
| 747 | 740 | }, |
| 748 | 741 | |
| 749 | 742 | .unloaded_parse_failure, .loaded_parse_failure => return error.AnalysisFail, |
| 750 | | .loaded_success => root_scope.contents.module, |
| 751 | | }; |
| 743 | .loaded_success => return root_scope.contents.module, |
| 744 | } |
| 745 | } |
| 746 | |
| 747 | fn analyzeRoot(self: *Module, root_scope: *Scope.ZIRModule) !void { |
| 748 | // TODO use the cache to identify, from the modified source files, the decls which have |
| 749 | // changed based on the span of memory that represents the decl in the re-parsed source file. |
| 750 | // Use the cached dependency graph to recursively determine the set of decls which need |
| 751 | // regeneration. |
| 752 | // Here we simulate adding a source file which was previously not part of the compilation, |
| 753 | // which means scanning the decls looking for exports. |
| 754 | // TODO also identify decls that need to be deleted. |
| 755 | const src_module = try self.getTextModule(root_scope); |
| 752 | 756 | |
| 753 | 757 | // Here we ensure enough queue capacity to store all the decls, so that later we can use |
| 754 | 758 | // appendAssumeCapacity. |