summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Parallel.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2018-05-11 15:25:38 +0000
committerNico Weber <nicolasweber@gmx.de>2018-05-11 15:25:38 +0000
commit0f2a48c1ae6d982c7245efd4ceb0673ae1387b90 (patch)
tree81bf125ba37a3d600fb2b31a0699ebfd79b19500 /llvm/lib/Support/Parallel.cpp
parentd4169ad7c1493ec94df03d6ecc316b2ea22a0b3e (diff)
downloadbcm5719-llvm-0f2a48c1ae6d982c7245efd4ceb0673ae1387b90.tar.gz
bcm5719-llvm-0f2a48c1ae6d982c7245efd4ceb0673ae1387b90.zip
Remove unused SyncExecutor and make it clearer that the whole file is only used if LLVM_ENABLE_THREADS
llvm-svn: 332098
Diffstat (limited to 'llvm/lib/Support/Parallel.cpp')
-rw-r--r--llvm/lib/Support/Parallel.cpp19
1 files changed, 5 insertions, 14 deletions
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 <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(std::function<void()> F) {
L.dec();
});
}
-#endif
+#endif // LLVM_ENABLE_THREADS
OpenPOWER on IntegriCloud