From 990bb1603648fd85421a2d4f253ae393d4703c48 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sun, 1 Mar 2015 20:48:14 +0000 Subject: [PATCH] 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. llvm-svn: 230905 --- lld/lib/Driver/WinLinkDriver.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lld/lib/Driver/WinLinkDriver.cpp b/lld/lib/Driver/WinLinkDriver.cpp index 79c5733..ead06ad 100644 --- a/lld/lib/Driver/WinLinkDriver.cpp +++ b/lld/lib/Driver/WinLinkDriver.cpp @@ -1341,8 +1341,10 @@ bool WinLinkDriver::parse(int argc, const char *argv[], // Add the input files to the linking context. for (std::unique_ptr &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(std::move(file))); } @@ -1355,8 +1357,10 @@ bool WinLinkDriver::parse(int argc, const char *argv[], // Add the library files to the library group. for (std::unique_ptr &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(std::move(file))); } } -- 2.7.4