[llvm] r343060 - [ORC] Fix BuildingAJIT tutorial examples that were broken by r343059.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 25 21:00:58 PDT 2018


Author: lhames
Date: Tue Sep 25 21:00:58 2018
New Revision: 343060

URL: http://llvm.org/viewvc/llvm-project?rev=343060&view=rev
Log:
[ORC] Fix BuildingAJIT tutorial examples that were broken by r343059.

createLocalCompileCallbackManager now returns an Expected value. This commit
wraps the call with cantFail to unwrap it.

Modified:
    llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h
    llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h

Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h?rev=343060&r1=343059&r2=343060&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h Tue Sep 25 21:00:58 2018
@@ -76,8 +76,8 @@ public:
                       [this](std::unique_ptr<Module> M) {
                         return optimizeModule(std::move(M));
                       }),
-        CompileCallbackManager(orc::createLocalCompileCallbackManager(
-            TM->getTargetTriple(), ES, 0)),
+        CompileCallbackManager(cantFail(orc::createLocalCompileCallbackManager(
+            TM->getTargetTriple(), ES, 0))),
         CODLayer(ES, OptimizeLayer,
                  [&](orc::VModuleKey K) { return Resolvers[K]; },
                  [&](orc::VModuleKey K, std::shared_ptr<SymbolResolver> R) {

Modified: llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h?rev=343060&r1=343059&r2=343060&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h (original)
+++ llvm/trunk/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h Tue Sep 25 21:00:58 2018
@@ -116,8 +116,8 @@ public:
                       [this](std::unique_ptr<Module> M) {
                         return optimizeModule(std::move(M));
                       }),
-        CompileCallbackMgr(orc::createLocalCompileCallbackManager(
-            TM->getTargetTriple(), ES, 0)) {
+        CompileCallbackMgr(cantFail(orc::createLocalCompileCallbackManager(
+            TM->getTargetTriple(), ES, 0))) {
     auto IndirectStubsMgrBuilder =
       orc::createLocalIndirectStubsManagerBuilder(TM->getTargetTriple());
     IndirectStubsMgr = IndirectStubsMgrBuilder();




More information about the llvm-commits mailing list