diff options
| author | Lang Hames <lhames@gmail.com> | 2018-09-10 22:08:57 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2018-09-10 22:08:57 +0000 |
| commit | 7c4814306d8a1460b28e9042d95697eadf3e8df0 (patch) | |
| tree | 854e565003ee50d11215303996657acc11abe1cc /llvm | |
| parent | 33428d98f7ffb26d98e3af3d28e7215e31bc1b69 (diff) | |
| download | bcm5719-llvm-7c4814306d8a1460b28e9042d95697eadf3e8df0.tar.gz bcm5719-llvm-7c4814306d8a1460b28e9042d95697eadf3e8df0.zip | |
[ORC] Simplify LLJIT::Create by removing the ExecutionSession parameter.
The Create method can just construct the ExecutionSession, rather than having the
client pass it in.
llvm-svn: 341872
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h | 6 | ||||
| -rw-r--r-- | llvm/lib/ExecutionEngine/Orc/LLJIT.cpp | 12 | ||||
| -rw-r--r-- | llvm/tools/lli/lli.cpp | 4 |
3 files changed, 9 insertions, 13 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h index aced03f3035..6e9490bc13f 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h @@ -31,8 +31,7 @@ class LLJIT { 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; } @@ -117,8 +116,7 @@ class LLLazyJIT : public LLJIT { 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. diff --git a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp index b463771c730..464b1e2413a 100644 --- a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp +++ b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp @@ -16,10 +16,9 @@ namespace llvm { 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) { @@ -91,9 +90,10 @@ void LLJIT::recordCtorDtors(Module &M) { } 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); diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 66860847ba5..b88036e2c4f 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -758,9 +758,7 @@ int runOrcLazyJIT(const char *ProgName) { : 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(); |

