<div dir="ltr">Hi Arthur,<div><br></div><div>I'm working on a fix now. It should be in shortly.</div><div><br></div><div>Regards,</div><div>Lang.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 13, 2020 at 11:19 AM Arthur Eubanks <<a href="mailto:aeubanks@google.com">aeubanks@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">This breaks Windows builds with:<div><br></div><div>[983/2358] Building CXX object lib\ExecutionEngine\JITLink\CMakeFiles\LLVMJITLink.dir\JITLinkMemoryManager.cpp.obj<br>FAILED: lib/ExecutionEngine/JITLink/CMakeFiles/LLVMJITLink.dir/JITLinkMemoryManager.cpp.obj<br>C:\src\chromium\src\third_party\llvm-build\Release+Asserts\bin\clang-cl.exe  /nologo -TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib\ExecutionEngine\JITLink -IC:\src\llvm-project\llvm\lib\ExecutionEngine\JITLink -Iinclude -IC:\src\llvm-project\llvm\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /Brepro /W4  -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wstring-conversion /MDd /Zi /Ob0 /Od /RTC1    /EHs-c- /GR- -std:c++14 /showIncludes /Folib\ExecutionEngine\JITLink\CMakeFiles\LLVMJITLink.dir\JITLinkMemoryManager.cpp.obj /Fdlib\ExecutionEngine\JITLink\CMakeFiles\LLVMJITLink.dir\LLVMJITLink.pdb -c C:\src\llvm-project\llvm\lib\ExecutionEngine\JITLink\JITLinkMemoryManager.cpp<br>In file included from C:\src\llvm-project\llvm\lib\ExecutionEngine\JITLink\JITLinkMemoryManager.cpp:10:<br>In file included from C:\src\llvm-project\llvm\include\llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h:22:<br>C:/PROGRA~2/MICROS~1/2017/PROFES~1/VC/Tools/MSVC/14.16.27023/include\future(217,2): error: field of type 'llvm::Error' has protected default constructor<br>        _Associated_state(_Mydel *_Dp = nullptr)<br>        ^<br>C:/PROGRA~2/MICROS~1/2017/PROFES~1/VC/Tools/MSVC/14.16.27023/include\future(1399,20): note: in instantiation of member function 'std::_Associated_state<llvm::Error>::_Associated_state' requested here<br>                : _MyPromise(new _Associated_state<_Ty>)<br>                                 ^<br>C:\src\llvm-project\llvm\include\llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h(81,27): note: in instantiation of member function 'std::promise<llvm::Error>::promise' requested here<br>      std::promise<Error> FinalizeResultP;<br>                          ^<br>C:\src\llvm-project\llvm\include\llvm/Support/Error.h(176,3): note: declared protected here<br>  Error() {<br>  ^<br>1 error generated.<br></div><div><br></div><div><br></div><div>And reverting fixes the issue.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 13, 2020 at 10:15 AM Lang Hames via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
Author: Lang Hames<br>
Date: 2020-07-13T10:15:10-07:00<br>
New Revision: a1fc26030a42e9639e678344a4c08014a8cbba3d<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/a1fc26030a42e9639e678344a4c08014a8cbba3d" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/a1fc26030a42e9639e678344a4c08014a8cbba3d</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/a1fc26030a42e9639e678344a4c08014a8cbba3d.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/a1fc26030a42e9639e678344a4c08014a8cbba3d.diff</a><br>
<br>
LOG: [JITLink] Add a synchronous version of finalize for convenience.<br>
<br>
This will be used by upcoming patches that implement indirection utils<br>
(reentry, reentry trampolines, and stubs) on top of<br>
JITLinkMemoryManager to unify in-process and cross-process lazy<br>
compilation support.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h<br>
index ac5a593bb77b..3bb56f4d9615 100644<br>
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h<br>
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h<br>
@@ -17,7 +17,9 @@<br>
 #include "llvm/ExecutionEngine/JITSymbol.h"<br>
 #include "llvm/Support/Error.h"<br>
 #include "llvm/Support/Memory.h"<br>
+<br>
 #include <cstdint><br>
+#include <future><br>
<br>
 namespace llvm {<br>
 namespace jitlink {<br>
@@ -74,6 +76,15 @@ class JITLinkMemoryManager {<br>
     /// working memory.<br>
     virtual void finalizeAsync(FinalizeContinuation OnFinalize) = 0;<br>
<br>
+    /// Calls finalizeAsync and waits for completion.<br>
+    Error finalize() {<br>
+      std::promise<Error> FinalizeResultP;<br>
+      auto FinalizeResultF = FinalizeResultP.get_future();<br>
+      finalizeAsync(<br>
+          [&](Error Err) { FinalizeResultP.set_value(std::move(Err)); });<br>
+      return FinalizeResultF.get();<br>
+    }<br>
+<br>
     /// Should deallocate target memory.<br>
     virtual Error deallocate() = 0;<br>
   };<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div>