From 331a54d670722f5ee6b64a25d1547df3679d6c51 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Sun, 23 Jul 2023 17:56:49 -0700 Subject: [llvm-jitlink] Don't return immediately in -noexec mode, just skip execution. Skipping execution rather than bailing out early means that: 1. Explicit teardown of JIT'd code will happen at the same point (via the call to ExecutionSession::endSession) regardless of whether -noexec is used. 2. The -show-times option will work with -noexec. --- llvm/tools/llvm-jitlink/llvm-jitlink.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'llvm/tools/llvm-jitlink/llvm-jitlink.cpp') diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp index 3b8def4..00dd520 100644 --- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp +++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp @@ -2038,11 +2038,8 @@ int main(int argc, char *argv[]) { ExitOnErr(runChecks(*S)); - if (NoExec) - return 0; - int Result = 0; - { + if (!NoExec) { LLVM_DEBUG(dbgs() << "Running \"" << EntryPointName << "\"...\n"); TimeRegion TR(Timers ? &Timers->RunTimer : nullptr); if (!OrcRuntime.empty()) -- cgit v1.1