jit: Remove LLLazyJIT and LLJIT variant. Stick to LLJIT for now

This commit is contained in:
Sameer Rahmani 2023-07-29 15:16:19 +01:00
parent 6ec0a26a51
commit 1ef8a5f0ca
Signed by: lxsameer
GPG Key ID: B0A4AF28AB9FD90B
2 changed files with 3 additions and 13 deletions

View File

@ -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();

View File

@ -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<const Options> options;
std::variant<std::unique_ptr<orc::LLJIT>, std::unique_ptr<orc::LLLazyJIT>>
engine;
std::unique_ptr<orc::LLJIT> engine;
std::unique_ptr<ObjectCache> cache;
llvm::JITEventListener *gdbListener;