[PATCH] D68555: Make appendCallNB lambda mutable

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 6 12:24:41 PDT 2019


beanz created this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
beanz abandoned this revision.
beanz added a comment.

Accidentally uploaded this


Lambdas are by deafult const so that they produce the same output every time they are run. This lambda needs to set the value on a captured promise which is a mutating operation, so it must be mutable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68555

Files:
  llvm/include/llvm/ExecutionEngine/Orc/RPCUtils.h


Index: llvm/include/llvm/ExecutionEngine/Orc/RPCUtils.h
===================================================================
--- llvm/include/llvm/ExecutionEngine/Orc/RPCUtils.h
+++ llvm/include/llvm/ExecutionEngine/Orc/RPCUtils.h
@@ -1417,7 +1417,7 @@
     auto FutureResult = Promise.get_future();
 
     if (auto Err = this->template appendCallAsync<Func>(
-            [Promise = std::move(Promise)](ErrorReturn RetOrErr) {
+            [Promise = std::move(Promise)](ErrorReturn RetOrErr) mutable {
               Promise.set_value(std::move(RetOrErr));
               return Error::success();
             },


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68555.223438.patch
Type: text/x-patch
Size: 614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191006/e8ae3377/attachment.bin>


More information about the llvm-commits mailing list