| ... | ... | @@ -222,9 +222,6 @@ emit_asm: ?EmitLoc, |
| 222 | 222 | emit_llvm_ir: ?EmitLoc, |
| 223 | 223 | emit_llvm_bc: ?EmitLoc, |
| 224 | 224 | |
| 225 | | work_queue_wait_group: WaitGroup = .{}, |
| 226 | | astgen_wait_group: WaitGroup = .{}, |
| 227 | | |
| 228 | 225 | llvm_opt_bisect_limit: c_int, |
| 229 | 226 | |
| 230 | 227 | pub const Emit = struct { |
| ... | ... | @@ -3251,13 +3248,13 @@ pub fn performAllTheWork( |
| 3251 | 3248 | // (at least for now) single-threaded main work queue. However, C object compilation |
| 3252 | 3249 | // only needs to be finished by the end of this function. |
| 3253 | 3250 | |
| 3254 | | comp.work_queue_wait_group.reset(); |
| 3255 | | defer comp.work_queue_wait_group.wait(); |
| 3251 | var work_queue_wait_group: WaitGroup = .{}; |
| 3252 | defer comp.thread_pool.waitAndWork(&work_queue_wait_group); |
| 3256 | 3253 | |
| 3257 | 3254 | if (!build_options.only_c and !build_options.only_core_functionality) { |
| 3258 | 3255 | if (comp.docs_emit != null) { |
| 3259 | | comp.thread_pool.spawnWg(&comp.work_queue_wait_group, workerDocsCopy, .{comp}); |
| 3260 | | comp.work_queue_wait_group.spawnManager(workerDocsWasm, .{ comp, main_progress_node }); |
| 3256 | comp.thread_pool.spawnWg(&work_queue_wait_group, workerDocsCopy, .{comp}); |
| 3257 | work_queue_wait_group.spawnManager(workerDocsWasm, .{ comp, main_progress_node }); |
| 3261 | 3258 | } |
| 3262 | 3259 | } |
| 3263 | 3260 | |
| ... | ... | @@ -3268,8 +3265,8 @@ pub fn performAllTheWork( |
| 3268 | 3265 | const zir_prog_node = main_progress_node.start("AST Lowering", 0); |
| 3269 | 3266 | defer zir_prog_node.end(); |
| 3270 | 3267 | |
| 3271 | | comp.astgen_wait_group.reset(); |
| 3272 | | defer comp.astgen_wait_group.wait(); |
| 3268 | var astgen_wait_group: WaitGroup = .{}; |
| 3269 | defer comp.thread_pool.waitAndWork(&astgen_wait_group); |
| 3273 | 3270 | |
| 3274 | 3271 | // builtin.zig is handled specially for two reasons: |
| 3275 | 3272 | // 1. to avoid race condition of zig processes truncating each other's builtin.zig files |
| ... | ... | @@ -3291,33 +3288,33 @@ pub fn performAllTheWork( |
| 3291 | 3288 | |
| 3292 | 3289 | const file = mod.builtin_file orelse continue; |
| 3293 | 3290 | |
| 3294 | | comp.thread_pool.spawnWg(&comp.astgen_wait_group, workerUpdateBuiltinZigFile, .{ |
| 3291 | comp.thread_pool.spawnWg(&astgen_wait_group, workerUpdateBuiltinZigFile, .{ |
| 3295 | 3292 | comp, mod, file, |
| 3296 | 3293 | }); |
| 3297 | 3294 | } |
| 3298 | 3295 | } |
| 3299 | 3296 | |
| 3300 | 3297 | while (comp.astgen_work_queue.readItem()) |file| { |
| 3301 | | comp.thread_pool.spawnWg(&comp.astgen_wait_group, workerAstGenFile, .{ |
| 3302 | | comp, file, zir_prog_node, &comp.astgen_wait_group, .root, |
| 3298 | comp.thread_pool.spawnWg(&astgen_wait_group, workerAstGenFile, .{ |
| 3299 | comp, file, zir_prog_node, &astgen_wait_group, .root, |
| 3303 | 3300 | }); |
| 3304 | 3301 | } |
| 3305 | 3302 | |
| 3306 | 3303 | while (comp.embed_file_work_queue.readItem()) |embed_file| { |
| 3307 | | comp.thread_pool.spawnWg(&comp.astgen_wait_group, workerCheckEmbedFile, .{ |
| 3304 | comp.thread_pool.spawnWg(&astgen_wait_group, workerCheckEmbedFile, .{ |
| 3308 | 3305 | comp, embed_file, |
| 3309 | 3306 | }); |
| 3310 | 3307 | } |
| 3311 | 3308 | |
| 3312 | 3309 | while (comp.c_object_work_queue.readItem()) |c_object| { |
| 3313 | | comp.thread_pool.spawnWg(&comp.work_queue_wait_group, workerUpdateCObject, .{ |
| 3310 | comp.thread_pool.spawnWg(&work_queue_wait_group, workerUpdateCObject, .{ |
| 3314 | 3311 | comp, c_object, main_progress_node, |
| 3315 | 3312 | }); |
| 3316 | 3313 | } |
| 3317 | 3314 | |
| 3318 | 3315 | if (!build_options.only_core_functionality) { |
| 3319 | 3316 | while (comp.win32_resource_work_queue.readItem()) |win32_resource| { |
| 3320 | | comp.thread_pool.spawnWg(&comp.work_queue_wait_group, workerUpdateWin32Resource, .{ |
| 3317 | comp.thread_pool.spawnWg(&work_queue_wait_group, workerUpdateWin32Resource, .{ |
| 3321 | 3318 | comp, win32_resource, main_progress_node, |
| 3322 | 3319 | }); |
| 3323 | 3320 | } |