diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h --- a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h @@ -54,6 +54,12 @@ IRTransformLayer::TransformFunction T); }; + enum JITKind { JK_LLJIT = 0, JK_LLLAZYJIT }; + + virtual JITKind getKind() const { return JK_LLJIT; } + + static bool classof(const LLJIT *JIT) { return JIT->getKind() == JK_LLJIT; } + /// Destruct this instance. If a multi-threaded instance, waits for all /// compile threads to complete. virtual ~LLJIT(); @@ -239,8 +245,13 @@ return addLazyIRModule(*Main, std::move(M)); } -private: + JITKind getKind() const override { return JK_LLLAZYJIT; } + static bool classof(const LLJIT *JIT) { + return JIT->getKind() == JK_LLLAZYJIT; + } + +private: // Create a single-threaded LLLazyJIT instance. LLLazyJIT(LLLazyJITBuilderState &S, Error &Err);