Skip to content

Commit

Permalink
[BalancedPartitioning] Fix -Wdeprecated-this-capture
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Dec 7, 2024
1 parent 66f9448 commit 1f9f68a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions llvm/lib/Support/BalancedPartitioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void BalancedPartitioning::BPThreadPool::async(Func &&F) {
#if LLVM_ENABLE_THREADS
// This new thread could spawn more threads, so mark it as active
++NumActiveThreads;
TheThreadPool.async([=]() {
TheThreadPool.async([this, F]() {
// Run the task
F();

Expand Down Expand Up @@ -93,7 +93,7 @@ void BalancedPartitioning::run(std::vector<BPFunctionNode> &Nodes) const {
Nodes[I].InputOrderIndex = I;

auto NodesRange = llvm::make_range(Nodes.begin(), Nodes.end());
auto BisectTask = [=, &TP]() {
auto BisectTask = [this, NodesRange, &TP]() {
bisect(NodesRange, /*RecDepth=*/0, /*RootBucket=*/1, /*Offset=*/0, TP);
};
if (TP) {
Expand Down Expand Up @@ -147,10 +147,11 @@ void BalancedPartitioning::bisect(const FunctionNodeRange Nodes,
auto LeftNodes = llvm::make_range(Nodes.begin(), NodesMid);
auto RightNodes = llvm::make_range(NodesMid, Nodes.end());

auto LeftRecTask = [=, &TP]() {
auto LeftRecTask = [this, LeftNodes, RecDepth, LeftBucket, Offset, &TP]() {
bisect(LeftNodes, RecDepth + 1, LeftBucket, Offset, TP);
};
auto RightRecTask = [=, &TP]() {
auto RightRecTask = [this, RightNodes, RecDepth, RightBucket, MidOffset,
&TP]() {
bisect(RightNodes, RecDepth + 1, RightBucket, MidOffset, TP);
};

Expand Down

0 comments on commit 1f9f68a

Please sign in to comment.