-
Notifications
You must be signed in to change notification settings - Fork 35
Out-Of-Process Interpreter for CppInterOp #717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 16. Check the log or trigger a new build to see more.
struct FileDeleter { | ||
void operator()(FILE* f /* owns */) { | ||
if (f) | ||
fclose(f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: calling legacy resource function without passing a 'gsl::owner<>' [cppcoreguidelines-owning-memory]
fclose(f);
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
if (llvm::sys::RunningOnValgrind()) | ||
GTEST_SKIP() << "XFAIL due to Valgrind report"; | ||
TestUtils::CreateInterpreter(); | ||
pid_t pid = Cpp::GetExecutorPID(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "pid_t" is directly included [misc-include-cleaner]
unittests/CppInterOp/FunctionReflectionTest.cpp:15:
- #include <string>
+ #include <sched.h>
+ #include <string>
} | ||
} | ||
|
||
TInterp_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "TInterp_t" is directly included [misc-include-cleaner]
unittests/CppInterOp/Utils.cpp:13:
- #include <string>
+ #include <clang-c/CXCppInterOp.h>
+ #include <string>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
c56d565
to
7217df9
Compare
Before pushing commits to this PR please either ping me, or delete caches as they are made. This PR has caused a large number of llvm cached builds to be deleted on main, which in turn has required multiple PRs workflow runs to be stopped while the cache is rebuilt. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
} | ||
|
||
#ifndef _WIN32 | ||
pid_t getOutOfProcessExecutorPID() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'getOutOfProcessExecutorPID' should be marked [[nodiscard]] [modernize-use-nodiscard]
pid_t getOutOfProcessExecutorPID() const { | |
[[nodiscard]] pid_t getOutOfProcessExecutorPID() const { |
} | ||
|
||
#ifndef _WIN32 | ||
pid_t getOutOfProcessExecutorPID() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'getOutOfProcessExecutorPID' can be made static [readability-convert-member-functions-to-static]
pid_t getOutOfProcessExecutorPID() const { | |
static pid_t getOutOfProcessExecutorPID() { |
} | ||
|
||
#ifndef _WIN32 | ||
pid_t getOutOfProcessExecutorPID() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "pid_t" is directly included [misc-include-cleaner]
lib/CppInterOp/CppInterOpInterpreter.h:25:
- #if CLANG_VERSION_MAJOR >= 19
+ #include <sched.h>
+ #if CLANG_VERSION_MAJOR >= 19
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #717 +/- ##
==========================================
- Coverage 79.83% 79.83% -0.01%
==========================================
Files 9 9
Lines 3963 4057 +94
==========================================
+ Hits 3164 3239 +75
- Misses 799 818 +19
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look at the comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
} | ||
} | ||
|
||
TInterp_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "TInterp_t" is directly included [misc-include-cleaner]
unittests/CppInterOp/Utils.cpp:15:
- #include <string>
+ #include <clang-c/CXCppInterOp.h>
+ #include <string>
The tests are not covering over 1/4 of this patch. @kr-2003 can you improve the coverage? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
lib/CppInterOp/Compatibility.h
Outdated
std::string(LLVM_BUILD_LIB_DIR) + "/bin/llvm-jitlink-executor"; | ||
OutOfProcessConfig.UseSharedMemory = false; | ||
OutOfProcessConfig.SlabAllocateSize = 0; | ||
// LCOV_EXCL_START |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LCOV_EXCL_START and LCOV_EXCL_STOP are things I think we should not be using. If something is not being covered, we need to know. Then we can make an informed decision if its not something expected to be covered. Excluding sections from the report is a bad idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't test out this lambda. this block is run in the child process of oop interpreter. that's why ignored it during the coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not comfortable with LCOV_EXCL_START
. We will end up ignoring it forever. But maybe tomorrow, there is a way to test it.
cc @vgvassilev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am removing the comments. I realised that it's not good practice to ignore the coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
lib/CppInterOp/CppInterOp.cpp
Outdated
// Use interpreter-managed redirection file for out-of-process stdout | ||
FILE* redirected = I.getRedirectionFileForOutOfProcess(FD); | ||
if (redirected) { | ||
m_TempFile.release(); // release ownership of current tmpfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the value returned by this function should not be disregarded; neglecting it may lead to errors [bugprone-unused-return-value]
m_TempFile.release(); // release ownership of current tmpfile
^
lib/CppInterOp/CppInterOp.cpp
Outdated
m_OwnsFile = false; | ||
} | ||
} else { | ||
m_TempFile.reset(tmpfile()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: initializing non-owner argument of type 'pointer' (aka '_IO_FILE *') with a newly created 'gsl::owner<>' [cppcoreguidelines-owning-memory]
m_TempFile.reset(tmpfile());
^
lib/CppInterOp/Compatibility.h
Outdated
std::string(LLVM_BUILD_LIB_DIR) + "/bin/llvm-jitlink-executor"; | ||
OutOfProcessConfig.UseSharedMemory = false; | ||
OutOfProcessConfig.SlabAllocateSize = 0; | ||
// LCOV_EXCL_START |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not comfortable with LCOV_EXCL_START
. We will end up ignoring it forever. But maybe tomorrow, there is a way to test it.
cc @vgvassilev
lib/CppInterOp/Compatibility.h
Outdated
OutOfProcessConfig.OOPExecutor = | ||
std::string(LLVM_SOURCE_DIR) + "/build/bin/llvm-jitlink-executor"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example:
#define Stringify(s) Stringifyx(s)
#define Stringifyx(...) #__VA_ARGS__
#define VERSION "1.0.2"
#define VERSION_NUM 1
#define LLVM_PATH "asasa/"
std::string final_str = "/asasa/" Stringify(VERSION_NUM) "/" LLVM_PATH;
lib/CppInterOp/CppInterOp.cpp
Outdated
StreamCaptureInfo(int FD) : m_FD(FD) { | ||
#if !defined(CPPINTEROP_USE_CLING) && !defined(_WIN32) | ||
auto& I = getInterp(NULLPTR); | ||
if (I.isOutOfProcess() && FD == STDOUT_FILENO) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand why we don't do this for stderr
?
unittests/CppInterOp/main.cpp
Outdated
|
||
int main(int argc, char** argv) { | ||
::testing::InitGoogleTest(&argc, argv); | ||
parseCustomArguments(argc, argv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need custom arguments as we discussed -- this should be a property of the test fixture and TestUtils::CreateInterpreter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, ran tests two times here in the main only. First one in-process and other one as out-of-process(conditional check with LLVM_BUILT_WITH_JIT_OOP compiled time var).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Therefore no need of passing use-oop-jit
flag in test binary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
#include <unistd.h> | ||
#endif | ||
#include <unordered_map> | ||
#include <utility> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: included header unordered_map is not used directly [misc-include-cleaner]
#include <utility> | |
#include <utility> |
lib/CppInterOp/Compatibility.h
Outdated
OutOfProcessConfig.CustomizeFork = [&stdin_fd, &stdout_fd, | ||
&stderr_fd]() { // Lambda defined inline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OutOfProcessConfig.CustomizeFork = [&stdin_fd, &stdout_fd, | |
&stderr_fd]() { // Lambda defined inline | |
OutOfProcessConfig.CustomizeFork = [stdin_fd, stdout_fd, | |
stderr_fd]() { // Lambda defined inline |
Should be captured by value here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
unittests/CppInterOp/JitTest.cpp
Outdated
Interp->process(R"( | ||
#include <stdio.h> | ||
printf("%s\n", "Hello World"); | ||
fflush(stdout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to remove this fflush
from the user code? And we do this ourselves in the StreamCaptureInfo
class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments. I guess everything else is fine. Please also look at the github-actions's comments.
lib/CppInterOp/CppInterOp.cpp
Outdated
#ifdef LLVM_BUILT_WITH_OOP_JIT | ||
auto& I = getInterp(); | ||
return I.getOutOfProcessExecutorPID(); | ||
#endif | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to
if (running_in_oop)
return I.getOutOfProcessExecutorPID();
return getpid();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
static std::tuple<int, int, int, bool> | ||
getFileDescriptorsForOutOfProcess(std::vector<const char*>& vargs, | ||
std::unique_ptr<IOContext>& io_ctx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static std::tuple<int, int, int, bool> | |
getFileDescriptorsForOutOfProcess(std::vector<const char*>& vargs, | |
std::unique_ptr<IOContext>& io_ctx) { | |
static std::tuple<int, int, int> | |
initAndGetFile(std::vector<const char*>& vargs, | |
std::unique_ptr<IOContext>& io_ctx) { |
return -1, -1, -1
if temp file creation fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of returning -1's, I have return 0, 1, 2 because i am falling back to in-process if out-of-process fails
Interpreter(std::unique_ptr<clang::Interpreter> CI, | ||
std::unique_ptr<IOContext> ctx = nullptr) | ||
: inner(std::move(CI)), io_context(std::move(ctx)), outOfProcess(false) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interpreter(std::unique_ptr<clang::Interpreter> CI, | |
std::unique_ptr<IOContext> ctx = nullptr) | |
: inner(std::move(CI)), io_context(std::move(ctx)), outOfProcess(false) {} | |
Interpreter(std::unique_ptr<clang::Interpreter> CI, | |
std::unique_ptr<IOContext> ctx = nullptr, bool oop = false) | |
: inner(std::move(CI)), io_context(std::move(ctx)), outOfProcess(false) {} |
and remove the other constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if (TestUtils::use_oop_jit()) { | ||
GTEST_SKIP() << "Test fails for OOP JIT builds"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (TestUtils::use_oop_jit()) { | |
GTEST_SKIP() << "Test fails for OOP JIT builds"; | |
} | |
if (TestUtils::use_oop_jit()) | |
GTEST_SKIP() << "Test fails for OOP JIT builds"; |
apply everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
unittests/CppInterOp/Utils.cpp
Outdated
bool& TestUtils::use_oop_jit() { | ||
static bool flag = false; | ||
return flag; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should not return a reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, declared an extern variable called use_oop_jit
in TestUtils namespace and used it everywhere.
unittests/CppInterOp/CUDATest.cpp
Outdated
return false; | ||
#endif | ||
if (!Cpp::CreateInterpreter({}, {"--cuda"})) | ||
if (!TestUtils::CreateInterpreter({}, {"--cuda"})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets not use OOP-JIT for CUDA now.
if (!TestUtils::CreateInterpreter({}, {"--cuda"})) | |
if (!Cpp::CreateInterpreter({}, {"--cuda"})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
size_t newLen = | ||
fread(content.get(), sizeof(char), bufsize, m_TempFile.get()); | ||
if (ferror(m_TempFile.get()) != 0) | ||
size_t newLen = fread(content.get(), sizeof(char), bufsize, m_TempFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: The 1st argument to 'fread' is a buffer with size 0 but should be a buffer with size equal to or greater than the value of the 2nd argument (which is 1) times the 3rd argument (which is 18446744073709551615) [clang-analyzer-unix.StdCLibraryFunctions]
size_t newLen = fread(content.get(), sizeof(char), bufsize, m_TempFile);
^
Additional context
lib/CppInterOp/CppInterOp.cpp:4104: Calling 'StreamCaptureInfo::GetCapturedString'
std::string result = SCI.GetCapturedString();
^
lib/CppInterOp/CppInterOp.cpp:4050: Taking false branch
if (dup2(m_DupFD, m_FD) < 0)
^
lib/CppInterOp/CppInterOp.cpp:4053: Taking false branch
if (fseek(m_TempFile, 0L, SEEK_END) != 0)
^
lib/CppInterOp/CppInterOp.cpp:4057: Assuming that 'ftell' fails
long bufsize = ftell(m_TempFile);
^
lib/CppInterOp/CppInterOp.cpp:4057: 'bufsize' initialized here
long bufsize = ftell(m_TempFile);
^
lib/CppInterOp/CppInterOp.cpp:4058: Taking true branch
if (bufsize == -1)
^
lib/CppInterOp/CppInterOp.cpp:4062: Storing uninitialized value
std::unique_ptr<char[]> content(new char[bufsize + 1]);
^
lib/CppInterOp/CppInterOp.cpp:4062: Passing value via 1st parameter '__p'
std::unique_ptr<char[]> content(new char[bufsize + 1]);
^
lib/CppInterOp/CppInterOp.cpp:4062: Calling constructor for 'unique_ptr<char[], std::default_delete<char[]>>'
std::unique_ptr<char[]> content(new char[bufsize + 1]);
^
/usr/include/c++/13/bits/unique_ptr.h:603: Calling constructor for '__uniq_ptr_data<char, std::default_delete<char[]>, true, true>'
: _M_t(__p)
^
/usr/include/c++/13/bits/unique_ptr.h:603: Passing '' via 1st parameter '__p'
: _M_t(__p)
^
/usr/include/c++/13/bits/unique_ptr.h:603: Calling constructor for '__uniq_ptr_impl<char, std::default_delete<char[]>>'
: _M_t(__p)
^
/usr/include/c++/13/bits/unique_ptr.h:175: Calling '__uniq_ptr_impl::_M_ptr'
__uniq_ptr_impl(pointer __p) : _M_t() { _M_ptr() = __p; }
^
/usr/include/c++/13/bits/unique_ptr.h:196: Calling 'get<0UL, char *, std::default_delete<char[]>>'
pointer& _M_ptr() noexcept { return std::get<0>(_M_t); }
^
/usr/include/c++/13/tuple:1803: Calling '__get_helper<0UL, char *, std::default_delete<char[]>>'
{ return std::__get_helper<__i>(__t); }
^
/usr/include/c++/13/tuple:1787: Calling '_Tuple_impl::_M_head'
{ return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); }
^
/usr/include/c++/13/tuple:268: Calling '_Head_base::_M_head'
_M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); }
^
/usr/include/c++/13/tuple:268: Returning from '_Head_base::_M_head'
_M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); }
^
/usr/include/c++/13/tuple:1787: Returning from '_Tuple_impl::_M_head'
{ return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); }
^
/usr/include/c++/13/tuple:1803: Returning from '__get_helper<0UL, char *, std::default_delete<char[]>>'
{ return std::__get_helper<__i>(__t); }
^
/usr/include/c++/13/bits/unique_ptr.h:196: Returning from 'get<0UL, char *, std::default_delete<char[]>>'
pointer& _M_ptr() noexcept { return std::get<0>(_M_t); }
^
/usr/include/c++/13/bits/unique_ptr.h:175: Returning from '__uniq_ptr_impl::_M_ptr'
__uniq_ptr_impl(pointer __p) : _M_t() { _M_ptr() = __p; }
^
/usr/include/c++/13/bits/unique_ptr.h:175: The value of '__p' is assigned to 'content._M_t._M_t._M_head_impl'
__uniq_ptr_impl(pointer __p) : _M_t() { _M_ptr() = __p; }
^
/usr/include/c++/13/bits/unique_ptr.h:603: Returning from constructor for '__uniq_ptr_impl<char, std::default_delete<char[]>>'
: _M_t(__p)
^
/usr/include/c++/13/bits/unique_ptr.h:603: Returning from constructor for '__uniq_ptr_data<char, std::default_delete<char[]>, true, true>'
: _M_t(__p)
^
lib/CppInterOp/CppInterOp.cpp:4062: Returning from constructor for 'unique_ptr<char[], std::default_delete<char[]>>'
std::unique_ptr<char[]> content(new char[bufsize + 1]);
^
lib/CppInterOp/CppInterOp.cpp:4065: Taking false branch
if (fseek(m_TempFile, 0L, SEEK_SET) != 0)
^
lib/CppInterOp/CppInterOp.cpp:4069: The 1st argument to 'fread' is a buffer with size 0 but should be a buffer with size equal to or greater than the value of the 2nd argument (which is 1) times the 3rd argument (which is 18446744073709551615)
size_t newLen = fread(content.get(), sizeof(char), bufsize, m_TempFile);
^
} | ||
|
||
#ifndef _WIN32 | ||
[[nodiscard]] pid_t getOutOfProcessExecutorPID() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: method 'getOutOfProcessExecutorPID' can be made static [readability-convert-member-functions-to-static]
[[nodiscard]] pid_t getOutOfProcessExecutorPID() const { | |
[[nodiscard]] static pid_t getOutOfProcessExecutorPID() { |
} | ||
|
||
#ifndef _WIN32 | ||
[[nodiscard]] pid_t getOutOfProcessExecutorPID() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "pid_t" is directly included [misc-include-cleaner]
lib/CppInterOp/CppInterOpInterpreter.h:25:
- #if CLANG_VERSION_MAJOR >= 19
+ #include <sched.h>
+ #if CLANG_VERSION_MAJOR >= 19
using namespace llvm; | ||
|
||
namespace TestUtils { | ||
bool use_oop_jit = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'use_oop_jit' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
bool use_oop_jit = false;
^
} | ||
#define Interp (static_cast<compat::Interpreter*>(Cpp::GetInterpreter())) | ||
namespace TestUtils { | ||
extern bool use_oop_jit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'use_oop_jit' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
extern bool use_oop_jit;
^
@@ -1,6 +1,16 @@ | |||
#include "Utils.h" | |||
#include <gtest/gtest.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: included header Utils.h is not used directly [misc-include-cleaner]
#include <gtest/gtest.h> | |
#include <gtest/gtest.h> |
#include "Utils.h" | ||
#include <gtest/gtest.h> | ||
#include <string> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: included header string is not used directly [misc-include-cleaner]
This PR enables Out-Of-Process Interpreter for CppInterOp.
Under the hood, it uses LLVM's
llvm-jitlink-executor
andlib ORC RT
to delegate the JIT execution to different process. The user just needs to pass--use-oop-jit
flag as ClangArgs while constructing the interpreter to use this feature.