]> granicus.if.org Git - llvm/commitdiff
Fix build errors with Parallel.
authorZachary Turner <zturner@google.com>
Thu, 11 May 2017 00:09:30 +0000 (00:09 +0000)
committerZachary Turner <zturner@google.com>
Thu, 11 May 2017 00:09:30 +0000 (00:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302749 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Parallel.h
lib/Support/Parallel.cpp

index aca972eb490cebe69304a36b9e334d6283619478..12cabcbea5745da784e90cbcbabcb5f029012779 100644 (file)
@@ -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 <class RandomAccessIterator, class Comparator>
 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 <class RandomAccessIterator, class Comparator>
 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] {
index 04fb1c95533cef8bb75b1217aa9efaec2535d81c..15da66cbe8087d04720adadf79421182f9dcec82 100644 (file)
@@ -117,7 +117,7 @@ private:
   std::stack<std::function<void()>> WorkStack;
   std::mutex Mutex;
   std::condition_variable Cond;
-  Latch Done;
+  detail::Latch Done;
 };
 
 Executor *Executor::getDefaultExecutor() {