From: Zachary Turner Date: Thu, 11 May 2017 00:09:30 +0000 (+0000) Subject: Fix build errors with Parallel. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c964ef14c94cc0c67841b8bd8ee59ba184cc9c6;p=llvm Fix build errors with Parallel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302749 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/Parallel.h b/include/llvm/Support/Parallel.h index aca972eb490..12cabcbea57 100644 --- a/include/llvm/Support/Parallel.h +++ b/include/llvm/Support/Parallel.h @@ -36,7 +36,7 @@ class Latch { mutable std::condition_variable Cond; public: - explicit Latch(uint32_t count = 0) : Count(Count) {} + explicit Latch(uint32_t Count = 0) : Count(Count) {} ~Latch() { sync(); } void inc() { @@ -117,7 +117,8 @@ RandomAccessIterator medianOf3(RandomAccessIterator Start, template void parallel_quick_sort(RandomAccessIterator Start, RandomAccessIterator End, - const Comparator &Comp, TaskGroup &TG, size_t Depth) { + const Comparator &Comp, detail::TaskGroup &TG, + size_t Depth) { // Do a sequential sort for small inputs. if (std::distance(Start, End) < detail::MinParallelSize || Depth == 0) { std::sort(Start, End, Comp); @@ -144,7 +145,7 @@ void parallel_quick_sort(RandomAccessIterator Start, RandomAccessIterator End, template void parallel_sort(RandomAccessIterator Start, RandomAccessIterator End, const Comparator &Comp) { - TaskGroup TG; + detail::TaskGroup TG; parallel_quick_sort(Start, End, Comp, TG, llvm::Log2_64(std::distance(Start, End)) + 1); } @@ -159,7 +160,7 @@ void parallel_for_each(IterTy Begin, IterTy End, FuncTy Fn) { if (TaskSize == 0) TaskSize = 1; - TaskGroup TG; + detail::TaskGroup TG; while (TaskSize <= std::distance(Begin, End)) { TG.spawn([=, &Fn] { std::for_each(Begin, Begin + TaskSize, Fn); }); Begin += TaskSize; @@ -173,7 +174,7 @@ void parallel_for_each_n(IndexTy Begin, IndexTy End, FuncTy Fn) { if (TaskSize == 0) TaskSize = 1; - TaskGroup TG; + detail::TaskGroup TG; IndexTy I = Begin; for (; I + TaskSize < End; I += TaskSize) { TG.spawn([=, &Fn] { diff --git a/lib/Support/Parallel.cpp b/lib/Support/Parallel.cpp index 04fb1c95533..15da66cbe80 100644 --- a/lib/Support/Parallel.cpp +++ b/lib/Support/Parallel.cpp @@ -117,7 +117,7 @@ private: std::stack> WorkStack; std::mutex Mutex; std::condition_variable Cond; - Latch Done; + detail::Latch Done; }; Executor *Executor::getDefaultExecutor() {