[lld] r317633 - Delete dead code.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 15:12:41 PST 2017


Author: rafael
Date: Tue Nov  7 15:12:41 2017
New Revision: 317633

URL: http://llvm.org/viewvc/llvm-project?rev=317633&view=rev
Log:
Delete dead code.

Modified:
    lld/trunk/Common/ErrorHandler.cpp
    lld/trunk/Common/Threads.cpp
    lld/trunk/ELF/Driver.cpp
    lld/trunk/include/lld/Common/Threads.h

Modified: lld/trunk/Common/ErrorHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/Common/ErrorHandler.cpp?rev=317633&r1=317632&r2=317633&view=diff
==============================================================================
--- lld/trunk/Common/ErrorHandler.cpp (original)
+++ lld/trunk/Common/ErrorHandler.cpp Tue Nov  7 15:12:41 2017
@@ -46,7 +46,6 @@ ErrorHandler &lld::errorHandler() {
 }
 
 void lld::exitLld(int Val) {
-  waitForBackgroundThreads();
   // Dealloc/destroy ManagedStatic variables before calling
   // _exit(). In a non-LTO build, this is a nop. In an LTO
   // build allows us to get the output of -time-passes.

Modified: lld/trunk/Common/Threads.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/Common/Threads.cpp?rev=317633&r1=317632&r2=317633&view=diff
==============================================================================
--- lld/trunk/Common/Threads.cpp (original)
+++ lld/trunk/Common/Threads.cpp Tue Nov  7 15:12:41 2017
@@ -8,25 +8,5 @@
 //===----------------------------------------------------------------------===//
 
 #include "lld/Common/Threads.h"
-#include <thread>
-#include <vector>
-
-static std::vector<std::thread> Threads;
 
 bool lld::ThreadsEnabled = true;
-
-// Runs a given function in a new thread.
-void lld::runBackground(std::function<void()> Fn) {
-  Threads.emplace_back(Fn);
-}
-
-// Wait for all threads spawned for runBackground() to finish.
-//
-// You need to call this function from the main thread before exiting
-// because it is not defined what will happen to non-main threads when
-// the main thread exits.
-void lld::waitForBackgroundThreads() {
-  for (std::thread &T : Threads)
-    if (T.joinable())
-      T.join();
-}

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=317633&r1=317632&r2=317633&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Tue Nov  7 15:12:41 2017
@@ -93,7 +93,6 @@ bool elf::link(ArrayRef<const char *> Ar
   Config->Argv = {Args.begin(), Args.end()};
 
   Driver->main(Args, CanExitEarly);
-  waitForBackgroundThreads();
 
   // Exit immediately if we don't need to return to the caller.
   // This saves time because the overhead of calling destructors

Modified: lld/trunk/include/lld/Common/Threads.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Common/Threads.h?rev=317633&r1=317632&r2=317633&view=diff
==============================================================================
--- lld/trunk/include/lld/Common/Threads.h (original)
+++ lld/trunk/include/lld/Common/Threads.h Tue Nov  7 15:12:41 2017
@@ -81,9 +81,6 @@ inline void parallelForEachN(size_t Begi
     for_each_n(llvm::parallel::seq, Begin, End, Fn);
 }
 
-void runBackground(std::function<void()> Fn);
-void waitForBackgroundThreads();
-
 } // namespace lld
 
 #endif




More information about the llvm-commits mailing list