[clang-repl] Support destructors of global objects.
authorSunho Kim <ksunhokim123@gmail.com>
Sun, 26 Jun 2022 10:02:19 +0000 (19:02 +0900)
committerSunho Kim <ksunhokim123@gmail.com>
Sun, 26 Jun 2022 10:02:19 +0000 (19:02 +0900)
commit9de8b05bfe0de2915d2443d06159396c5f9d389f
tree97fba64aedd6ac38c737ea4a904c3e88c522535a
parentec1922313101f94ffa0f3fe8c721220b83ebcb32
[clang-repl] Support destructors of global objects.

Supports destructors of global objects by properly calling jitdylib deinitialize which calls the global dtors of ir modules.

This supersedes https://reviews.llvm.org/D127945. There was an issue when calling deinitialize on windows but it got fixed by https://reviews.llvm.org/D128037.

Reviewed By: v.g.vassilev

Differential Revision: https://reviews.llvm.org/D128589
clang/lib/Interpreter/IncrementalExecutor.cpp
clang/lib/Interpreter/IncrementalExecutor.h
clang/lib/Interpreter/Interpreter.cpp
clang/test/Interpreter/execute.cpp
clang/tools/clang-repl/ClangRepl.cpp
clang/unittests/Interpreter/ExceptionTests/InterpreterExceptionTest.cpp