File tree 2 files changed +9
-11
lines changed
2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,10 @@ int mold_main(int argc, char **argv) {
332
332
});
333
333
}
334
334
335
+ // Handle -repro
336
+ if (ctx.arg .repro )
337
+ write_repro_file (ctx);
338
+
335
339
Timer t_before_copy (ctx, " before_copy" );
336
340
337
341
// Apply -exclude-libs
@@ -454,10 +458,6 @@ int mold_main(int argc, char **argv) {
454
458
if (ctx.arg .print_dependencies )
455
459
print_dependencies (ctx);
456
460
457
- // Handle -repro
458
- if (ctx.arg .repro )
459
- write_repro_file (ctx);
460
-
461
461
// Handle --require-defined
462
462
for (Symbol<E> *sym : ctx.arg .require_defined )
463
463
if (!sym->file )
Original file line number Diff line number Diff line change @@ -1305,8 +1305,8 @@ void fixup_ctors_in_init_array(Context<E> &ctx) {
1305
1305
reverse_contents (*isec);
1306
1306
}
1307
1307
1308
- template <typename T >
1309
- static void shuffle (std::vector<T > &vec, u64 seed) {
1308
+ template <typename E >
1309
+ static void shuffle (std::vector<InputSection<E> * > &vec, u64 seed) {
1310
1310
if (vec.empty ())
1311
1311
return ;
1312
1312
@@ -1402,18 +1402,16 @@ void compute_section_sizes(Context<E> &ctx) {
1402
1402
Timer t (ctx, " compute_section_sizes" );
1403
1403
1404
1404
if constexpr (needs_thunk<E>) {
1405
- std::vector<Chunk<E> *> vec = ctx.chunks ;
1406
-
1407
- auto mid = std::partition (vec.begin (), vec.end (), [&](Chunk<E> *chunk) {
1405
+ auto tail = ranges::partition (ctx.chunks , [&](Chunk<E> *chunk) {
1408
1406
return chunk->to_osec () && (chunk->shdr .sh_flags & SHF_EXECINSTR) &&
1409
1407
!ctx.arg .relocatable ;
1410
1408
});
1411
1409
1412
1410
// create_range_extension_thunks is not thread-safe
1413
- for (Chunk<E> *chunk : std::span (vec.begin (), mid ))
1411
+ for (Chunk<E> *chunk : std::span (vec.begin (), tail. begin () ))
1414
1412
chunk->to_osec ()->create_range_extension_thunks (ctx, true );
1415
1413
1416
- tbb::parallel_for_each (mid, vec .end (), [&](Chunk<E> *chunk) {
1414
+ tbb::parallel_for_each (tail. begin (), tail .end (), [&](Chunk<E> *chunk) {
1417
1415
chunk->compute_section_size (ctx);
1418
1416
});
1419
1417
} else {
You can’t perform that action at this time.
0 commit comments