From 930d477d5d8f6c9f09daabb84ce6b76f38bf438d Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 31 Jan 2023 18:17:09 -0800 Subject: [PATCH] [lli] Don't create an ExecutorProcessControl in non-remote MCJIT config. When lli is run with -jit-kind=mcjit and without remote JITing there is no need to create an ExecutorProcessControl object. This is nice cleanup, but as a bonus should silence the leak reports that we're seeing in https://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/9105/. (Though as a side note I believe those reports are spurious. They are being tracked by rdar://104825696). --- llvm/tools/lli/lli.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index c9b77e2..97c10e3 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -663,10 +663,6 @@ int main(int argc, char **argv, char * const *envp) { #endif } - std::unique_ptr EPC = - RemoteMCJIT ? ExitOnErr(launchRemote()) - : ExitOnErr(orc::SelfExecutorProcessControl::Create()); - if (!RemoteMCJIT) { // If the program doesn't explicitly call exit, we will need the Exit // function later on to make an explicit call, so get the function now. @@ -712,6 +708,7 @@ int main(int argc, char **argv, char * const *envp) { abort(); } else { // else == "if (RemoteMCJIT)" + std::unique_ptr EPC = ExitOnErr(launchRemote()); // Remote target MCJIT doesn't (yet) support static constructors. No reason // it couldn't. This is a limitation of the LLI implementation, not the -- 2.7.4