From 1ef8a5f0caf85b699c261c03e1ff14ebaa52b799 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Sat, 29 Jul 2023 15:16:19 +0100 Subject: [PATCH] jit: Remove LLLazyJIT and LLJIT variant. Stick to LLJIT for now --- serene/src/jit/jit.cpp | 4 ++-- serene/src/jit/jit.h | 12 +----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/serene/src/jit/jit.cpp b/serene/src/jit/jit.cpp index e1f3e8d..6006473 100644 --- a/serene/src/jit/jit.cpp +++ b/serene/src/jit/jit.cpp @@ -162,7 +162,7 @@ int JIT::getOptimizatioLevel() const { llvm::Error JIT::createCurrentProcessJD() { - auto &es = WITH_ENGINE(auto &, getExecutionSession()); + auto &es = engine->getExecutionSession(); auto *processJDPtr = es.getJITDylibByName(MAIN_PROCESS_JD_NAME); if (processJDPtr != nullptr) { @@ -178,7 +178,7 @@ llvm::Error JIT::createCurrentProcessJD() { auto generator = llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess( - WITH_ENGINE(const auto &, getDataLayout()).getGlobalPrefix()); + engine->getDataLayout().getGlobalPrefix()); if (!generator) { return generator.takeError(); diff --git a/serene/src/jit/jit.h b/serene/src/jit/jit.h index 4a88ea7..c0358ab 100644 --- a/serene/src/jit/jit.h +++ b/serene/src/jit/jit.h @@ -63,15 +63,6 @@ class LLLazyJIT; #define JIT_LOG(...) \ DEBUG_WITH_TYPE("JIT", llvm::dbgs() << "[JIT]: " << __VA_ARGS__ << "\n"); -/// A simple macro that we need to use to call those member functions that are -/// shared between LLJIT and LLLAZYJIT. This macro supposed to be used -/// only within the JIT class itself. The first argument is the return type -/// of the member function and the second arg is the member function call. -/// The whole point of this macro is to unwrap the variant type and call -/// the shared member function on the unwraped value. -#define WITH_ENGINE(retType, fnCall) \ - std::visit([](auto &e) -> retType { return e->fnCall; }, engine) - namespace orc = llvm::orc; namespace serene::jit { @@ -103,8 +94,7 @@ private: class JIT { std::unique_ptr options; - std::variant, std::unique_ptr> - engine; + std::unique_ptr engine; std::unique_ptr cache; llvm::JITEventListener *gdbListener;