[lld] r230905 - Revert "PECOFF: Don't parse files in .drectve asynchronously."

Rui Ueyama ruiu at google.com
Sun Mar 1 12:48:14 PST 2015


Author: ruiu
Date: Sun Mar  1 14:48:14 2015
New Revision: 230905

URL: http://llvm.org/viewvc/llvm-project?rev=230905&view=rev
Log:
Revert "PECOFF: Don't parse files in .drectve asynchronously."

This reverts commit r228955. Previously files appear in a .drectve
section are parsed synchronously to avoid threading issues. I believe
it's now safe to do that asynchronously.

Modified:
    lld/trunk/lib/Driver/WinLinkDriver.cpp

Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=230905&r1=230904&r2=230905&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Sun Mar  1 14:48:14 2015
@@ -1341,8 +1341,10 @@ bool WinLinkDriver::parse(int argc, cons
 
   // Add the input files to the linking context.
   for (std::unique_ptr<File> &file : files) {
-    if (isReadingDirectiveSection)
-      file.get()->parse();
+    if (isReadingDirectiveSection) {
+      File *f = file.get();
+      ctx.getTaskGroup().spawn([f] { f->parse(); });
+    }
     ctx.getNodes().push_back(llvm::make_unique<FileNode>(std::move(file)));
   }
 
@@ -1355,8 +1357,10 @@ bool WinLinkDriver::parse(int argc, cons
   // Add the library files to the library group.
   for (std::unique_ptr<File> &file : libraries) {
     if (!hasLibrary(ctx, file.get())) {
-      if (isReadingDirectiveSection)
-        file.get()->parse();
+      if (isReadingDirectiveSection) {
+        File *f = file.get();
+        ctx.getTaskGroup().spawn([f] { f->parse(); });
+      }
       ctx.addLibraryFile(llvm::make_unique<FileNode>(std::move(file)));
     }
   }





More information about the llvm-commits mailing list