[llvm] r372336 - Make appendCallNB lambda mutable

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 19 08:45:12 PDT 2019


Author: cbieneman
Date: Thu Sep 19 08:45:12 2019
New Revision: 372336

URL: http://llvm.org/viewvc/llvm-project?rev=372336&view=rev
Log:
Make appendCallNB lambda mutable

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.

Modified:
    llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCUtils.h

Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCUtils.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCUtils.h?rev=372336&r1=372335&r2=372336&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCUtils.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCUtils.h Thu Sep 19 08:45:12 2019
@@ -1417,7 +1417,7 @@ public:
     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();
             },




More information about the llvm-commits mailing list