@@ -31,7 +31,7 @@ void BalancedPartitioning::BPThreadPool::async(Func &&F) {
3131#if LLVM_ENABLE_THREADS
3232 // This new thread could spawn more threads, so mark it as active
3333 ++NumActiveThreads;
34- TheThreadPool.async ([= ]() {
34+ TheThreadPool.async ([this , F ]() {
3535 // Run the task
3636 F ();
3737
@@ -93,7 +93,7 @@ void BalancedPartitioning::run(std::vector<BPFunctionNode> &Nodes) const {
9393 Nodes[I].InputOrderIndex = I;
9494
9595 auto NodesRange = llvm::make_range (Nodes.begin (), Nodes.end ());
96- auto BisectTask = [= , &TP]() {
96+ auto BisectTask = [this , NodesRange , &TP]() {
9797 bisect (NodesRange, /* RecDepth=*/ 0 , /* RootBucket=*/ 1 , /* Offset=*/ 0 , TP);
9898 };
9999 if (TP) {
@@ -147,10 +147,11 @@ void BalancedPartitioning::bisect(const FunctionNodeRange Nodes,
147147 auto LeftNodes = llvm::make_range (Nodes.begin (), NodesMid);
148148 auto RightNodes = llvm::make_range (NodesMid, Nodes.end ());
149149
150- auto LeftRecTask = [= , &TP]() {
150+ auto LeftRecTask = [this , LeftNodes, RecDepth, LeftBucket, Offset , &TP]() {
151151 bisect (LeftNodes, RecDepth + 1 , LeftBucket, Offset, TP);
152152 };
153- auto RightRecTask = [=, &TP]() {
153+ auto RightRecTask = [this , RightNodes, RecDepth, RightBucket, MidOffset,
154+ &TP]() {
154155 bisect (RightNodes, RecDepth + 1 , RightBucket, MidOffset, TP);
155156 };
156157
0 commit comments