The Create method can just construct the ExecutionSession, rather than having the
client pass it in.
llvm-svn: 341872
public:
/// Create an LLJIT instance.
static Expected<std::unique_ptr<LLJIT>>
- Create(std::unique_ptr<ExecutionSession> ES,
- std::unique_ptr<TargetMachine> TM, DataLayout DL);
+ Create(std::unique_ptr<TargetMachine> TM, DataLayout DL);
/// Returns a reference to the ExecutionSession for this JIT instance.
ExecutionSession &getExecutionSession() { return *ES; }
public:
/// Create an LLLazyJIT instance.
static Expected<std::unique_ptr<LLLazyJIT>>
- Create(std::unique_ptr<ExecutionSession> ES,
- std::unique_ptr<TargetMachine> TM, DataLayout DL, LLVMContext &Ctx);
+ Create(std::unique_ptr<TargetMachine> TM, DataLayout DL, LLVMContext &Ctx);
/// Set an IR transform (e.g. pass manager pipeline) to run on each function
/// when it is compiled.
namespace orc {
Expected<std::unique_ptr<LLJIT>>
-LLJIT::Create(std::unique_ptr<ExecutionSession> ES,
- std::unique_ptr<TargetMachine> TM, DataLayout DL) {
- return std::unique_ptr<LLJIT>(
- new LLJIT(std::move(ES), std::move(TM), std::move(DL)));
+LLJIT::Create(std::unique_ptr<TargetMachine> TM, DataLayout DL) {
+ return std::unique_ptr<LLJIT>(new LLJIT(llvm::make_unique<ExecutionSession>(),
+ std::move(TM), std::move(DL)));
}
Error LLJIT::defineAbsolute(StringRef Name, JITEvaluatedSymbol Sym) {
}
Expected<std::unique_ptr<LLLazyJIT>>
-LLLazyJIT::Create(std::unique_ptr<ExecutionSession> ES,
- std::unique_ptr<TargetMachine> TM, DataLayout DL,
+LLLazyJIT::Create(std::unique_ptr<TargetMachine> TM, DataLayout DL,
LLVMContext &Ctx) {
+ auto ES = llvm::make_unique<ExecutionSession>();
+
const Triple &TT = TM->getTargetTriple();
auto CCMgr = createLocalCompileCallbackManager(TT, *ES, 0);
: None);
auto TM = ExitOnErr(TMD.createTargetMachine());
auto DL = TM->createDataLayout();
- auto ES = llvm::make_unique<orc::ExecutionSession>();
- auto J =
- ExitOnErr(orc::LLLazyJIT::Create(std::move(ES), std::move(TM), DL, Ctx));
+ auto J = ExitOnErr(orc::LLLazyJIT::Create(std::move(TM), DL, Ctx));
auto Dump = createDebugDumper();