[lld] r248098 - COFF: Actually parallelize InputFile::parse().

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 19 14:33:26 PDT 2015


Author: ruiu
Date: Sat Sep 19 16:33:26 2015
New Revision: 248098

URL: http://llvm.org/viewvc/llvm-project?rev=248098&view=rev
Log:
COFF: Actually parallelize InputFile::parse().

This is a follow-up patch to r248078.

Modified:
    lld/trunk/COFF/SymbolTable.cpp

Modified: lld/trunk/COFF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/SymbolTable.cpp?rev=248098&r1=248097&r2=248098&view=diff
==============================================================================
--- lld/trunk/COFF/SymbolTable.cpp (original)
+++ lld/trunk/COFF/SymbolTable.cpp Sat Sep 19 16:33:26 2015
@@ -56,8 +56,8 @@ void SymbolTable::readArchives() {
   if (ArchiveQueue.empty())
     return;
 
-  std::for_each(ArchiveQueue.begin(), ArchiveQueue.end(),
-                [](ArchiveFile *File) { File->parse(); });
+  parallel_for_each(ArchiveQueue.begin(), ArchiveQueue.end(),
+                    [](ArchiveFile *File) { File->parse(); });
 
   // Add lazy symbols to the symbol table. Lazy symbols that conflict
   // with existing undefined symbols are accumulated in LazySyms.
@@ -83,8 +83,8 @@ void SymbolTable::readObjects() {
   // Add defined and undefined symbols to the symbol table.
   std::vector<StringRef> Directives;
   for (size_t I = 0; I < ObjectQueue.size();) {
-    std::for_each(ObjectQueue.begin() + I, ObjectQueue.end(),
-                  [](InputFile *File) { File->parse(); });
+    parallel_for_each(ObjectQueue.begin() + I, ObjectQueue.end(),
+                      [](InputFile *File) { File->parse(); });
     for (size_t E = ObjectQueue.size(); I != E; ++I) {
       InputFile *File = ObjectQueue[I];
       if (Config->Verbose)




More information about the llvm-commits mailing list