Skip to content

Commit

Permalink
Remove unused member functions from deque_anchor
Browse files Browse the repository at this point in the history
Starting with clang 19, the unused member functions cas that take a deque_anchor fail to compile
because they attempt to call load directly on the deque_anchor type, whereas they should be calling
load on the atomic stored in the deque_anchor. Neither GCC nor clang until version 18 failed to
compile the broken member functions (because they were unused they were never instantiatied). Since
the functions are unused, simply remove them.

Related llvm issue: llvm/llvm-project#102177.
  • Loading branch information
msimberg committed Oct 31, 2024
1 parent 5540f17 commit accda74
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions libs/pika/concurrency/include/pika/concurrency/deque.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,47 +123,6 @@ namespace pika::concurrency::detail {

pair lrs(std::memory_order mo = std::memory_order_acquire) const { return pair_.load(mo); }

node* left(std::memory_order mo = std::memory_order_acquire) const
{
return pair_.load(mo).get_left_ptr();
}

node* right(std::memory_order mo = std::memory_order_acquire) const
{
return pair_.load(mo).get_right_ptr();
}

tag_t status(std::memory_order mo = std::memory_order_acquire) const
{
return pair_.load(mo).get_left_tag();
}

tag_t tag(std::memory_order mo = std::memory_order_acquire) const
{
return pair_.load(mo).get_right_tag();
}

bool cas(deque_anchor& expected, deque_anchor const& desired,
std::memory_order mo = std::memory_order_acq_rel)
{
return pair_.compare_exchange_strong(expected.load(std::memory_order_acquire),
desired.load(std::memory_order_acquire), mo);
}

bool cas(pair& expected, deque_anchor const& desired,
std::memory_order mo = std::memory_order_acq_rel)
{
return pair_.compare_exchange_strong(
expected, desired.load(std::memory_order_acquire), mo);
}

bool cas(deque_anchor& expected, pair const& desired,
std::memory_order mo = std::memory_order_acq_rel)
{
return pair_.compare_exchange_strong(
expected.load(std::memory_order_acquire), desired, mo);
}

bool cas(
pair& expected, pair const& desired, std::memory_order mo = std::memory_order_acq_rel)
{
Expand Down

0 comments on commit accda74

Please sign in to comment.