@@ -1457,8 +1457,10 @@ pub const Task = union(enum) {
1457
1457
pub fn doTask (comp : * Compilation , tid : usize , task : Task ) void {
1458
1458
const diags = & comp .link_diags ;
1459
1459
switch (task ) {
1460
- .load_explicitly_provided = > if ( comp . bin_file ) | base | {
1460
+ .load_explicitly_provided = > {
1461
1461
comp .remaining_prelink_tasks -= 1 ;
1462
+ const base = comp .bin_file orelse return ;
1463
+
1462
1464
const prog_node = comp .work_queue_progress_node .start ("Parse Linker Inputs" , comp .link_inputs .len );
1463
1465
defer prog_node .end ();
1464
1466
for (comp .link_inputs ) | input | {
@@ -1475,8 +1477,10 @@ pub fn doTask(comp: *Compilation, tid: usize, task: Task) void {
1475
1477
prog_node .completeOne ();
1476
1478
}
1477
1479
},
1478
- .load_host_libc = > if ( comp . bin_file ) | base | {
1480
+ .load_host_libc = > {
1479
1481
comp .remaining_prelink_tasks -= 1 ;
1482
+ const base = comp .bin_file orelse return ;
1483
+
1480
1484
const prog_node = comp .work_queue_progress_node .start ("Linker Parse Host libc" , 0 );
1481
1485
defer prog_node .end ();
1482
1486
@@ -1535,26 +1539,29 @@ pub fn doTask(comp: *Compilation, tid: usize, task: Task) void {
1535
1539
}
1536
1540
}
1537
1541
},
1538
- .load_object = > | path | if ( comp . bin_file ) | base | {
1542
+ .load_object = > | path | {
1539
1543
comp .remaining_prelink_tasks -= 1 ;
1544
+ const base = comp .bin_file orelse return ;
1540
1545
const prog_node = comp .work_queue_progress_node .start ("Linker Parse Object" , 0 );
1541
1546
defer prog_node .end ();
1542
1547
base .openLoadObject (path ) catch | err | switch (err ) {
1543
1548
error .LinkFailure = > return , // error reported via diags
1544
1549
else = > | e | diags .addParseError (path , "failed to parse object: {s}" , .{@errorName (e )}),
1545
1550
};
1546
1551
},
1547
- .load_archive = > | path | if ( comp . bin_file ) | base | {
1552
+ .load_archive = > | path | {
1548
1553
comp .remaining_prelink_tasks -= 1 ;
1554
+ const base = comp .bin_file orelse return ;
1549
1555
const prog_node = comp .work_queue_progress_node .start ("Linker Parse Archive" , 0 );
1550
1556
defer prog_node .end ();
1551
1557
base .openLoadArchive (path , null ) catch | err | switch (err ) {
1552
1558
error .LinkFailure = > return , // error reported via link_diags
1553
1559
else = > | e | diags .addParseError (path , "failed to parse archive: {s}" , .{@errorName (e )}),
1554
1560
};
1555
1561
},
1556
- .load_dso = > | path | if ( comp . bin_file ) | base | {
1562
+ .load_dso = > | path | {
1557
1563
comp .remaining_prelink_tasks -= 1 ;
1564
+ const base = comp .bin_file orelse return ;
1558
1565
const prog_node = comp .work_queue_progress_node .start ("Linker Parse Shared Library" , 0 );
1559
1566
defer prog_node .end ();
1560
1567
base .openLoadDso (path , .{
@@ -1565,8 +1572,9 @@ pub fn doTask(comp: *Compilation, tid: usize, task: Task) void {
1565
1572
else = > | e | diags .addParseError (path , "failed to parse shared library: {s}" , .{@errorName (e )}),
1566
1573
};
1567
1574
},
1568
- .load_input = > | input | if ( comp . bin_file ) | base | {
1575
+ .load_input = > | input | {
1569
1576
comp .remaining_prelink_tasks -= 1 ;
1577
+ const base = comp .bin_file orelse return ;
1570
1578
const prog_node = comp .work_queue_progress_node .start ("Linker Parse Input" , 0 );
1571
1579
defer prog_node .end ();
1572
1580
base .loadInput (input ) catch | err | switch (err ) {
0 commit comments