@@ -1058,6 +1058,8 @@ pub const Object = struct {
1058
1058
sanitize_address: bool,
1059
1059
fuzz: bool,
1060
1060
lto: Compilation.Config.LtoMode,
1061
+
1062
+ prog_node: std.Progress.Node,
1061
1063
};
1062
1064
1063
1065
pub fn emit(o: *Object, options: EmitOptions) error{ LinkFailure, OutOfMemory }!void {
@@ -1320,7 +1322,15 @@ pub const Object = struct {
1320
1322
if (count <= 0) @panic("ZIG_MULTITHREAD_EMIT must be greater than 0");
1321
1323
break :blk split_buf[0..count];
1322
1324
} else split_buf[0..1];
1323
- if (split_res.len > 1) module.split(split_res) else split_res[0] = module;
1325
+ if (split_res.len > 1) {
1326
+ const sub = options.prog_node.start("Split Module", 1);
1327
+ defer sub.end();
1328
+
1329
+ module.split(split_res);
1330
+ } else split_res[0] = module;
1331
+
1332
+ const sub = options.prog_node.start("Do Emit", split_res.len);
1333
+ defer sub.end();
1324
1334
1325
1335
var threads: [32]std.Thread = undefined;
1326
1336
for (split_res, threads[0..split_res.len], 0..) |m, *t, i| {
@@ -1335,11 +1345,18 @@ pub const Object = struct {
1335
1345
m,
1336
1346
&options,
1337
1347
i,
1348
+ sub,
1338
1349
}) catch @panic("thread spawn fail");
1339
1350
}
1340
1351
for (threads[0..split_res.len]) |*t| {
1341
1352
t.join();
1342
1353
}
1354
+
1355
+ // done!
1356
+ if (split_res.len > 1) {
1357
+ std.log.err("LLVM SPLIT EMIT ENDED. EARLY-EXITING.", .{});
1358
+ std.process.exit(0);
1359
+ }
1343
1360
}
1344
1361
fn emit_thread(
1345
1362
target: *llvm.Target,
@@ -1352,7 +1369,10 @@ pub const Object = struct {
1352
1369
module: *llvm.Module,
1353
1370
options: *const EmitOptions,
1354
1371
index: usize,
1372
+ prog_node: std.Progress.Node,
1355
1373
) void {
1374
+ defer prog_node.completeOne();
1375
+
1356
1376
var error_message: [*:0]const u8 = undefined;
1357
1377
var target_machine = llvm.TargetMachine.create(
1358
1378
target,
0 commit comments