| ... | @@ -201,8 +201,6 @@ const Job = union(enum) { | ... | @@ -201,8 +201,6 @@ const Job = union(enum) { |
| 201 | /// calls to, for example, memcpy and memset. | 201 | /// calls to, for example, memcpy and memset. |
| 202 | zig_libc: void, | 202 | zig_libc: void, |
| 203 | | 203 | |
| 204 | /// Generate builtin.zig source code and write it into the correct place. | | |
| 205 | generate_builtin_zig: void, | | |
| 206 | /// Use stage1 C++ code to compile zig code into an object file. | 204 | /// Use stage1 C++ code to compile zig code into an object file. |
| 207 | stage1_module: void, | 205 | stage1_module: void, |
| 208 | | 206 | |
| ... | @@ -1307,10 +1305,6 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { | ... | @@ -1307,10 +1305,6 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { |
| 1307 | try comp.astgen_wait_group.init(); | 1305 | try comp.astgen_wait_group.init(); |
| 1308 | errdefer comp.astgen_wait_group.deinit(); | 1306 | errdefer comp.astgen_wait_group.deinit(); |
| 1309 | | 1307 | |
| 1310 | if (comp.bin_file.options.module) |mod| { | | |
| 1311 | try comp.work_queue.writeItem(.{ .generate_builtin_zig = {} }); | | |
| 1312 | } | | |
| 1313 | | | |
| 1314 | // Add a `CObject` for each `c_source_files`. | 1308 | // Add a `CObject` for each `c_source_files`. |
| 1315 | try comp.c_object_table.ensureCapacity(gpa, options.c_source_files.len); | 1309 | try comp.c_object_table.ensureCapacity(gpa, options.c_source_files.len); |
| 1316 | for (options.c_source_files) |c_source_file| { | 1310 | for (options.c_source_files) |c_source_file| { |
| ... | @@ -1764,6 +1758,15 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor | ... | @@ -1764,6 +1758,15 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor |
| 1764 | defer main_progress_node.end(); | 1758 | defer main_progress_node.end(); |
| 1765 | if (self.color == .off) progress.terminal = null; | 1759 | if (self.color == .off) progress.terminal = null; |
| 1766 | | 1760 | |
| | 1761 | // If we need to write out builtin.zig, it needs to be done before starting |
| | 1762 | // the AstGen tasks. |
| | 1763 | if (self.bin_file.options.module) |mod| { |
| | 1764 | if (mod.job_queued_update_builtin_zig) { |
| | 1765 | mod.job_queued_update_builtin_zig = false; |
| | 1766 | try self.updateBuiltinZigFile(mod); |
| | 1767 | } |
| | 1768 | } |
| | 1769 | |
| 1767 | // Here we queue up all the AstGen tasks first, followed by C object compilation. | 1770 | // Here we queue up all the AstGen tasks first, followed by C object compilation. |
| 1768 | // We wait until the AstGen tasks are all completed before proceeding to the | 1771 | // We wait until the AstGen tasks are all completed before proceeding to the |
| 1769 | // (at least for now) single-threaded main work queue. However, C object compilation | 1772 | // (at least for now) single-threaded main work queue. However, C object compilation |
| ... | @@ -2086,10 +2089,6 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor | ... | @@ -2086,10 +2089,6 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor |
| 2086 | ), | 2089 | ), |
| 2087 | }; | 2090 | }; |
| 2088 | }, | 2091 | }, |
| 2089 | .generate_builtin_zig => { | | |
| 2090 | // This Job is only queued up if there is a zig module. | | |
| 2091 | try self.updateBuiltinZigFile(self.bin_file.options.module.?); | | |
| 2092 | }, | | |
| 2093 | .stage1_module => { | 2092 | .stage1_module => { |
| 2094 | if (!build_options.is_stage1) | 2093 | if (!build_options.is_stage1) |
| 2095 | unreachable; | 2094 | unreachable; |