From 0f2a48c1ae6d982c7245efd4ceb0673ae1387b90 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 11 May 2018 15:25:38 +0000 Subject: Remove unused SyncExecutor and make it clearer that the whole file is only used if LLVM_ENABLE_THREADS llvm-svn: 332098 --- llvm/lib/Support/Parallel.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'llvm/lib/Support/Parallel.cpp') diff --git a/llvm/lib/Support/Parallel.cpp b/llvm/lib/Support/Parallel.cpp index 16111e18ae3..1844003b9d3 100644 --- a/llvm/lib/Support/Parallel.cpp +++ b/llvm/lib/Support/Parallel.cpp @@ -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 @@ -28,18 +31,7 @@ public: static Executor *getDefaultExecutor(); }; -#if !LLVM_ENABLE_THREADS -class SyncExecutor : public Executor { -public: - virtual void add(std::function 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 F) { L.inc(); Executor::getDefaultExecutor()->add([&, F] { @@ -135,4 +126,4 @@ void parallel::detail::TaskGroup::spawn(std::function F) { L.dec(); }); } -#endif +#endif // LLVM_ENABLE_THREADS -- cgit v1.2.3