@@ -120,7 +120,7 @@ template <class ELFT> class ICF {
120120 void forEachClassRange (size_t begin, size_t end,
121121 llvm::function_ref<void (size_t , size_t )> fn);
122122
123- void forEachClass (llvm::function_ref<void (size_t , size_t )> fn);
123+ void parallelForEachClass (llvm::function_ref<void (size_t , size_t )> fn);
124124
125125 Ctx &ctx;
126126 SmallVector<InputSection *, 0 > sections;
@@ -433,7 +433,7 @@ void ICF<ELFT>::forEachClassRange(size_t begin, size_t end,
433433
434434// Call Fn on each equivalence class.
435435template <class ELFT >
436- void ICF<ELFT>::forEachClass (llvm::function_ref<void (size_t , size_t )> fn) {
436+ void ICF<ELFT>::parallelForEachClass (llvm::function_ref<void (size_t , size_t )> fn) {
437437 // If threading is disabled or the number of sections are
438438 // too small to use threading, call Fn sequentially.
439439 if (parallel::strategy.ThreadsRequested == 1 || sections.size () < 1024 ) {
@@ -541,14 +541,14 @@ template <class ELFT> void ICF<ELFT>::run() {
541541 // static content. Use a base offset for these IDs to ensure no overlap with
542542 // the unique IDs already assigned.
543543 uint32_t eqClassBase = ++uniqueId;
544- forEachClass ([&](size_t begin, size_t end) {
544+ parallelForEachClass ([&](size_t begin, size_t end) {
545545 segregate (begin, end, eqClassBase, true );
546546 });
547547
548548 // Split groups by comparing relocations until convergence is obtained.
549549 do {
550550 repeat = false ;
551- forEachClass ([&](size_t begin, size_t end) {
551+ parallelForEachClass ([&](size_t begin, size_t end) {
552552 segregate (begin, end, eqClassBase, false );
553553 });
554554 } while (repeat);
0 commit comments