Commit d1799e3b authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[cleanup] Remove unneeded functor

Because of a GCC bug we needed to use a functor instead of a constexpr
function. Since we do not support gcc before version 5 any more, this
can be cleaned up now.

R=jkummerow@chromium.org

Bug: v8:9396
Change-Id: I848c5a25e1d5fa44a1497b06826f9a59b93ed695
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1835543Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64127}
parent b31bf8aa
......@@ -25,20 +25,18 @@ constexpr int NumRegs(RegList list) {
return base::bits::CountPopulation(list);
}
namespace detail {
// Combine two RegLists by building the union of the contained registers.
// Implemented as a Functor to pass it to base::fold even on gcc < 5 (see
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52892).
// TODO(clemensb): Remove this once we require gcc >= 5.0.
struct CombineRegListsFunctor {
constexpr RegList operator()(RegList list1, RegList list2) const {
return list1 | list2;
}
};
// TODO(clemensb): Replace by constexpr lambda once we have C++17.
constexpr RegList CombineRegListsHelper(RegList list1, RegList list2) {
return list1 | list2;
}
} // namespace detail
// Combine several RegLists by building the union of the contained registers.
template <typename... RegLists>
constexpr RegList CombineRegLists(RegLists... lists) {
return base::fold(CombineRegListsFunctor{}, 0, lists...);
return base::fold(detail::CombineRegListsHelper, 0, lists...);
}
} // namespace internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment