aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Singler <singler@kit.edu>2011-01-24 17:07:35 +0000
committerJohannes Singler <singler@gcc.gnu.org>2011-01-24 17:07:35 +0000
commitfc722a0ea442f0b037a0aecdabc74f182b508d5c (patch)
treee2efd3a9dbc49e1b9103c8a35bf237e498ac15f3
parenta40d79d7af069afb35fb1655a45bf3e04a202e35 (diff)
downloadgcc-fc722a0ea442f0b037a0aecdabc74f182b508d5c.zip
gcc-fc722a0ea442f0b037a0aecdabc74f182b508d5c.tar.gz
gcc-fc722a0ea442f0b037a0aecdabc74f182b508d5c.tar.bz2
re PR libstdc++/47433 (libstdc++ parallel mode calls std::swap explicitely)
2011-01-24 Johannes Singler <singler@kit.edu> PR libstdc++/47433 * include/parallel/losertree.h (_LoserTree<>::__delete_min_insert): Do not qualify swap with std:: for value type, but include a using directive instead. (_LoserTreeUnguarded<>::__delete_min_insert): Likewise. * include/parallel/balanced_quicksort.h (__qsb_divide): Use std::iter_swap instead of std::swap. (__qsb_local_sort_with_helping): Likewise. * include/parallel/partition.h (__parallel_partition): Likewise. (__parallel_nth_element): Likewise. From-SVN: r169171
-rw-r--r--libstdc++-v3/ChangeLog14
-rw-r--r--libstdc++-v3/include/parallel/balanced_quicksort.h8
-rw-r--r--libstdc++-v3/include/parallel/losertree.h11
-rw-r--r--libstdc++-v3/include/parallel/partition.h10
4 files changed, 30 insertions, 13 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index e364bec..361d766 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,19 @@
2011-01-24 Johannes Singler <singler@kit.edu>
+ PR libstdc++/47433
+ * include/parallel/losertree.h
+ (_LoserTree<>::__delete_min_insert):
+ Do not qualify swap with std:: for value type,
+ but include a using directive instead.
+ (_LoserTreeUnguarded<>::__delete_min_insert): Likewise.
+ * include/parallel/balanced_quicksort.h (__qsb_divide):
+ Use std::iter_swap instead of std::swap.
+ (__qsb_local_sort_with_helping): Likewise.
+ * include/parallel/partition.h (__parallel_partition):
+ Likewise. (__parallel_nth_element): Likewise.
+
+2011-01-24 Johannes Singler <singler@kit.edu>
+
PR libstdc++/47437
* include/parallel/multiway_merge.h (_UnguardedIterator):
Remove useless "mutable" from reference declaration.
diff --git a/libstdc++-v3/include/parallel/balanced_quicksort.h b/libstdc++-v3/include/parallel/balanced_quicksort.h
index 0a28136..441e7b4 100644
--- a/libstdc++-v3/include/parallel/balanced_quicksort.h
+++ b/libstdc++-v3/include/parallel/balanced_quicksort.h
@@ -132,7 +132,7 @@ namespace __gnu_parallel
// Swap pivot value to end.
if (__pivot_pos != (__end - 1))
- std::swap(*__pivot_pos, *(__end - 1));
+ std::iter_swap(__pivot_pos, __end - 1);
__pivot_pos = __end - 1;
__gnu_parallel::__binder2nd<_Compare, _ValueType, _ValueType, bool>
@@ -144,7 +144,7 @@ namespace __gnu_parallel
__num_threads);
// Swap back pivot to middle.
- std::swap(*(__begin + __split_pos), *__pivot_pos);
+ std::iter_swap(__begin + __split_pos, __pivot_pos);
__pivot_pos = __begin + __split_pos;
#if _GLIBCXX_ASSERTIONS
@@ -284,7 +284,7 @@ namespace __gnu_parallel
// Swap __pivot_pos value to end.
if (__pivot_pos != (__end - 1))
- std::swap(*__pivot_pos, *(__end - 1));
+ std::iter_swap(__pivot_pos, __end - 1);
__pivot_pos = __end - 1;
__gnu_parallel::__binder2nd
@@ -303,7 +303,7 @@ namespace __gnu_parallel
#endif
// Swap pivot back to middle.
if (__split_pos1 != __pivot_pos)
- std::swap(*__split_pos1, *__pivot_pos);
+ std::iter_swap(__split_pos1, __pivot_pos);
__pivot_pos = __split_pos1;
// In case all elements are equal, __split_pos1 == 0.
diff --git a/libstdc++-v3/include/parallel/losertree.h b/libstdc++-v3/include/parallel/losertree.h
index a1c23e5..ccc930b 100644
--- a/libstdc++-v3/include/parallel/losertree.h
+++ b/libstdc++-v3/include/parallel/losertree.h
@@ -216,6 +216,7 @@ namespace __gnu_parallel
void
__delete_min_insert(_Tp __key, bool __sup)
{
+ using std::swap;
#if _GLIBCXX_ASSERTIONS
// no dummy sequence can ever be at the top!
_GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
@@ -236,7 +237,7 @@ namespace __gnu_parallel
// The other one is smaller.
std::swap(_M_losers[__pos]._M_sup, __sup);
std::swap(_M_losers[__pos]._M_source, __source);
- std::swap(_M_losers[__pos]._M_key, __key);
+ swap(_M_losers[__pos]._M_key, __key);
}
}
@@ -316,6 +317,7 @@ namespace __gnu_parallel
void
__delete_min_insert(_Tp __key, bool __sup)
{
+ using std::swap;
#if _GLIBCXX_ASSERTIONS
// no dummy sequence can ever be at the top!
_GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
@@ -332,7 +334,7 @@ namespace __gnu_parallel
// The other one is smaller.
std::swap(_M_losers[__pos]._M_sup, __sup);
std::swap(_M_losers[__pos]._M_source, __source);
- std::swap(_M_losers[__pos]._M_key, __key);
+ swap(_M_losers[__pos]._M_key, __key);
}
}
@@ -679,6 +681,7 @@ namespace __gnu_parallel
void
__delete_min_insert(_Tp __key, bool)
{
+ using std::swap;
#if _GLIBCXX_ASSERTIONS
// no dummy sequence can ever be at the top!
_GLIBCXX_PARALLEL_ASSERT(_M_losers[0]._M_source != -1);
@@ -695,7 +698,7 @@ namespace __gnu_parallel
{
// The other one is smaller.
std::swap(_M_losers[__pos]._M_source, __source);
- std::swap(_M_losers[__pos]._M_key, __key);
+ swap(_M_losers[__pos]._M_key, __key);
}
}
@@ -786,7 +789,7 @@ namespace __gnu_parallel
{
// The other one is smaller.
std::swap(_M_losers[__pos]._M_source, __source);
- std::swap(_M_losers[__pos]._M_key, __key);
+ swap(_M_losers[__pos]._M_key, __key);
}
}
diff --git a/libstdc++-v3/include/parallel/partition.h b/libstdc++-v3/include/parallel/partition.h
index 27b3871..c651321 100644
--- a/libstdc++-v3/include/parallel/partition.h
+++ b/libstdc++-v3/include/parallel/partition.h
@@ -178,8 +178,8 @@ namespace __gnu_parallel
// Fetch new chunk(__s).
break;
- std::swap(__begin[__thread_left],
- __begin[__thread_right]);
+ std::iter_swap(__begin + __thread_left,
+ __begin + __thread_right);
++__thread_left;
--__thread_right;
}
@@ -301,7 +301,7 @@ namespace __gnu_parallel
if (__final_left == __final_right)
break;
- std::swap(__begin[__final_left], __begin[__final_right]);
+ std::iter_swap(__begin + __final_left, __begin + __final_right);
++__final_left;
--__final_right;
}
@@ -354,7 +354,7 @@ namespace __gnu_parallel
// Swap __pivot_pos value to end.
if (__pivot_pos != (__end - 1))
- std::swap(*__pivot_pos, *(__end - 1));
+ std::iter_swap(__pivot_pos, __end - 1);
__pivot_pos = __end - 1;
// _Compare must have first_value_type, second_value_type,
@@ -376,7 +376,7 @@ namespace __gnu_parallel
// Swap pivot back to middle.
if (__split_pos1 != __pivot_pos)
- std::swap(*__split_pos1, *__pivot_pos);
+ std::iter_swap(__split_pos1, __pivot_pos);
__pivot_pos = __split_pos1;
// In case all elements are equal, __split_pos1 == 0