[llvm] r332098 - Remove unused SyncExecutor and make it clearer that the whole file is only used if LLVM_ENABLE_THREADS

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Fri May 11 08:25:39 PDT 2018


Author: nico
Date: Fri May 11 08:25:38 2018
New Revision: 332098

URL: http://llvm.org/viewvc/llvm-project?rev=332098&view=rev
Log:
Remove unused SyncExecutor and make it clearer that the whole file is only used if LLVM_ENABLE_THREADS

Modified:
    llvm/trunk/lib/Support/Parallel.cpp

Modified: llvm/trunk/lib/Support/Parallel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Parallel.cpp?rev=332098&r1=332097&r2=332098&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Parallel.cpp (original)
+++ llvm/trunk/lib/Support/Parallel.cpp Fri May 11 08:25:38 2018
@@ -9,6 +9,9 @@
 
 #include "llvm/Support/Parallel.h"
 #include "llvm/Config/llvm-config.h"
+
+#if LLVM_ENABLE_THREADS
+
 #include "llvm/Support/Threading.h"
 
 #include <atomic>
@@ -28,18 +31,7 @@ public:
   static Executor *getDefaultExecutor();
 };
 
-#if !LLVM_ENABLE_THREADS
-class SyncExecutor : public Executor {
-public:
-  virtual void add(std::function<void()> F) { F(); }
-};
-
-Executor *Executor::getDefaultExecutor() {
-  static SyncExecutor Exec;
-  return &Exec;
-}
-
-#elif defined(_MSC_VER)
+#if defined(_MSC_VER)
 /// An Executor that runs tasks via ConcRT.
 class ConcRTExecutor : public Executor {
   struct Taskish {
@@ -127,7 +119,6 @@ Executor *Executor::getDefaultExecutor()
 #endif
 }
 
-#if LLVM_ENABLE_THREADS
 void parallel::detail::TaskGroup::spawn(std::function<void()> F) {
   L.inc();
   Executor::getDefaultExecutor()->add([&, F] {
@@ -135,4 +126,4 @@ void parallel::detail::TaskGroup::spawn(
     L.dec();
   });
 }
-#endif
+#endif // LLVM_ENABLE_THREADS




More information about the llvm-commits mailing list