[llvm] a1fc260 - [JITLink] Add a synchronous version of finalize for convenience.

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 11:18:51 PDT 2020


This breaks Windows builds with:

[983/2358] Building CXX object
lib\ExecutionEngine\JITLink\CMakeFiles\LLVMJITLink.dir\JITLinkMemoryManager.cpp.obj
FAILED:
lib/ExecutionEngine/JITLink/CMakeFiles/LLVMJITLink.dir/JITLinkMemoryManager.cpp.obj
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
In file included from
C:\src\llvm-project\llvm\lib\ExecutionEngine\JITLink\JITLinkMemoryManager.cpp:10:
In file included from
C:\src\llvm-project\llvm\include\llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h:22:
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
        _Associated_state(_Mydel *_Dp = nullptr)
        ^
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
                : _MyPromise(new _Associated_state<_Ty>)
                                 ^
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
      std::promise<Error> FinalizeResultP;
                          ^
C:\src\llvm-project\llvm\include\llvm/Support/Error.h(176,3): note:
declared protected here
  Error() {
  ^
1 error generated.


And reverting fixes the issue.

On Mon, Jul 13, 2020 at 10:15 AM Lang Hames via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Lang Hames
> Date: 2020-07-13T10:15:10-07:00
> New Revision: a1fc26030a42e9639e678344a4c08014a8cbba3d
>
> URL:
> https://github.com/llvm/llvm-project/commit/a1fc26030a42e9639e678344a4c08014a8cbba3d
> DIFF:
> https://github.com/llvm/llvm-project/commit/a1fc26030a42e9639e678344a4c08014a8cbba3d.diff
>
> LOG: [JITLink] Add a synchronous version of finalize for convenience.
>
> This will be used by upcoming patches that implement indirection utils
> (reentry, reentry trampolines, and stubs) on top of
> JITLinkMemoryManager to unify in-process and cross-process lazy
> compilation support.
>
> Added:
>
>
> Modified:
>     llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git
> a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
> b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
> index ac5a593bb77b..3bb56f4d9615 100644
> --- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
> +++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
> @@ -17,7 +17,9 @@
>  #include "llvm/ExecutionEngine/JITSymbol.h"
>  #include "llvm/Support/Error.h"
>  #include "llvm/Support/Memory.h"
> +
>  #include <cstdint>
> +#include <future>
>
>  namespace llvm {
>  namespace jitlink {
> @@ -74,6 +76,15 @@ class JITLinkMemoryManager {
>      /// working memory.
>      virtual void finalizeAsync(FinalizeContinuation OnFinalize) = 0;
>
> +    /// Calls finalizeAsync and waits for completion.
> +    Error finalize() {
> +      std::promise<Error> FinalizeResultP;
> +      auto FinalizeResultF = FinalizeResultP.get_future();
> +      finalizeAsync(
> +          [&](Error Err) { FinalizeResultP.set_value(std::move(Err)); });
> +      return FinalizeResultF.get();
> +    }
> +
>      /// Should deallocate target memory.
>      virtual Error deallocate() = 0;
>    };
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200713/d77a1b12/attachment.html>


More information about the llvm-commits mailing list